Skip to content

Commit a253420

Browse files
sawenzelclaude
andcommitted
Let learned resource estimates replace dynamic sampling in anchorMC
This adds an ALIEN_O2DPG_RESOURCES hook to anchorMC.sh so a production can run with the resource estimates a pilot job measured. - anchorMC.sh passed --dynamic-resources unconditionally, so learned estimates could only be added on top of runtime sampling, never instead of it. - When ALIEN_O2DPG_RESOURCES names a file, --update-resources is passed and --dynamic-resources is not; without it the invocation is unchanged. - The file is the json-stat output of MC/utils/o2dpg_sim_metrics.py. - ALIEN_O2DPG_FILEGRAPH is added to the usage text, which did not mention it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent ca79d62 commit a253420

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

MC/run/ANCHOR/anchorMC.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ print_help()
5959
echo "ALIEN_JDL_RUN_TIME_SPAN_FILE=FILE, use a run-time-span file to exclude bad data-taking periods"
6060
echo "ALIEN_JDL_INVERT_IRFRAME_SELECTION, invertes the choice of ALIEN_JDL_RUN_TIME_SPAN_FILE"
6161
echo "ALIEN_JDL_CCDB_CONDITION_NOT_AFTER, sets the condition_not_after timestamp for CCDB queries"
62+
echo "ALIEN_O2DPG_FILEGRAPH=FILE, delete intermediate files early, using a FileIOGraph report"
63+
echo "ALIEN_O2DPG_RESOURCES=FILE, use resource estimates learned by a pilot run instead of sampling them"
6264
echo "DISABLE_QC, set this to disable QC, e.g. to 1"
6365
echo "CYCLE, to set a cycle number different than 0"
6466
echo "NSIGEVENTS, to enforce a specific upper limit of events in a timeframe (not counting orbit-early) events"
@@ -430,8 +432,15 @@ else
430432
fi
431433
echo_info "Workflow will run with target specification ${targetString}"
432434

435+
# resource estimates learned by a pilot run (o2dpg_sim_metrics.py json-stat)
436+
# replace the runtime sampling; without them we sample dynamically as before
437+
RESOURCE_ARGS="--dynamic-resources"
438+
if [ -n "${ALIEN_O2DPG_RESOURCES}" ]; then
439+
RESOURCE_ARGS="--update-resources ${ALIEN_O2DPG_RESOURCES}"
440+
fi
441+
433442
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt ${targetString} \
434-
--cpu-limit ${ALIEN_JDL_CPULIMIT:-8} --dynamic-resources \
443+
--cpu-limit ${ALIEN_JDL_CPULIMIT:-8} ${RESOURCE_ARGS} \
435444
${ALIEN_O2DPG_FILEGRAPH:+--remove-files-early ${ALIEN_O2DPG_FILEGRAPH}} \
436445
${ALIEN_O2DPG_ADDITIONAL_WORKFLOW_RUNNER_ARGS}
437446

0 commit comments

Comments
 (0)