ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Cleaner.py
Revision: 1.8
Committed: Mon Mar 17 14:00:59 2008 UTC (17 years, 1 month ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_2_0_pre5, CRAB_2_2_0_pre4, CRAB_2_2_0_pre2
Changes since 1.7: +1 -2 lines
Log Message:
Many changes to integrate BossLite. Creation step fully implemented and optimized... Submission is now working again. Here the missing things are the support for jobs submission by range, the message sending to ML, and the listmatch_match check. Actually the requirements can be changed on the fly as was in the past. The status is fully working with BossLite. The exit code display is not there since the new boss does not implement the RealTime mon.. here the functionality is under development by Federica: to be integrated.

File Contents

# User Rev Content
1 slacapra 1.7 from Actor import *
2 slacapra 1.1 from crab_exceptions import *
3     from crab_logger import Logger
4     from Status import Status
5     import common
6 slacapra 1.6 import string
7 slacapra 1.1
8 slacapra 1.7 class Cleaner(Actor):
9 slacapra 1.5 def __init__(self, cfg_params):
10 slacapra 1.1 """
11     constructor
12     """
13 spiga 1.8 self.status = Status(cfg_params)
14 slacapra 1.1
15     def check(self):
16     """
17     Check whether no job is still running or not yet retrieved
18     """
19    
20     self.status.compute() # compute the status
21    
22     ## SL: What a ugly interface (I use here). I should try a dictionary or something similar...
23 slacapra 1.4 (ToTjob,countCreated,countReady,countSche,countRun,countCleared,countAbort,countCancel,countDone) = self.status.status()
24 slacapra 1.1
25     JobsOnGrid = countRun+countSche+countReady # job still on the grid
26     if JobsOnGrid or countDone:
27     msg = "There are still "
28     if JobsOnGrid:
29     msg= msg+str(JobsOnGrid)+" jobs submitted. Kill them '-kill' before '-clean'"
30     if (JobsOnGrid and countDone):
31     msg = msg + "and \nalso"
32     if countDone:
33     msg= msg+str(countDone)+" jobs Done. Get their outputs '-getoutput' before '-clean'"
34     raise CrabException(msg)
35    
36     pass
37    
38 slacapra 1.7 def run(self):
39 slacapra 1.1 """
40     remove all
41     """
42 slacapra 1.2 if common.jobDB.nJobs()>0:
43     self.check()
44    
45 slacapra 1.1 # here I should first purge boss DB if central
46 slacapra 1.7 common.scheduler.clean()
47     common.work_space.delete()
48 slacapra 1.1 print 'directory '+common.work_space.topDir()+' removed'