[Swift-commit] r8336 - SwiftApps/dsp-swift

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Thu Dec 11 20:41:56 CST 2014


Author: ketan
Date: 2014-12-11 20:41:55 -0600 (Thu, 11 Dec 2014)
New Revision: 8336

Modified:
   SwiftApps/dsp-swift/dsp.blues.swift
   SwiftApps/dsp-swift/swiftjumpdsp.py
   SwiftApps/dsp-swift/swiftjumpdsp.xml
Log:
small changes

Modified: SwiftApps/dsp-swift/dsp.blues.swift
===================================================================
--- SwiftApps/dsp-swift/dsp.blues.swift	2014-12-11 22:25:42 UTC (rev 8335)
+++ SwiftApps/dsp-swift/dsp.blues.swift	2014-12-12 02:41:55 UTC (rev 8336)
@@ -30,11 +30,13 @@
 int p=toInt(arg("pval","1"));
 int I=toInt(arg("I","10"));
 
+string outdir=arg("outloc","outdir");
+
 foreach in_tim,i in timfiles{
 
   /* == Output files definitions == */
-  file out <single_file_mapper; file=strcat("outdir/std_", i, ".out")>;
-  file err <single_file_mapper; file=strcat("outdir/std_", i, ".err")>;
+  file out <single_file_mapper; file=strcat(outdir, "/std_", i, ".out")>;
+  file err <single_file_mapper; file=strcat(outdir, "/std_", i, ".err")>;
   string filespath[]=strsplit(filename(in_tim),"\\.");
 
   /* == App invocation == */

Modified: SwiftApps/dsp-swift/swiftjumpdsp.py
===================================================================
--- SwiftApps/dsp-swift/swiftjumpdsp.py	2014-12-11 22:25:42 UTC (rev 8335)
+++ SwiftApps/dsp-swift/swiftjumpdsp.py	2014-12-12 02:41:55 UTC (rev 8336)
@@ -41,6 +41,7 @@
         p = next(myargs)
         I = next(myargs)
         local_or_compute = next(myargs)
+        outloc = next(myargs)
         outlistfile = next(myargs)
     except:
         traceback.print_exc()
@@ -48,25 +49,21 @@
 
     #which swift
     swift = "/home/ketan/swift-0.95/cog/modules/swift/dist/swift-svn/bin/swift"
-    outloc = "$HOME/outdir"
-    swiftargs="-loc="+inloc+" -a="+a+" -n="+n+"  -pval="+p+"  -I="+I
+    swiftargs="-loc="+inloc+" -a="+a+" -n="+n+"  -pval="+p+" -I="+I+" -outloc="+outloc
     
     BASEDIR = os.path.dirname(os.path.realpath(__file__))
     
-    # create outloc dir
-    if not os.path.exists(outloc):
-        os.makedirs(outloc)
-
     #Invocation
-    logfile="/home/ketan/std.err"
+    logfile="/tmp/std.err"
     with open(logfile,"wb") as errfile:
         exitcode=subprocess.check_call([swift, "-sites.file", "/home/ketan/SwiftApps/dsp-swift/sites.local.xml", "-tc.file", "/home/ketan/SwiftApps/dsp-swift/apps", "-config", "/home/ketan/SwiftApps/dsp-swift/cf", "/home/ketan/SwiftApps/dsp-swift/dsp.blues.swift", swiftargs],stderr=errfile)
     print exitcode
 
     #Populate output file
     outlist=subprocess.check_output(["find", outloc, "-type", "f", "-iname", "*.out"])
-    f=open(outlistfile, "w")
-    f.write(outlist);
+    f=open(outlistfile, "wb")
+    f.write("The results files are as follows:\n")
+    f.write(outlist)
     f.close()
 
 if __name__=='__main__':

Modified: SwiftApps/dsp-swift/swiftjumpdsp.xml
===================================================================
--- SwiftApps/dsp-swift/swiftjumpdsp.xml	2014-12-11 22:25:42 UTC (rev 8335)
+++ SwiftApps/dsp-swift/swiftjumpdsp.xml	2014-12-12 02:41:55 UTC (rev 8336)
@@ -1,4 +1,4 @@
-<tool id="swiftjumpdsp" name="Run dsp from Galaxy in parallel powered by Swift">
+<tool id="swiftjumpdsp" name="dsp swift">
     <!--
          ToDo:
          1. Option if the counter should be an argument, first one or last one.
@@ -18,36 +18,24 @@
         "${p}"
         "${I}"
         "${local_or_compute}"
+        "${resloc}"
         "${outlist}"
     </command>
-    <!--
-       #if $swiftargs.mode == "advanced"
-       #for $sa in $swiftarg
-          ${sa.swiftargname}
-       #end for
-       #end if
-     -->
     <inputs>
         <param name="inlocation" size="60" type="text" label="inlocation" help="Enter the path of the directory containing input data, eg. /home/ketan/farmer" />
-        <param name="a" size="60" type="text" label="aval" help="Enter the value of a"/>
-        <param name="n" size="60" type="text" label="nval" help="Enter the value of n"/>
-        <param name="p" size="60" type="text" label="pval" help="Enter the value of p"/>
-        <param name="I" size="60" type="text" label="Ival" help="Enter the value of I"/>
+        <param name="a" size="30" type="text" label="aval" help="Enter the value of a"/>
+        <param name="n" size="30" type="text" label="nval" help="Enter the value of n"/>
+        <param name="p" size="30" type="text" label="pval" help="Enter the value of p"/>
+        <param name="I" size="30" type="text" label="Ival" help="Enter the value of I"/>
         <param name="local_or_compute" type="select" display="radio" label="choose target execution location">
-           <option value="swiftK" selected="true">local</option>
-           <option value="swiftT">compute</option>
+           <option value="local" selected="true">local</option>
+           <option value="compute">compute</option>
         </param>
+        <param name="resloc" size="60" type="text" label="Location for resulst" help="Enter the path to a directory to put resuts in, eg. /tmp/outdir"/>
     </inputs>
     <outputs>
         <data format="txt" name="outlist" type="data" label="Output List" />
     </outputs>
-
-    <!--
-  <code file="postprocess.py">
-    <hook postprocess="writeoutlist" />
-  </code>
-  -->
-
 <help>
 **What it does**
 




More information about the Swift-commit mailing list