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

Comparing COMP/CRAB/python/cms_cmssw.py (file contents):
Revision 1.70 by slacapra, Wed Feb 28 14:17:24 2007 UTC vs.
Revision 1.73 by gutsche, Sun Apr 8 18:39:51 2007 UTC

# Line 20 | Line 20 | class Cmssw(JobType):
20          self._params = {}
21          self.cfg_params = cfg_params
22  
23 +        try:
24 +            self.MaxTarBallSize = float(self.cfg_params['EDG.maxtarballsize'])
25 +        except KeyError:
26 +            self.MaxTarBallSize = 100.0
27 +
28          # number of jobs requested to be created, limit obj splitting
29          self.ncjobs = ncjobs
30  
# Line 29 | Line 34 | class Cmssw(JobType):
34          self.additional_inbox_files = []
35          self.scriptExe = ''
36          self.executable = ''
37 +        self.executable_arch = self.scram.getArch()
38          self.tgz_name = 'default.tgz'
39          self.scriptName = 'CMSSW.sh'
40          self.pset = ''      #scrip use case Da  
# Line 44 | Line 50 | class Cmssw(JobType):
50          ### collect Data cards
51  
52          ## get DBS mode
47        self.use_dbs_2 = 0
53          try:
54              self.use_dbs_2 = int(self.cfg_params['CMSSW.use_dbs_2'])
55          except KeyError:
# Line 682 | Line 687 | class Cmssw(JobType):
687          try: # create tar ball
688              tar = tarfile.open(self.tgzNameWithPath, "w:gz")
689              ## First find the executable
690 <            if (self.executable != ''):
690 >            if (executable != ''):
691                  exeWithPath = self.scram.findFile_(executable)
692                  if ( not exeWithPath ):
693                      raise CrabException('User executable '+executable+' not found')
# Line 693 | Line 698 | class Cmssw(JobType):
698                      common.logger.debug(5,"Exe "+exeWithPath+" to be tarred")
699                      path = swArea+'/'
700                      exe = string.replace(exeWithPath, path,'')
701 <                    tar.add(path+exe,exe)
701 >                    tar.add(path+exe,executable)
702                      pass
703                  else:
704                      # the exe is from release, we'll find it on WN
# Line 729 | Line 734 | class Cmssw(JobType):
734              tar.close()
735          except :
736              raise CrabException('Could not create tar-ball')
737 <        
737 >
738 >        ## check for tarball size
739 >        tarballinfo = os.stat(self.tgzNameWithPath)
740 >        if ( tarballinfo.st_size > self.MaxTarBallSize*1024*1024 ) :
741 >            raise CrabException('Input sandbox size of ' + str(float(tarballinfo.st_size)/1024.0/1024.0) + ' MB is larger than the allowed ' + str(self.MaxTarBallSize) + ' MB input sandbox limit and not supported by the used GRID submission system. Please make sure that no unnecessary files are in all data directories in your local CMSSW project area as they are automatically packed into the input sandbox.')
742 >
743          ## create tar-ball with ML stuff
744          self.MLtgzfile =  common.work_space.pathForTgz()+'share/MLfiles.tgz'
745          try:
# Line 807 | Line 817 | class Cmssw(JobType):
817          txt += '   exit 1 \n'
818          txt += 'fi \n'
819          txt += 'echo "CMSSW_VERSION =  '+self.version+'"\n'
820 +        txt += 'export SCRAM_ARCH='+self.executable_arch+'\n'
821          txt += 'cd '+self.version+'\n'
822          ### needed grep for bug in scramv1 ###
823          txt += scram+' runtime -sh\n'
# Line 1194 | Line 1205 | class Cmssw(JobType):
1205          txt += '       fi\n'
1206          txt += '   fi\n'
1207          txt += '   \n'
1197        txt += '   string=`cat /etc/redhat-release`\n'
1198        txt += '   echo $string\n'
1199        txt += '   if [[ $string = *alhalla* ]]; then\n'
1200        txt += '       echo "SCRAM_ARCH= $SCRAM_ARCH"\n'
1201        txt += '   elif [[ $string = *Enterprise* ]] || [[ $string = *cientific* ]]; then\n'
1202        txt += '       export SCRAM_ARCH=slc3_ia32_gcc323\n'
1203        txt += '       echo "SCRAM_ARCH= $SCRAM_ARCH"\n'
1204        txt += '   else\n'
1205        txt += '       echo "SET_CMS_ENV 10033 ==> ERROR OS unknown, LCG environment not initialized"\n'
1206        txt += '       echo "JOB_EXIT_STATUS = 10033"\n'
1207        txt += '       echo "JobExitCode=10033" | tee -a $RUNTIME_AREA/$repo\n'
1208        txt += '       dumpStatus $RUNTIME_AREA/$repo\n'
1209        txt += '       rm -f $RUNTIME_AREA/$repo \n'
1210        txt += '       echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
1211        txt += '       echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
1212        txt += '       exit 1\n'
1213        txt += '   fi\n'
1208          txt += '   echo "SET_CMS_ENV 0 ==> setup cms environment ok"\n'
1209          txt += '   echo "### END SETUP CMS LCG ENVIRONMENT ###"\n'
1210          return txt

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines