Commit 656047e7 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

test

parent f010978d
......@@ -634,14 +634,22 @@ class CycleControl(dict):
if self['time.start'] < self['time.finish']:
# file ID and names
jobid = self['time.start'].strftime('%Y%m%d')
targetdir = os.path.join(self['dir.exec'])
jobfile = os.path.join(targetdir,'jb.%s.jb'%jobid)
logfile = jobfile.replace('.jb','.log')
# Template and commands for job
jobparams = {'jobname':sys.argv[0][2:],'jobtime':'01:30:00'}
template = DaPlatForm.GetJobTemplate(jobparams)
jobcommand = '%s rc=%s'% (sys.argv[0], self['da.restart.fname'], )
template += 'cd %s\n'% self['dir.da_submit']
template += 'rm -f core.*\n'
template += '%s rc=%s %s' % (sys.argv[0],self['da.restart.fname'],join(self.opts,''),)
jobfile = DaPlatForm.WriteJob(self,template,self['time.start'].strftime('%Y%m%d') )
jobid = DaPlatForm.SubmitJob(jobfile)
template += '\ncd %s\n'% self['dir.da_submit']
template += '%s rc=%s %s >& %s' % (sys.argv[0],self['da.restart.fname'],join(self.opts,''),logfile,)
# write and submit
dummy = DaPlatForm.WriteJob(jobfile,template,jobid)
jobid = DaPlatForm.SubmitJob(jobfile,joblog=jobfile)
else:
logging.info('Final date reached, no new cycle started')
......@@ -674,20 +682,9 @@ class CycleControl(dict):
def CleanUpCycle(self):
"""
Move the log file, clean up rundir after a cycle has finished
Nothing to do for now anymore
"""
# move log file to rundir/jobs
jobdir = os.path.join(self['dir.da_run'],"jobs")
logfile = 'das.o%s'%self.DaPlatForm.GetMyID()
if os.path.exists(logfile):
joblogfile = os.path.join(jobdir,'cycle.%s.log'%self['time.sample.start'].strftime('%Y%m%d'))
dummy = shutil.move(logfile,joblogfile)
msg = "....Moved %s to %s"%(logfile,joblogfile) ; logging.debug(msg)
msg = "The complete log file is now at: %s"%(joblogfile) ; logging.info(msg)
def StartLogger():
......
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