Skip to content

Commit 4e99fac

Browse files
committed
enable parallel world inanchored simulation
1 parent f26dfd2 commit 4e99fac

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

MC/bin/o2dpg_sim_workflow_anchored.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def main():
312312
parser.add_argument("-tf", type=int, help="number of timeframes per job", default=1)
313313
parser.add_argument("--ccdb-IRate", type=bool, help="whether to try fetching IRate from CCDB/CTP", default=True)
314314
parser.add_argument("--trig-eff", type=float, dest="trig_eff", help="Trigger eff needed for IR", default=-1.0)
315+
parser.add_argument("-enable-parallel-world", type=int, dest="enable_parallel_world", help="Enable parallel geometry", default=0)
315316
parser.add_argument('forward', nargs=argparse.REMAINDER) # forward args passed to actual workflow creation
316317
args = parser.parse_args()
317318
print (args)
@@ -398,8 +399,10 @@ def main():
398399
# we finally pass forward to the unanchored MC workflow creation
399400
# TODO: this needs to be done in a pythonic way clearly
400401
# NOTE: forwardargs can - in principle - contain some of the arguments that are appended here. However, the last passed argument wins, so they would be overwritten.
402+
pw_str = str(args.enable_parallel_world)
401403
forwardargs += " -tf " + str(args.tf) + " --sor " + str(run_start) + " --timestamp " + str(timestamp) + " --production-offset " + str(prod_offset) + " -run " + str(args.run_number) + " --run-anchored --first-orbit " \
402-
+ str(GLOparams["FirstOrbit"]) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + " -col " + str(ColSystem) + " -eCM " + str(eCM) + ' --readoutDets ' + GLOparams['detList']
404+
+ str(GLOparams["FirstOrbit"]) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + " -col " + str(ColSystem) + " -eCM " + str(eCM) + ' --readoutDets ' + GLOparams['detList'] \
405+
+ ' -confKey \"GeometryManagerParam.useParallelWorld=' + pw_str + ';GeometryManagerParam.usePwGeoBVH=' + pw_str + ';GeometryManagerParam.usePwCaching=' + pw_str + '\"'
403406
print ("forward args ", forwardargs)
404407
cmd = "${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py " + forwardargs
405408
print ("Creating time-anchored workflow...")

MC/run/ANCHOR/anchorMC.sh

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ MODULES="--skipModules ZDC"
210210
ALICEO2_CCDB_LOCALCACHE=${ALICEO2_CCDB_LOCALCACHE:-$(pwd)/ccdb}
211211

212212
# these arguments will be digested by o2dpg_sim_workflow_anchored.py
213-
baseargs="-tf ${NTIMEFRAMES} --split-id ${SPLITID} --prod-split ${PRODSPLIT} --cycle ${CYCLE} --run-number ${ALIEN_JDL_LPMRUNNUMBER}"
213+
baseargs="-enable-parallel-world ${ENABLE_PARALLEL_WORLD} -tf ${NTIMEFRAMES} --split-id ${SPLITID} --prod-split ${PRODSPLIT} --cycle ${CYCLE} --run-number ${ALIEN_JDL_LPMRUNNUMBER}"
214214

215215
# these arguments will be passed as well but only evetually be digested by o2dpg_sim_workflow.py which is called from o2dpg_sim_workflow_anchored.py
216216
remainingargs="-seed ${SEED} -ns ${NSIGEVENTS} --include-local-qc --pregenCollContext"
@@ -235,20 +235,28 @@ TIMESTAMP=`grep "Determined timestamp to be" timestampsampling_${ALIEN_JDL_LPMRU
235235
echo_info "TIMESTAMP IS ${TIMESTAMP}"
236236

237237
# -- Create aligned geometry using ITS ideal alignment to avoid overlaps in geant
238-
CCDBOBJECTS_IDEAL_MC="ITS/Calib/Align"
239-
TIMESTAMP_IDEAL_MC=1
240-
${O2_ROOT}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch/ -p ${CCDBOBJECTS_IDEAL_MC} -d ${ALICEO2_CCDB_LOCALCACHE} --timestamp ${TIMESTAMP_IDEAL_MC}
241-
CCDB_RC="${?}"
242-
if [ ! "${CCDB_RC}" == "0" ]; then
243-
echo_error "Problem during CCDB prefetching of ${CCDBOBJECTS_IDEAL_MC}. Exiting."
244-
exit ${CCDB_RC}
238+
if [ "${ENABLE_PARALLEL_WORLD}" == "0" ]; then
239+
CCDBOBJECTS_IDEAL_MC="ITS/Calib/Align"
240+
TIMESTAMP_IDEAL_MC=1
241+
${O2_ROOT}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch/ -p ${CCDBOBJECTS_IDEAL_MC} -d ${ALICEO2_CCDB_LOCALCACHE} --timestamp ${TIMESTAMP_IDEAL_MC}
242+
CCDB_RC="${?}"
243+
if [ ! "${CCDB_RC}" == "0" ]; then
244+
echo_error "Problem during CCDB prefetching of ${CCDBOBJECTS_IDEAL_MC}. Exiting."
245+
exit ${CCDB_RC}
246+
fi
245247
fi
246248

247249
# TODO This can potentially be removed or if needed, should be taken over by o2dpg_sim_workflow_anchored.py and O2_dpg_workflow_runner.py
248-
echo "run with echo in pipe" | ${O2_ROOT}/bin/o2-create-aligned-geometry-workflow --configKeyValues "HBFUtils.startTime=${TIMESTAMP}" --condition-remap=file://${ALICEO2_CCDB_LOCALCACHE}=ITS/Calib/Align -b --run
250+
if [ "${ENABLE_PARALLEL_WORLD}" == "0" ]; then
251+
echo "run with echo in pipe" | ${O2_ROOT}/bin/o2-create-aligned-geometry-workflow --configKeyValues "HBFUtils.startTime=${TIMESTAMP}" --condition-remap=file://${ALICEO2_CCDB_LOCALCACHE}=ITS/Calib/Align -b --run
252+
else
253+
echo "run with echo in pipe" | ${O2_ROOT}/bin/o2-create-aligned-geometry-workflow --configKeyValues "HBFUtils.startTime=${TIMESTAMP}" -b --run
254+
fi
249255
mkdir -p $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned
250256
ln -s -f $PWD/o2sim_geometry-aligned.root $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned/snapshot.root
251-
[[ -f $PWD/its_GeometryTGeo.root ]] && mkdir -p $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry && ln -s -f $PWD/its_GeometryTGeo.root $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry/snapshot.root
257+
if [ "${ENABLE_PARALLEL_WORLD}" == "0" ]; then
258+
[[ -f $PWD/its_GeometryTGeo.root ]] && mkdir -p $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry && ln -s -f $PWD/its_GeometryTGeo.root $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry/snapshot.root
259+
fi
252260
[[ -f $PWD/mft_GeometryTGeo.root ]] && mkdir -p $ALICEO2_CCDB_LOCALCACHE/MFT/Config/Geometry && ln -s -f $PWD/mft_GeometryTGeo.root $ALICEO2_CCDB_LOCALCACHE/MFT/Config/Geometry/snapshot.root
253261

254262
# -- RUN THE MC WORKLOAD TO PRODUCE AOD --

MC/run/ANCHOR/tests/test_anchor_2023_apass2_pp.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export SEED=5
3030
# for pp and 50 events per TF, we launch only 4 workers.
3131
export NWORKERS=2
3232

33+
export ENABLE_PARALLEL_WORLD=1
34+
3335
# run the central anchor steering script; this includes
3436
# * derive timestamp
3537
# * derive interaction rate

0 commit comments

Comments
 (0)