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

Comparing COMP/CRAB/python/SchedulerSge.py (file contents):
Revision 1.5 by ewv, Mon Mar 9 15:56:26 2009 UTC vs.
Revision 1.11 by spiga, Thu May 6 15:00:21 2010 UTC

# Line 2 | Line 2 | from Scheduler import Scheduler
2   from SchedulerLocal import SchedulerLocal
3   from crab_exceptions import *
4   from crab_util import *
5 from crab_logger import Logger
5   import common
6  
7   import os,string
# Line 19 | Line 18 | class SchedulerSge(SchedulerLocal) :
18  
19      def __init__(self):
20          Scheduler.__init__(self,"SGE")
21 <
21 >        self.datasetPath   = None
22 >        self.selectNoInput = None
23          return
24  
25      def configure(self, cfg_params):
26          SchedulerLocal.configure(self, cfg_params)
27  
28 <        #self.role = cfg_params.get("EDG.role", None)
28 >        try:
29 >            tmp =  cfg_params['CMSSW.datasetpath']
30 >            if tmp.lower() == 'none':
31 >                self.datasetPath = None
32 >                self.selectNoInput = 1
33 >            else:
34 >                self.datasetPath = tmp
35 >                self.selectNoInput = 0
36 >        except KeyError:
37 >            msg = "Error: datasetpath not defined "
38 >            raise CrabException(msg)
39 >
40 >        self.return_data = cfg_params.get('USER.return_data', 0)
41 >        self.copy_data   = cfg_params.get("USER.copy_data", 0)
42 >
43 >        if ( int(self.return_data) == 0 and int(self.copy_data) == 0 ):
44 >            msg = 'Error: return_data and copy_data cannot be set both to 0\n'
45 >            msg = msg + 'Please modify your crab.cfg file\n'
46 >            raise CrabException(msg)
47 >
48 >        if ( int(self.return_data) == 1 and int(self.copy_data) == 1 ):
49 >            msg = 'Error: return_data and copy_data cannot be set both to 1\n'
50 >            msg = msg + 'Please modify your crab.cfg file\n'
51 >            raise CrabException(msg)
52 >
53 >        if ( int(self.copy_data) == 0 and int(self.publish_data) == 1 ):
54 >            msg = 'Warning: publish_data = 1 must be used with copy_data = 1\n'
55 >            msg = msg + 'Please modify copy_data value in your crab.cfg file\n'
56 >            common.logger.info(msg)
57 >            raise CrabException(msg)
58 >
59 >        if int(self.copy_data) == 1:
60 >            self.SE = cfg_params.get('USER.storage_element', None)
61 >            if not self.SE:
62 >                msg = "Error. The [USER] section has no 'storage_element'"
63 >                common.logger.info(msg)
64 >                raise CrabException(msg)
65 >
66 >            self.proxyValid = 0
67 >            self.dontCheckProxy = int(cfg_params.get("GRID.dont_check_proxy",0))
68 >            self.proxyServer = cfg_params.get("GRID.proxy_server",'myproxy.cern.ch')
69 >            common.logger.debug('Setting myproxy server to ' + self.proxyServer)
70 >
71 >            self.group = cfg_params.get("GRID.group", None)
72 >            self.role  = cfg_params.get("GRID.role", None)
73 >            self.VO    = cfg_params.get('GRID.virtual_organization', 'cms')
74 >
75 >            self.checkProxy()
76 >
77          self.role = None
78  
79          self.pool = cfg_params.get('USER.storage_pool',None)
80 <        ## default is 48 hours CPU time, 2G memrory
81 <        self.cpu = cfg_params.get('USER.cpu',172800)
34 <        self.vmem = cfg_params.get('USER.vmem',2)
80 > #        self.cpu = cfg_params.get('USER.cpu',172800)
81 > #        self.vmem = cfg_params.get('USER.vmem',2)
82          return
83  
84      def envUniqueID(self):
# Line 58 | Line 105 | class SchedulerSge(SchedulerLocal) :
105              sched_param= ''
106              if (self.queue):
107                  sched_param += '-q '+self.queue +' '
108 <                if (self.res): sched_param += ' -R '+self.res +' '
109 <            pass
108 >            if (self.res): sched_param += '-l '+self.res +' '
109 >
110 >        pass
111  
112          #default is request 2G memory and 48 hours CPU time
113          #sched_param += ' -V -l h_vmem=2G -l h_cpu=172800 '
114 <        sched_param += ' -V -l h_vmem='
115 <        sched_param += self.vmem.__str__()
116 <        sched_param += 'G -l h_cpu='
117 <        sched_param += self.cpu.__str__()
118 <        sched_param += ' '
114 > #        sched_param += ' -V -l h_vmem='
115 > #        sched_param += self.vmem.__str__()
116 > #        sched_param += 'G -l h_cpu='
117 > #        sched_param += self.cpu.__str__()
118 > #        sched_param += ' '
119  
120          return sched_param
121  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines