Skip to content

Commit c1ac6d8

Browse files
committed
Some error detection during timestamp sampling
1 parent f3fbb64 commit c1ac6d8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

MC/bin/o2dpg_sim_workflow_anchored.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,14 @@ def determine_timestamp(sor, eor, splitinfo, cycle, ntf):
192192

193193
# ntimeframes is the total number of timeframes possible
194194
# if we have totaljobs number of jobs
195-
timeframesperjob = ntimeframes // totaljobs
195+
maxtimeframesperjob = ntimeframes // totaljobs
196196
orbitsperjob = norbits // totaljobs
197-
print (f"Each job can do {timeframesperjob} maximally at a prod split of {totaljobs}")
198-
print (f"With each job doing {ntf} timeframes, this corresponds to a filling rate of ", ntf/timeframesperjob)
199-
maxcycles = timeframesperjob // ntf
197+
print (f"Each job can do {maxtimeframesperjob} maximally at a prod split of {totaljobs}")
198+
print (f"With each job doing {ntf} timeframes, this corresponds to a filling rate of ", ntf/maxtimeframesperjob)
199+
# filling rate should be smaller than 100%
200+
assert(ntf <= maxtimeframesperjob)
201+
202+
maxcycles = maxtimeframesperjob // ntf
200203
print (f"We can do this amount of cycle iterations to achieve 100%: ", maxcycles)
201204

202205
return sor, int(thisjobID * maxcycles) + cycle
@@ -213,6 +216,9 @@ def main():
213216
parser.add_argument('forward', nargs=argparse.REMAINDER) # forward args passed to actual workflow creation
214217
args = parser.parse_args()
215218

219+
# split id should not be larger than production id
220+
assert(args.split_id < args.prod_split)
221+
216222
# make a CCDB accessor object
217223
ccdbreader = CCDBAccessor(args.ccdb_url)
218224
# fetch the EOR/SOR

MC/run/ANCHOR/2021/OCT/pass4/anchorMC.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ echo "baseargs: ${baseargs}"
102102
echo "remainingargs: ${remainingargs}"
103103

104104
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow_anchored.py ${baseargs} -- ${remainingargs} &> timestampsampling.log
105+
[ "$?" != "0" ] && echo "Problem during anchor timestamp sampling " && exit 1
105106

106107
TIMESTAMP=`grep "Determined timestamp to be" timestampsampling.log | awk '//{print $6}'`
107108
echo "TIMESTAMP IS ${TIMESTAMP}"

0 commit comments

Comments
 (0)