ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DBinterface.py
(Generate patch)

Comparing COMP/CRAB/python/DBinterface.py (file contents):
Revision 1.63 by mcinquil, Thu Jul 23 08:57:37 2009 UTC vs.
Revision 1.69 by farinafa, Fri Feb 26 17:44:57 2010 UTC

# Line 325 | Line 325 | class DBinterface:
325      def deserXmlStatus(self, reportList):
326  
327          task = self.getTask()
328 +        if int(self.cfg_params.get('WMBS.automation',0)) == 1:
329 +            if len(reportList) ==0:
330 +                msg = 'You are using CRAB with WMBS the server is still creating your jobs.\n'
331 +                msg += '\tPlease wait...'
332 +                raise CrabException(msg)
333 +            newJobs =  len(reportList) - len(task.jobs)
334 +            if newJobs != 0:
335 +                isNew=True  
336 +                if len(task.jobs):isNew=False
337 +                jobL=[]  
338 +                for i in range(1,newJobs+1):
339 +                    jobL.append(len(task.jobs)+i)
340 +                self.createJobs_(jobL,isNew)
341 +
342          for job in task.jobs:
343              if not job.runningJob:
344                  raise CrabException( "Missing running object for job %s"%str(job['jobId']) )
# Line 336 | Line 350 | class DBinterface:
350                  if r.getAttribute('id') in [ id, 'all']:
351                      rForJ = r
352                      break
353 +
354 +            # check if rForJ is None
355 +            if rForJ is None:
356 +                common.logger.debug( "Missing XML element for job %s, skip update status"%str(id) )
357 +                continue
358 +            
359              ## Check the submission number and create new running jobs on the client side
360              if rForJ.getAttribute('resubmit') != 'None' and (rForJ.getAttribute('status') not in ['Cleared','Killed','Done','Done (Failed)','Not Submitted', 'Cancelled by user']) :
361                  if int(job.runningJob['submission']) < int(rForJ.getAttribute('resubmit')) + 1:
# Line 380 | Line 400 | class DBinterface:
400  
401                  job.runningJob['state'] = str( rForJ.getAttribute('action') )
402            
403 <            #if str( rForJ.getAttribute('resubmit') ).isdigit():
404 <            #    job['submissionNumber'] = int(rForJ.getAttribute('resubmit'))
405 <            #    job.runningJob['submission'] =  int(rForJ.getAttribute('resubmit'))
403 >                # Needed for unique naming of the output.
404 >                # GIVES PROBLEMS. FIX in >=2_7_2    
405 >                #job.runningJob['submission'] =  str(rForJ.getAttribute('submission'))
406            
387            # TODO cleared='0' field, how should it be handled/mapped in BL? #Fabio
388
407          common.bossSession.updateDB( task_new )
408          return
409  
# Line 396 | Line 414 | class DBinterface:
414                  return False
415          return True
416  
417 +    # Method to update arguments w.r.t. resubmission number in order to grant unique output
418 +    def updateResubAttribs(self, jobsL):
419 +        task = self.getTask(jobsL)
420 +        for j in task.jobs:
421 +            common.bossSession.getRunningInstance(j)
422 +            newArgs = "%d %d"%(j.runningJob['jobId'], j.runningJob['submission'])
423 +            j['arguments'] = newArgs
424 +            
425 +        common.bossSession.updateDB(task)
426 +        return
427 +
428  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines