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

Comparing COMP/CRAB/python/Killer.py (file contents):
Revision 1.2 by spiga, Mon Apr 14 16:36:31 2008 UTC vs.
Revision 1.13 by spiga, Thu Sep 4 08:00:04 2008 UTC

# Line 13 | Line 13 | class Killer(Actor):
13          The main method of the class: kill a complete task
14          """
15          common.logger.debug(5, "Killer::run() called")
16 <
17 <        jStatus=common._db.queryRunJob('status','all')
18 <
16 >        task = common._db.getTask(self.range)
17          toBeKilled = []
18 <        print jStatus
19 <        for id in self.range:
20 <            if id not in  common._db.nJobs("list"):
21 <                common.logger.message("Warning: job # "+str(id)+" doesn't exists! Not possible to kill it.")
22 <            else:
23 <                if ( jStatus[id-1] in ['SS','R']):
26 <                    toBeKilled.append(id)
27 <                else:
28 <                    common.logger.message("Not possible to kill Job #"+str(id)+" : Status is "+jStatus[id-1])
29 <                pass
30 <            pass
18 >        for job  in task.jobs:
19 >           if ( job.runningJob['status'] in ['SU','SS','R','S','SR','SW']):
20 >               toBeKilled.append(job['jobId'])
21 >           else:
22 >               common.logger.message("Not possible to kill Job #"+str(job['jobId'])+" : Status is "+str(job.runningJob['statusScheduler']))
23 >           pass
24  
25 <        common.scheduler.cancel(toBeKilled)
26 <        common.logger.message("Jobs killed "+str(toBeKilled))
25 >        if len(toBeKilled)>0:
26 >            common.scheduler.cancel(toBeKilled)
27 >            common.logger.message("Jobs killed "+str(toBeKilled))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines