A class containing all information necessary to run given bash commands in an arbitrary batch system.
Definition at line 5 of file batchJobBase.py.
◆ __init__()
def sherpaTarCreator.batchJobBase.batchJobBase.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
hours = 0 , |
|
|
|
nCores = 1 , |
|
|
|
memMB = 0 , |
|
|
|
basedir = "" |
|
) |
| |
Definition at line 8 of file batchJobBase.py.
8 def __init__(self, name, hours=0, nCores=1, memMB=0, basedir=""):
19 self.basedir = basedir
22 self.dependsOnAny = []
◆ write()
def sherpaTarCreator.batchJobBase.batchJobBase.write |
( |
|
self, |
|
|
|
useSingularity = True , |
|
|
|
extraDirs = [] |
|
) |
| |
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 |
◆ cmds
sherpaTarCreator.batchJobBase.batchJobBase.cmds |
◆ dependsOnAny
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnAny |
◆ dependsOnOk
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnOk |
◆ env
sherpaTarCreator.batchJobBase.batchJobBase.env |
◆ hours
sherpaTarCreator.batchJobBase.batchJobBase.hours |
◆ id
sherpaTarCreator.batchJobBase.batchJobBase.id |
◆ memMB
sherpaTarCreator.batchJobBase.batchJobBase.memMB |
◆ name
sherpaTarCreator.batchJobBase.batchJobBase.name |
◆ nCores
sherpaTarCreator.batchJobBase.batchJobBase.nCores |
The documentation for this class was generated from the following file: