80 |
|
""" |
81 |
|
opt={} |
82 |
|
if optsToSave.get('server_mode',0) == 1: opt['serverName']=optsToSave['server_name'] |
83 |
+ |
if common.scheduler.name().upper() not in ['LSF', 'CAF', 'SGE', 'PBS']: |
84 |
+ |
checkNewSiteDB() |
85 |
|
opt['name']= getUserName()+ '_' + string.split(common.work_space.topDir(),'/')[-2]+'_'+common.work_space.task_uuid() |
86 |
< |
task = Task( opt ) |
86 |
> |
task = Task( opt ) |
87 |
|
try: |
88 |
|
common.bossSession.saveTask( task ) |
89 |
|
except Exception, e : |
403 |
|
job.runningJob['state'] = str( rForJ.getAttribute('action') ) |
404 |
|
|
405 |
|
# Needed for unique naming of the output. |
406 |
< |
# GIVES PROBLEMS. FIX in >=2_7_2 |
405 |
< |
#job.runningJob['submission'] = str(rForJ.getAttribute('submission')) |
406 |
> |
job['arguments'] = "%d %s"%(job.runningJob['jobId'], str(rForJ.getAttribute('submission')).strip() ) |
407 |
|
|
408 |
|
common.bossSession.updateDB( task_new ) |
409 |
|
return |
415 |
|
return False |
416 |
|
return True |
417 |
|
|
418 |
< |
# Method to update arguments w.r.t. resubmission number in order to grant unique output |
418 |
> |
# Method to update arguments w.r.t. resubmission number in order to grant unique output |
419 |
|
def updateResubAttribs(self, jobsL): |
420 |
|
task = self.getTask(jobsL) |
421 |
|
for j in task.jobs: |
422 |
< |
newArgs = "%d %d"%(j['jobId'], j['submissionNumber']) |
422 |
> |
common.bossSession.getRunningInstance(j) |
423 |
> |
try: |
424 |
> |
resubNum = int(str(j['arguments']).split(' ')[1]) + 1 |
425 |
> |
except Exception, e: |
426 |
> |
resubNum = j.runningJob['submission'] |
427 |
> |
newArgs = "%d %d"%(j.runningJob['jobId'], resubNum) |
428 |
|
j['arguments'] = newArgs |
423 |
– |
|
424 |
– |
common.bossSession.updateDB(task) |
425 |
– |
return |
429 |
|
|
430 |
+ |
common.bossSession.updateDB(task) |
431 |
+ |
return |
432 |
|
|