Commits

Cheng Soon Ong  committed c05e8a6

Some cleanups

  • Participants
  • Parent commits ec3176e

Comments (0)

Files changed (4)

 TEMPDIR should be readable and writable from both submission
 and cluster systems.
 
+If you have any settings of $PYTHONPATH, set it in PYTHONPATH in
+pythongrid.py
+
 Edit your environment such that the drmaa shared library for the grid
 engine is in the shared path. For example
 
 TODO
 
-pre-0.3:
-+ update to new DRMAA wrapper!
 + clearly document "submit and wait" and "submit and collect"
 + remove hard-coded env vars and paths
-+ Add ETHJob
-
-post-0.3:
-+ add apply_to_combination as helper
++ Automatically transfer $PYTHONPATH
 + Unify method jobs, reconsider whether it makes sense to have this
 + Need a better way to set job and file names. Preferably human readable and unique.
 + Clear memory after pickling in the constructor, so reduce memory usage
 + validate member flags for KybJob
 + hold interface
+
+Done
+====
++ (Cheng) update to new DRMAA wrapper
++ (Cheng) Add LSFJob
 # (at your option) any later version.
 #
 # Written (W) 2008-2009 Christian Widmer
+# Written (W) 2008-2009 Cheng Soon Ong
 # Copyright (C) 2008-2009 Max-Planck-Society
 
 import sys

File pythongrid.py

 
 # location of pythongrid.py on cluster file system
 # TODO set this in configuration file
-# PYGRID = "/absolute/path/to/pythongrid/pythongrid.py"
-PYGRID = "/cluster/home/infk/cong/pythongrid/pythongrid.py"
+PYGRID = "/absolute/path/to/pythongrid/pythongrid.py"
 if PYGRID == "/absolute/path/to/pythongrid/pythongrid.py":
     print "Warning: variable PYGRID seems not to be set"
 
 # define temp directories for the input and output variables
 # (must be writable from cluster)
 # TODO define separate client/server TEMPDIR
-# TEMPDIR = "/absolute/path/to/inputoutputdir/"
-TEMPDIR = "/cluster/home/infk/cong/tmp/"
+TEMPDIR = "/absolute/path/to/inputoutputdir/"
 if TEMPDIR == "/absolute/path/to/inputoutputdir/":
     print "Warning: variable TEMPDIR seems not to be set"
     
 PYTHONPATH = []
 if len(PYTHONPATH) > 0:
     PPATH = reduce(lambda x, y: x+':'+y, PYTHONPATH)
-    print PPATH
+    #print PPATH
     os.environ['PYTHONPATH'] = PPATH
     sys.path.extend(PYTHONPATH)
-    print "sys.path=" + str(sys.path)
+    #print "sys.path=" + str(sys.path)
 
 # used for generating random filenames
 alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
     the execute method gets called
     """
 
-    def __init__(self, func, args, kwlist=None, cleanup=True):
+    def __init__(self, func, args=None, kwlist=None, cleanup=True):
         """
         constructor of Job
 
         """
         try:
             #self.ret = apply(self.func, self.args, self.kwlist)
-            if self.kwlist:
+            if self.args and self.kwlist:
                 self.ret = self.func(*(self.args), **(self.kwlist))
+            elif self.args:
+                self.ret = self.func(*(self.args))
+            elif self.kwlist:
+                self.ret = self.func(**(self.kwlist))
             else:
-                self.ret = self.func(*(self.args))
+                self.ret = self.func()
 
         except Exception, error:
 
     Used by _process_jobs_locally"""
     
     #return apply(job.f, job.args, job.kwlist)
-    if job.kwlist:
-        return  job.f(*(job.args), **(job.kwlist))
+    if job.args and job.kwlist:
+        job.ret = job.func(*(job.args), **(job.kwlist))
+    elif job.args:
+        job.ret = job.func(*(job.args))
+    elif job.kwlist:
+        job.ret = job.func(**(job.kwlist))
     else:
-        return  job.f(*(job.args))
-
+        job.ret = job.func()
 
 def _process_jobs_locally(jobs, max_num_threads=None):
     """