Definition at line 13 of file slurm_taurus.py.
◆ submit()
def sherpaTarCreator.slurm_taurus.batchJob.submit |
( |
|
self, |
|
|
|
dryRun = False |
|
) |
| |
Definition at line 15 of file slurm_taurus.py.
15 def submit(self, dryRun=False):
17 if self.memMB == 1499:
19 elif self.memMB == 2499:
23 cmd =
"sbatch -e "+self.basedir+
"/"+self.name+
".log -o "+self.basedir+
"/"+self.name+
".log --time="+
str(self.hours)+
":00:00 --mem-per-cpu="+
str(self.memMB)+
" -p haswell,romeo --cpus-per-task="+
str(cpt)+
" -N 1 --ntasks "+
str(self.nCores)
24 if os.environ.get(
'SLURM_MAIL_USER'):
25 cmd +=
" --mail-type='END,FAIL,TIME_LIMIT' --mail-user='"+os.environ.get(
'SLURM_MAIL_USER')+
"'"
27 if len(self.dependsOnOk)>0
or len(self.dependsOnAny)>0:
29 if len(self.dependsOnOk)>0:
30 okdeps =
"afterok:"+
",afterok:".
join(self.dependsOnOk)
32 if len(self.dependsOnAny)>0:
33 anydeps =
"afterany:"+
",afterany:".
join(self.dependsOnAny)
37 if "ecm" in self.basedir:
38 jobname = os.path.relpath(self.basedir+
"/"+self.name+
".log", self.basedir+
"/../..")
40 jobname = os.path.relpath(self.basedir+
"/"+self.name+
".log", self.basedir+
"/..")
41 cmd +=
" -J "+jobname+
" "+self.basedir+
"/"+self.name+
".sh >> qsub.log \n"
48 p = subprocess.Popen(cmd,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
49 retcode = p.communicate()
55 print (
"ERROR: error while submitting job")
56 print (
"return code: " +
str(p.returncode))
63 print(
"Submitted "+
str(self.id)+
" ("+self.name+
")\n\n")
◆ 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.slurm_taurus.batchJob.id |
◆ memMB
sherpaTarCreator.slurm_taurus.batchJob.memMB |
◆ name
sherpaTarCreator.batchJobBase.batchJobBase.name |
|
inherited |
◆ nCores
sherpaTarCreator.batchJobBase.batchJobBase.nCores |
|
inherited |
The documentation for this class was generated from the following file: