[cig-commits] r7827 - in cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal: . grid/job

wei at geodynamics.org wei at geodynamics.org
Wed Aug 15 15:09:06 PDT 2007


Author: wei
Date: 2007-08-15 15:09:06 -0700 (Wed, 15 Aug 2007)
New Revision: 7827

Added:
   cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSLHW.java
Modified:
   cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/TGHWGT4.java
   cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSL.java
Log:
Added comments in RSL generation code. Modified HelloWorld test code.

Modified: cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/TGHWGT4.java
===================================================================
--- cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/TGHWGT4.java	2007-08-15 20:04:45 UTC (rev 7826)
+++ cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/TGHWGT4.java	2007-08-15 22:09:06 UTC (rev 7827)
@@ -53,11 +53,11 @@
 		System.out.println("\nStep 2: transfer dataset to "+site);
 		System.out.println("dataset: " + dataset);
 		SimpleTransfer ft = new SimpleTransfer(proxy, myconfig.get("grid.gridftp."+site), 2811);
-		ft.local2remote(dataset, myconfig.get("grid.sites.dmsdir."+site)+"/datasets/helloworld.sample");
+		ft.local2remote(dataset, myconfig.get("grid.sites.testdir."+site)+"/helloworld.sample");
 
 		// 3. submit job : GT4 method
 		System.out.println("\nStep 3: submit job to "+site);
-		String rsl = SimpleRSL.getRSL_GT4(myconfig, site, 0, 1, "helloworld.sample", "helloworld.result");
+		String rsl = SimpleRSLHW.getRSL_GT4(myconfig, site, 0, 1, "helloworld.sample", "helloworld.result");
 		System.out.println("RSL:\n"+rsl);
 		SimpleRunGT4 sr = new SimpleRunGT4(proxy);
 		String jobId = sr.execute(myconfig.get("grid.wsgram."+site), rsl);
@@ -71,7 +71,7 @@
 
 	    // 4. transfer results back
 	    System.out.println("\nStep 4: transfer result from "+site);
-	    String remotefile = myconfig.get("grid.sites.dmsdir."+site)+"/results/helloworld.result";
+	    String remotefile = myconfig.get("grid.sites.testdir."+site)+"/helloworld.result";
 		System.out.println("result file: " + remotefile);
 	    ft.remote2local(remotefile, testhome+"/helloworld.result");
 

Modified: cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSL.java
===================================================================
--- cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSL.java	2007-08-15 20:04:45 UTC (rev 7826)
+++ cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSL.java	2007-08-15 22:09:06 UTC (rev 7827)
@@ -12,6 +12,10 @@
  * A simple globus RSL composer for the MAG application
  * @author liuyan
  * @author wei modified for CIG portal
+ * 
+ * The input shtruncationdegree and k are spherical harmonics truncation degree and logitude symmetry, 
+ * the default values are 32 and 4 respectively. 
+ * These numbers are used to select the corresponding pre-compiled mag executables. 
  */
 public class SimpleRSL {
 	public static String getRSL_GT2(Config myconfig, String site, int shtruncationdegree, int k, String dataset, String jobid) {
@@ -24,7 +28,7 @@
         + "        (count=1)" + "\n"
         + "        (host_count=\"1"+(site.equals("UC")?":ia64-compute":"")+"\")" + "\n"
         + (project==null?"":"        (project=\""+project+"\")" + "\n")
-        + "        (executable=\""+appdir+"/release/runMag.sh"+"\")" + "\n"
+        + "        (executable=\""+appdir+"/release/runMag32s4.sh"+"\")" + "\n"
         //+ "        (arguments=\""+shtruncationdegree+"\" \""+shtruncationdegree+"\" \""+k+"\" \""
         //			+appdir+"/datasets/"+dataset+"\" \""
         //			+appdir+"/results/"+jobid+"."+k+".dat\""+")" + "\n"
@@ -58,7 +62,7 @@
         + "    <hostCount>1</hostCount>" + "\n"
 */
         + (project==null?"":"    <project>"+project+"</project>" + "\n")
-        + "    <executable>"+appdir+"/release/runMag.sh"+"</executable>" + "\n"
+        + "    <executable>"+appdir+"/release/runMag32s4.sh"+"</executable>" + "\n"
         + "    <directory>"+appdir+"/release"+"</directory>" + "\n"
         //+ "    <argument>"+shtruncationdegree+"</argument>" + "\n"
         //+ "    <argument>"+shtruncationdegree+"</argument>" + "\n"

Added: cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSLHW.java
===================================================================
--- cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSLHW.java	2007-08-15 20:04:45 UTC (rev 7826)
+++ cs/cigtg/trunk/cigtg-dev/CigPortal/cigportal/src/org/cig/portal/grid/job/SimpleRSLHW.java	2007-08-15 22:09:06 UTC (rev 7827)
@@ -0,0 +1,85 @@
+/**
+ *  Copyright (c) 2007 Computational Infrastructure for Geodynamics (CIG),
+ *  California Institute of Technology, All Rights Reserved.
+ */
+
+package org.cig.portal.grid.job;
+
+import org.cig.portal.util.Config;
+import java.io.File;
+
+/**
+ * A simple globus RSL composer for the MAG application
+ * @author liuyan
+ * @author wei modified for CIG portal
+ * 
+ * The input shtruncationdegree and k are spherical harmonics truncation degree and logitude symmetry, 
+ * the default is 32 and 4 respectively. These numbers are used to select the corresponding pre-compiled
+ * mag executables. 
+ */
+public class SimpleRSLHW {
+	public static String getRSL_GT2(Config myconfig, String site, int shtruncationdegree, int k, String dataset, String jobid) {
+		String project = myconfig.get("grid.projectname");
+		String appdir = myconfig.get("grid.sites.testdir."+site);
+		
+		// GT2 rsl doesn't need to include resource manager element
+		//return "& (resourceManagerContact=\"tg-login1.sdsc.teragrid.org:2120/jobmanager-pbs\")" + "\n"
+        return "&  (jobType=single)" + "\n"
+        + "        (count=1)" + "\n"
+        + "        (host_count=\"1"+(site.equals("UC")?":ia64-compute":"")+"\")" + "\n"
+        + (project==null?"":"        (project=\""+project+"\")" + "\n")
+        + "        (executable=\""+appdir+"/my_echo"+"\")" + "\n"
+        //+ "        (arguments=\""+shtruncationdegree+"\" \""+shtruncationdegree+"\" \""+k+"\" \""
+        //			+appdir+"/datasets/"+dataset+"\" \""
+        //			+appdir+"/results/"+jobid+"."+k+".dat\""+")" + "\n"
+        //+ "        (directory=\""+appdir+"/release"+"\")" + "\n"
+        + "        (stdout=\""+appdir+"/stdout."+jobid+"."+k+"\")" + "\n"
+        + "        (stderr=\""+appdir+"/stderr."+jobid+"."+k+"\")" + "\n"
+        + "" + "\n";
+	}
+	public static String getRSL_GT4(Config myconfig, String site, int shtruncationdegree, int k, String dataset, String output) {
+		return SimpleRSLHW.getRSL_GT4(true, myconfig, site, shtruncationdegree, k, dataset, output);
+	}
+	public static String getRSL_GT4(boolean header, Config myconfig, String site, int shtruncationdegree, int k, String dataset, String jobid) {
+		String project = myconfig.get("grid.projectname");
+		String appdir = myconfig.get("grid.sites.magdir."+site);
+		String remoteurl = myconfig.get("grid.wsgram."+site);
+		String remotescheduler = myconfig.get("grid.wsgram.rm."+site);
+		return "<job>" + "\n"
+		+	(header?(
+		  "    <factoryEndpoint" + "\n"
+        + "          xmlns:gram=\"http://www.globus.org/namespaces/2004/10/gram/job\"" + "\n"
+        + "          xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\">" + "\n"
+        + "        <wsa:Address>"+remoteurl+"</wsa:Address>" + "\n"
+        + "        <wsa:ReferenceProperties>" + "\n"
+        + "            <gram:ResourceID>"+remotescheduler+"</gram:ResourceID>" + "\n"
+        + "        </wsa:ReferenceProperties>" + "\n"
+        + "    </factoryEndpoint>" + "\n"
+        	):"")
+/* optional        	
+        + "    <jobType>single</jobType>" + "\n"
+        + "    <count>1</count>" + "\n"
+        + "    <hostCount>1</hostCount>" + "\n"
+*/
+        + (project==null?"":"    <project>"+project+"</project>" + "\n")
+        + "    <executable>"+appdir+"/my_echo"+"</executable>" + "\n"
+        + "    <directory>"+appdir+"</directory>" + "\n"
+        //+ "    <argument>"+shtruncationdegree+"</argument>" + "\n"
+        //+ "    <argument>"+shtruncationdegree+"</argument>" + "\n"
+        //+ "    <argument>"+k+"</argument>" + "\n"
+        //+ "    <argument>"+appdir+"/datasets/"+dataset+"</argument>" + "\n"
+        //+ "    <argument>"+appdir+"/results/"+jobid+"."+k+".dat</argument>" + "\n"
+        + "    <stdout>"+appdir+"/stdout."+jobid+"."+k+"</stdout>" + "\n"
+        + "    <stderr>"+appdir+"/stderr."+jobid+"."+k+"</stderr>" + "\n"
+        + "</job>" + "\n";
+	}
+	public static void main(String[] args) throws Exception {
+		org.cig.portal.util.Config myconfig=new org.cig.portal.util.Config();
+		SimpleRSL myrsl = new SimpleRSL();
+		String rsl = myrsl.getRSL_GT2(myconfig, "UC", 32, 4, "mydataset", "myoutput");
+		String rsl2 = myrsl.getRSL_GT2(myconfig, "SDSC", 32, 4, "mydataset", "myoutput");
+		String rsl3 = myrsl.getRSL_GT4(myconfig, "SDSC", 32, 4, "mydataset", "myoutput");
+	}
+
+}
+



More information about the cig-commits mailing list