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

Comparing COMP/CRAB/python/GetOutput.py (file contents):
Revision 1.9 by spiga, Wed Apr 9 07:52:58 2008 UTC vs.
Revision 1.10 by slacapra, Fri Apr 11 14:54:22 2008 UTC

# Line 8 | Line 8 | class GetOutput(Actor):
8          self.cfg_params = args[0]
9          self.jobs = args[1]
10          
11 <        self.outDir = self.cfg_params.get("USER.outputdir", common.work_space.resDir() )
12 <        self.logDir = self.cfg_params.get("USER.logdir", common.work_space.resDir() )
11 >        self.outDir = common.work_space.resDir()
12 >        self.logDir = common.work_space.resDir()
13          self.return_data = self.cfg_params.get('USER.return_data',0)
14  
15 <        self.possible_status = [
16 <                         'Undefined',
17 <                         'Submitted',
18 <                         'Waiting',
19 <                         'Ready',
20 <                         'Scheduled',
21 <                         'Running',
22 <                         'Done',
23 <                         'Cancelled',
24 <                         'Aborted',
25 <                         'Unknown',
26 <                         'Done(failed)'
27 <                         'Cleared'
28 <                          ]
15 >        self.possible_status = {
16 >                         'UN': 'Unknown',
17 >                         'SU': 'Submitted',
18 >                         'SW': 'Waiting',
19 >                         'SS': 'Scheduled',
20 >                         'R': 'Running',
21 >                         'SD': 'Done',
22 >                         'SK': 'Killed',
23 >                         'SA': 'Aborted',
24 >                         'SE': 'Cleared',
25 >                         'E': 'Cleared'
26 >                          }
27          return
28  
29      def run(self):
# Line 50 | Line 48 | class GetOutput(Actor):
48          self.list_id=[]
49          self.all_id =[]    
50          for job in self.up_task.jobs:
51 <            if job.runningJob['statusScheduler']=='Done':
51 >            if job.runningJob['status']=='SD':
52                  list_id_done.append(job['id'])  
53              self.all_id.append(job['id'])  
54          check = -1
# Line 58 | Line 56 | class GetOutput(Actor):
56          if len(list_id_done)==0 or ( check == 0 ) :
57              msg='\n'    
58              list_ID=[]
59 <            for st in self.possible_status:
60 <                list_ID = common._db.queryAttrRunJob({'statusScheduler':st},'jobId')
61 <                if len(list_ID)>0: msg += "       %i Jobs  %s \n" % (len(list_ID), str(st))
59 >            for st,stDetail in self.possible_status.iteritems():
60 >                list_ID = common._db.queryAttrRunJob({'status':st},'jobId')
61 >                if len(list_ID)>0: msg += "       %i Jobs in status: %s \n" % (len(list_ID), str(stDetail))
62              msg += '\n*******No jobs in Done status. It is not possible yet to retrieve the output.\n'
63              raise CrabException(msg)
64          else:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines