ATLAS Offline Software
Loading...
Searching...
No Matches
Generators
Sherpa_i
python
sherpaTarCreator
htcondor_baf.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
import
os
4
5
joblist = []
6
dependencelist = {}
#"id":["childid"]
7
8
from
.
import
batchJobBase
9
10
class
batchJob
(
batchJobBase.batchJobBase
):
11
12
def
submit
(self, dryRun=False):
13
if
self.
memMB
== 1:
14
self.
memMB
= 2000
15
elif
self.
memMB
== 2:
16
self.
memMB
= 6000
17
18
self.
id
=self.
name
+
".sh"
19
self.
id
= self.
id
.
replace
(
"."
,
"-"
)
20
21
joblist.append(self)
22
for
parentid
in
self.
dependsOnOk
+self.
dependsOnAny
:
23
dependencelist.setdefault(parentid, []).append(self.
id
)
24
25
#create submit file
26
submitfile =
""
27
submitfile +=
"executable = "
+self.
basedir
+
"/"
+self.
name
+
".sh\n"
28
submitfile +=
"output = "
+self.
basedir
+
"/"
+self.
name
+
".log\n"
29
submitfile +=
"error = "
+self.
basedir
+
"/"
+self.
name
+
".log\n"
30
submitfile +=
"log = outHTC.log\n"
31
submitfile +=
"+ContainerOS = \"Rocky9\"\n"
32
submitfile +=
"+CephFS_IO = \"low\"\n"
33
submitfile +=
"+MaxRuntimeHours = "
+str(int(self.
hours
))+
"\n"
34
submitfile +=
"RequestCpus = "
+str(
max
(self.
nCores
,int(self.
memMB
/2000.)))+
"\n"
35
submitfile +=
"queue\n"
36
with
open(self.
basedir
+
"/"
+self.
name
+
".sub"
,
'w'
)
as
f:
37
f.write(submitfile)
38
print
(
"Created "
+str(self.
id
)+
" ("
+self.
basedir
+
"/"
+self.
name
+
".sub"
)
39
40
def
finalizeJobs
(dryRun):
41
42
#create dagfile
43
dagfile =
""
44
for
job
in
joblist:
45
dagfile +=
"JOB "
+job.id+
" "
+job.basedir+
"/"
+job.name+
".sub\n"
46
47
for
parent,children
in
dependencelist.items():
48
dagfile +=
"PARENT "
+parent+
" CHILD"
49
for
child
in
children:
50
dagfile +=
" "
+child
51
dagfile +=
"\n"
52
53
#save file
54
with
open(
"dagfile.dag"
,
'w'
)
as
f:
55
f.write(dagfile)
56
57
#submit job
58
batchname = os.path.basename(os.path.normpath(os.getcwd()))
59
cmd =
"condor_submit_dag -force -batch-name "
+batchname+
" dagfile.dag"
60
61
if
dryRun:
62
print
(
"Submission command:"
, cmd+
"\n"
)
63
print
(
"dagfile: \n"
+dagfile)
64
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
max
#define max(a, b)
Definition
cfImp.cxx:41
sherpaTarCreator.batchJobBase.batchJobBase
Definition
batchJobBase.py:5
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnOk
list dependsOnOk
Definition
batchJobBase.py:24
sherpaTarCreator.batchJobBase.batchJobBase.dependsOnAny
list dependsOnAny
Definition
batchJobBase.py:25
sherpaTarCreator.batchJobBase.batchJobBase.nCores
nCores
Definition
batchJobBase.py:12
sherpaTarCreator.batchJobBase.batchJobBase.name
name
Definition
batchJobBase.py:9
sherpaTarCreator.batchJobBase.batchJobBase.basedir
basedir
Definition
batchJobBase.py:22
sherpaTarCreator.batchJobBase.batchJobBase.hours
hours
Definition
batchJobBase.py:11
sherpaTarCreator.batchJobBase.batchJobBase.memMB
int memMB
Definition
batchJobBase.py:15
sherpaTarCreator.batchJobBase.batchJobBase.id
id
Definition
batchJobBase.py:23
sherpaTarCreator.htcondor_baf.batchJob
Definition
htcondor_baf.py:10
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition
hcg.cxx:310
sherpaTarCreator.htcondor_baf.finalizeJobs
finalizeJobs(dryRun)
Definition
htcondor_baf.py:40
submit
Definition
submit.py:1
Generated on
for ATLAS Offline Software by
1.14.0