ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
sherpaTarCreator.batchJobBase.batchJobBase Class Reference
Inheritance diagram for sherpaTarCreator.batchJobBase.batchJobBase:
Collaboration diagram for sherpaTarCreator.batchJobBase.batchJobBase:

Public Member Functions

def __init__ (self, name, hours=0, nCores=1, memMB=0, basedir="")
 
def write (self, useSingularity=True, extraDirs=[])
 

Public Attributes

 name
 
 cmds
 
 hours
 
 nCores
 
 memMB
 
 env
 
 basedir
 
 id
 
 dependsOnOk
 
 dependsOnAny
 

Detailed Description

A class containing all information necessary to run given bash commands in an arbitrary batch system.

Definition at line 5 of file batchJobBase.py.

Constructor & Destructor Documentation

◆ __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=""):
9  self.name = name
10  self.cmds = []
11  self.hours = hours
12  self.nCores = nCores
13  self.memMB = memMB
14  if self.memMB == 1:
15  self.memMB = 1499
16  if self.memMB == 2:
17  self.memMB = 2499
18  self.env = {}
19  self.basedir = basedir
20  self.id = None
21  self.dependsOnOk = []
22  self.dependsOnAny = []
23 

Member Function Documentation

◆ 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"
26 
27  # COMPILER_PATH
28  if useSingularity:
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'
36  executable += 'fi\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"
40 
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"
44  for cmd in self.cmds:
45  executable += cmd+"\n"
46  executable += "exit 0\n"
47 
48 
49  filename = self.basedir+"/"+self.name+".sh"
50  with open(filename, 'w') as f:
51  f.write(executable)
52 
53  #make shell-files executable
54  st = os.stat(filename)
55  os.chmod(filename, st.st_mode | stat.S_IEXEC)
56 
57 

Member Data Documentation

◆ basedir

sherpaTarCreator.batchJobBase.batchJobBase.basedir

Definition at line 19 of file batchJobBase.py.

◆ cmds

sherpaTarCreator.batchJobBase.batchJobBase.cmds

Definition at line 10 of file batchJobBase.py.

◆ dependsOnAny

sherpaTarCreator.batchJobBase.batchJobBase.dependsOnAny

Definition at line 22 of file batchJobBase.py.

◆ dependsOnOk

sherpaTarCreator.batchJobBase.batchJobBase.dependsOnOk

Definition at line 21 of file batchJobBase.py.

◆ env

sherpaTarCreator.batchJobBase.batchJobBase.env

Definition at line 18 of file batchJobBase.py.

◆ hours

sherpaTarCreator.batchJobBase.batchJobBase.hours

Definition at line 11 of file batchJobBase.py.

◆ id

sherpaTarCreator.batchJobBase.batchJobBase.id

Definition at line 20 of file batchJobBase.py.

◆ memMB

sherpaTarCreator.batchJobBase.batchJobBase.memMB

Definition at line 13 of file batchJobBase.py.

◆ name

sherpaTarCreator.batchJobBase.batchJobBase.name

Definition at line 9 of file batchJobBase.py.

◆ nCores

sherpaTarCreator.batchJobBase.batchJobBase.nCores

Definition at line 12 of file batchJobBase.py.


The documentation for this class was generated from the following file:
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
Trk::split
@ split
Definition: LayerMaterialProperties.h:38