Commit ffc6cb58 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

changed logic of resubmittng, now using settings and code of original job...

changed logic of resubmittng, now using settings and code of original job file, not a newly created one
parent bbcdfd85
......@@ -64,10 +64,10 @@ class JetPlatForm(PlatForm):
except:
return os.getpid()
def SubmitJob(self,jobfile):
def SubmitJob(self,jobcommand):
""" This method submits a jobfile to the queue, and returns the queue ID """
cmd = ['qsub',jobfile]
cmd = ['qsub',jobcommand]
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
retcode = output.split()[-1]
......
......@@ -495,10 +495,9 @@ class CycleControl(dict):
def SubmitNextCycle(self):
"""
Submit the next job of a DA cycle, this consists of
* getting a job template as returned by :meth:`~da.tools.baseclasses.platform.GetJobTemplate`
* adding the lines needed to start a next run with a newly created rc-file
* Writing the jobfile as done by :meth:`~da.tools.baseclasses.platform.WriteJob`
* Submitting the jobfile as done by :meth:`~da.tools.baseclasses.platform.WriteJob`
* Changing to the working directory from which the job was started initially
* create a line to start the master script again with a newly created rc-file
* Submitting the jobfile
If the end of the cycle series is reached, no new job is submitted.
......@@ -511,14 +510,9 @@ class CycleControl(dict):
if self['time.start'] < self['time.finish']:
jobparams = {'jobname':'das','jobaccount':'co2','jobnodes':'nserial 1','jobtime':'06:00:00','jobshell':'/bin/sh'}
template = DaPlatForm.GetJobTemplate(jobparams)
template += 'cd %s\n'%os.getcwd()
template += '%s rc=%s'% (sys.argv[0], self['da.restart.fname'], ) )
cd = self['time.end'].strftime('%Y%m%d')
jobfile = DaPlatForm.WriteJob(self,template,'cycle.%s.das'%cd)
jobid = DaPlatForm.SubmitJob(jobfile)
jobcommand = '%s rc=%s'% (sys.argv[0], self['da.restart.fname'], ) )
dummy = os.chdir(self['dir.da_submit'] )
jobid = DaPlatForm.SubmitJob(jobcommand)
else:
logging.info('Final date reached, no new cycle started')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment