Definition at line 14 of file sge_grace.py.
◆ submit()
def sherpaTarCreator.sge_grace.batchJob.submit |
( |
|
self, |
|
|
|
dryRun = False |
|
) |
| |
Definition at line 16 of file sge_grace.py.
16 def submit(self, dryRun=False):
18 cmd =
"qsub -e "+self.basedir+
"/"+self.name+
".log -o "+self.basedir+
"/"+self.name+
".log"
20 if len(self.dependsOnOk)>0
or len(self.dependsOnAny)>0:
22 if len(self.dependsOnOk)>0:
25 cmd +=
str(self.dependsOnOk[-1])
26 if len(self.dependsOnAny)>0:
29 cmd +=
str(self.dependsOnAny[-1])
31 if "ecm" in self.basedir:
32 jobname = os.path.basename(os.path.normpath(self.basedir+
"/../"))+
"_"+self.name
34 jobname = os.path.basename(os.path.normpath(self.basedir))+
"_"+self.name
37 user = os.environ.get(
'USER')
38 cmd +=
" >> qsub.log <<EOF \n"
39 cmd +=
"#!/bin/bash -l\n"
41 cmd +=
"#$ -S /bin/bash\n"
42 cmd +=
"#$ -l h_rt=%i:0:0\n" % self.hours
43 cmd +=
"#$ -l mem=%iG\n" %
int(
round(0.001*self.memMB))
44 cmd +=
"#$ -N j%s\n" % jobname
45 cmd +=
"#$ -pe mpi %i\n" % self.nCores
46 cmd +=
"#$ -wd %s\n" % self.basedir
47 cmd +=
"cd %s;\n" % self.basedir
48 cmd +=
"ulimit -f 3000000;\n"
49 cmd +=
"export PARROT_CVMFS_ALIEN_CACHE=/lustre/scratch/scratch/%s/cvmfs_cache/\n" % user
50 cmd +=
'export PARROT_CVMFS_REPO="<default-repositories> url=http://cvmfs-atlas-nightlies.cern.ch/cvmfs/atlas-nightlies.cern.ch"\n'
51 cmd +=
"module unload compilers mpi\n"
52 cmd +=
"module load compilers/gnu/4.9.2\n"
53 cmd +=
"module load cctools/7.0.11/gnu-4.9.2\n"
54 cmd +=
"module load mpi/openmpi/1.8.4/gnu-4.9.2\n"
55 cmd +=
"module load python/2.7.12\n"
56 cmd +=
"module load python2/recommended\n"
57 cmd +=
"module load scons/2.3.4\n"
58 cmd +=
"module load texinfo/6.6\n"
59 mpiwrap =
'gerun ' if self.nCores > 4
else ''
60 cmd +=
"(parrot_run bash -c \'"+mpiwrap+self.basedir+
"/"+self.name+
".sh\') >> "+self.basedir+
"/"+self.name+
".log;\n"
69 p = subprocess.Popen(cmd,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
70 retcode = p.communicate()
76 print (
"ERROR: error while submitting job")
77 print (
"return code: " +
str(p.returncode))
83 print(
"Submitted "+
str(self.id)+
" ("+self.name+
")")
◆ write()
def sherpaTarCreator.batchJobBase.batchJobBase.write |
( |
|
self, |
|
|
|
useSingularity = True , |
|
|
|
extraDirs = [] |
|
) |
| |
|
inherited |
Definition at line 24 of file batchJobBase.py.
24 def write(self, useSingularity=True, extraDirs=[]):
25 executable =
"#!/bin/sh -\n"
29 platform =
str(os.environ[
'COMPILER_PATH']).
split(
'/')[-1].
replace(
'el9',
'almalinux9')
30 executable +=
'if [ "$1" != "--really" ]; then \n'
31 executable +=
' exec singularity exec -e --no-home'
32 for dir
in [
"/cvmfs",
"/var", self.basedir,
"$(pwd | cut -d '/' -f 1-2)"] + extraDirs:
33 executable +=
' -B '+dir
34 executable +=
' /cvmfs/atlas.cern.ch/repo/containers/fs/singularity/'
35 executable += platform +
' /bin/bash -- "$0" --really "$@";\n'
37 executable +=
"shift;\n\n"
38 executable +=
"export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase\n"
39 executable +=
"source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh\n"
41 executable +=
"ulimit -f 1000000;\n"
42 executable +=
"cd "+self.basedir+
"\n\n"
43 executable +=
"echo 'ncores="+
str(self.nCores)+
" nhours="+
str(self.hours)+
" "+self.basedir+
"/"+self.name+
".sh';\n"
45 executable += cmd+
"\n"
46 executable +=
"exit 0\n"
49 filename = self.basedir+
"/"+self.name+
".sh"
50 with open(filename,
'w')
as f:
54 st = os.stat(filename)
55 os.chmod(filename, st.st_mode | stat.S_IEXEC)
◆ basedir
sherpaTarCreator.batchJobBase.batchJobBase.basedir |
|
inherited |
◆ cmds
sherpaTarCreator.batchJobBase.batchJobBase.cmds |
|
inherited |
◆ dependsOnAny
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnAny |
|
inherited |
◆ dependsOnOk
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnOk |
|
inherited |
◆ env
sherpaTarCreator.batchJobBase.batchJobBase.env |
|
inherited |
◆ hours
sherpaTarCreator.batchJobBase.batchJobBase.hours |
|
inherited |
◆ id
sherpaTarCreator.sge_grace.batchJob.id |
◆ memMB
sherpaTarCreator.batchJobBase.batchJobBase.memMB |
|
inherited |
◆ name
sherpaTarCreator.batchJobBase.batchJobBase.name |
|
inherited |
◆ nCores
sherpaTarCreator.batchJobBase.batchJobBase.nCores |
|
inherited |
The documentation for this class was generated from the following file: