Skip to content

Commit 50fe338

Browse files
authored
Merge 9fed6b0 into sapling-pr-archive-ehellbar
2 parents ebd2ff1 + 9fed6b0 commit 50fe338

37 files changed

Lines changed: 1382 additions & 115 deletions

File tree

DATA/production/configurations/asyncReco/setenv_extra.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,9 @@ fi
565565
# ad-hoc options for GPU reco workflow
566566
export CONFIG_EXTRA_PROCESS_o2_gpu_reco_workflow+=";GPU_global.dEdxDisableResidualGainMap=1;$TRACKTUNETPC;$VDRIFTPARAMOPTION;"
567567

568+
# if ITS is running on GPU we need to give the workflow most options from ITS reco
569+
has_detector_gpu ITS && export CONFIG_EXTRA_PROCESS_o2_gpu_reco_workflow+=";$CONFIG_EXTRA_PROCESS_o2_its_reco_workflow;"
570+
568571
[[ ! -z $TPCCLUSTERTIMESHIFT ]] && [[ $ALIEN_JDL_LPMPRODUCTIONTYPE != "MC" ]] && export CONFIG_EXTRA_PROCESS_o2_gpu_reco_workflow+=";GPU_rec_tpc.clustersShiftTimebins=$TPCCLUSTERTIMESHIFT;"
569572

570573
# ad-hoc settings for TOF reco

DATA/tools/parse

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ for line in f:
143143
command_preopt += ' EPN_NODE_MI100=1 EPN_GLOBAL_SCALING="3/2"'
144144
if os.getenv('DISABLE_MI100_SERIALIZATION', '0') == '1':
145145
command_preopt += ' DISABLE_MI100_SERIALIZATION=1'
146+
if os.getenv('FULL_MI100_SERIALIZATION', '0') == '1':
147+
command_preopt += ' FULL_MI100_SERIALIZATION=1'
146148
if reco_num_nodes_override == 0:
147149
command_preopt += ' RECO_NUM_NODES_WORKFLOW=' + wf[1]
148150
if is_calib_workflow:

GRID/utils/runGRIDContainerized.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ else
1515
echo "Invalid architecture ${ARCH} detected. Exiting"
1616
exit 1
1717
fi
18-
if [ "$ARCH" == "aarch64" ]; then
19-
ISAARCH64="1"
20-
fi
2118
# we just use the default singularity container (if not already set)
22-
APPTAINER_CONTAINER=${APPTAINER_CONTAINER:-/cvmfs/alice.cern.ch/containers/fs/singularity/default${ISAARCH64+"-aarch64"}}
19+
APPTAINER_CONTAINER=${APPTAINER_CONTAINER:-/cvmfs/alice.cern.ch/containers/fs/apptainer/compat_el9-${ARCH}}
2320

2421
# create workdir if not specified externally
2522
if [ ! "${WORK_DIR}" ]; then
@@ -47,7 +44,21 @@ cp ${ALIEN_KEYFILE} ${WORK_DIR}/userkey.pem
4744

4845
echo "JALIEN_TOKEN_CERT=/workdir/usercert.pem" > ${WORK_DIR}/envfile
4946
echo "JALIEN_TOKEN_KEY=/workdir/userkey.pem" >> ${WORK_DIR}/envfile
47+
if [ "${GRID_CVMFS_PACKAGE}" ]; then
48+
echo "GRID_CVMFS_PACKAGE=${GRID_CVMFS_PACKAGE}" >> ${WORK_DIR}/envfile
49+
fi
50+
51+
# load a CVMFS package if we are asked to do so -- but do it as part of the job
52+
LOADER='if [ "${GRID_CVMFS_PACKAGE}" ]; then
53+
/cvmfs/alice.cern.ch/bin/alienv printenv ${GRID_CVMFS_PACKAGE} > cvmfs_env
54+
source cvmfs_env
55+
fi'
56+
# Inject the block after the first line (shebang)
57+
JOBSCRIPT=${WORK_DIR}/job.sh
58+
awk -v block="$LOADER" 'NR==1 {print; print block; next} 1' "$JOBSCRIPT" > tmpfile && mv tmpfile "$JOBSCRIPT"
59+
chmod +x "${JOBSCRIPT}"
5060

5161
# launch job = script inside the container in the workdir
52-
/cvmfs/alice.cern.ch/containers/bin/apptainer/current${ISAARCH64+"-aarch64"}/bin/apptainer exec -C -B /cvmfs:/cvmfs,${WORK_DIR}:/workdir \
53-
--pwd /workdir --env-file ${WORK_DIR}/envfile ${APPTAINER_CONTAINER} /workdir/job.sh
62+
APPTAINER_EXEC=${APPTAINER_EXEC:-"/cvmfs/alice.cern.ch/containers/bin/apptainer/${ARCH}/current/bin/apptainer"}
63+
${APPTAINER_SUDO:+sudo} ${APPTAINER_EXEC} exec -C -B /cvmfs:/cvmfs,${WORK_DIR}:/workdir \
64+
--pwd /workdir --env-file ${WORK_DIR}/envfile ${APPTAINER_CONTAINER} bash /workdir/job.sh

MC/bin/o2_dpg_workflow_runner.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def setup_logger(name, log_file, level=logging.INFO):
8585
return logger
8686

8787
# first file logger
88-
actionlogger = setup_logger('pipeline_action_logger', ('pipeline_action_' + str(os.getpid()) + '.log', args.action_logfile)[args.action_logfile!=None], level=logging.DEBUG)
88+
actionlogger_file = ('pipeline_action_' + str(os.getpid()) + '.log', args.action_logfile)[args.action_logfile!=None]
89+
actionlogger = setup_logger('pipeline_action_logger', actionlogger_file, level=logging.DEBUG)
8990

9091
# second file logger
9192
metriclogger = setup_logger('pipeline_metric_logger', ('pipeline_metric_' + str(os.getpid()) + '.log', args.action_logfile)[args.action_logfile!=None])
@@ -1808,5 +1809,46 @@ def speedup_ROOT_Init():
18081809
exit(code)
18091810
actionlogger.info("Running in cgroup")
18101811

1811-
executor=WorkflowExecutor(args.workflowfile,jmax=int(args.maxjobs),args=args)
1812-
exit (executor.execute())
1812+
1813+
# This starts the fanotify fileaccess monitoring process
1814+
# if asked for
1815+
o2dpg_filegraph_exec = os.getenv("O2DPG_PRODUCE_FILEGRAPH") # switches filegraph monitoring on and contains the executable name
1816+
if o2dpg_filegraph_exec:
1817+
env = os.environ.copy()
1818+
env["FILEACCESS_MON_ROOTPATH"] = os.getcwd()
1819+
env["MAXMOTHERPID"] = f"{os.getpid()}"
1820+
1821+
fileaccess_log_file_name = f"pipeline_fileaccess_{os.getpid()}.log"
1822+
fileaccess_log_file = open(fileaccess_log_file_name, "w")
1823+
fileaccess_monitor_proc = subprocess.Popen(
1824+
[o2dpg_filegraph_exec],
1825+
stdout=fileaccess_log_file,
1826+
stderr=subprocess.STDOUT,
1827+
env=env)
1828+
else:
1829+
fileaccess_monitor_proc = None
1830+
1831+
try:
1832+
# This is core workflow runner invocation
1833+
executor=WorkflowExecutor(args.workflowfile,jmax=int(args.maxjobs),args=args)
1834+
rc = executor.execute()
1835+
finally:
1836+
if fileaccess_monitor_proc:
1837+
fileaccess_monitor_proc.terminate() # sends SIGTERM
1838+
try:
1839+
fileaccess_monitor_proc.wait(timeout=5)
1840+
except subprocess.TimeoutExpired:
1841+
fileaccess_monitor_proc.kill() # force kill if not stopping
1842+
# now produce the final filegraph output
1843+
o2dpg_root = os.getenv("O2DPG_ROOT")
1844+
analyse_cmd = [
1845+
sys.executable, # runs with same Python interpreter
1846+
f"{o2dpg_root}/UTILS/FileIOGraph/analyse_FileIO.py",
1847+
"--actionFile", actionlogger_file,
1848+
"--monitorFile", fileaccess_log_file_name,
1849+
"-o", f"pipeline_fileaccess_report_{os.getpid()}.json",
1850+
"--basedir", os.getcwd() ]
1851+
print (f"Producing FileIOGraph with command {analyse_cmd}")
1852+
subprocess.run(analyse_cmd, check=True)
1853+
1854+
sys.exit(rc)

MC/bin/o2dpg_sim_workflow.py

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,18 @@ def load_external_config(configfile):
276276
for det in activeDetectors:
277277
activate_detector(det)
278278

279+
# function to finalize detector source lists based on activeDetectors
280+
# detector source lists are comma separated lists of DET1, DET2, DET1-DET2, ...
281+
def cleanDetectorInputList(inputlist):
282+
sources_list = inputlist.split(",")
283+
# Filter the sources
284+
filtered_sources = [
285+
src for src in sources_list
286+
if all(isActive(part) for part in src.split("-"))
287+
]
288+
# Recompose into a comma-separated string
289+
return ",".join(filtered_sources)
290+
279291
if not args.with_ZDC:
280292
# deactivate to be able to use isActive consistently for ZDC
281293
deactivate_detector('ZDC')
@@ -1071,6 +1083,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
10711083
t['cmd'] = ('','ln -nfs ../bkg_Hits*.root . ;')[doembedding]
10721084
detlist = ''
10731085
detlist = ','.join(smallsensorlist)
1086+
detlist = cleanDetectorInputList(detlist)
10741087
t['cmd'] += commondigicmd + ' --onlyDet ' + detlist
10751088
t['cmd'] += ' --ccdb-tof-sa --forceSelectedDets '
10761089
t['cmd'] += (' --combine-devices ','')[args.no_combine_dpl_devices]
@@ -1292,7 +1305,7 @@ def getDigiTaskName(det):
12921305
#<--------- TRD global tracking
12931306
# FIXME This is so far a workaround to avoud a race condition for trdcalibratedtracklets.root
12941307
TRDTRACKINGtask2 = createTask(name='trdreco2_'+str(tf), needs=[TRDTRACKINGtask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1', mem='2000')
1295-
trd_track_sources = dpl_option_from_config(anchorConfig, 'o2-trd-global-tracking', 'track-sources', default_value='TPC,ITS-TPC')
1308+
trd_track_sources = cleanDetectorInputList(dpl_option_from_config(anchorConfig, 'o2-trd-global-tracking', 'track-sources', default_value='TPC,ITS-TPC'))
12961309
TRDTRACKINGtask2['cmd'] = task_finalizer([
12971310
'${O2_ROOT}/bin/o2-trd-global-tracking',
12981311
getDPL_global_options(bigshm=True),
@@ -1445,7 +1458,8 @@ def getDigiTaskName(det):
14451458
getDPL_global_options(),
14461459
putConfigValues(),
14471460
('',' --disable-mc')[args.no_mc_labels]])
1448-
workflow['stages'].append(PHSRECOtask)
1461+
if isActive("PHS"):
1462+
workflow['stages'].append(PHSRECOtask)
14491463

14501464
#<--------- CPV reco workflow
14511465
CPVRECOtask = createTask(name='cpvreco_'+str(tf), needs=[getDigiTaskName("CPV")], tf=tf, cwd=timeframeworkdir, lab=["RECO"], mem='1500')
@@ -1454,7 +1468,8 @@ def getDigiTaskName(det):
14541468
getDPL_global_options(),
14551469
putConfigValues(),
14561470
('',' --disable-mc')[args.no_mc_labels]])
1457-
workflow['stages'].append(CPVRECOtask)
1471+
if isActive("CPV"):
1472+
workflow['stages'].append(CPVRECOtask)
14581473

14591474
#<--------- ZDC reco workflow
14601475
ZDCRECOtask = createTask(name='zdcreco_'+str(tf), needs=[getDigiTaskName("ZDC")], tf=tf, cwd=timeframeworkdir, lab=["RECO", "ZDC"])
@@ -1463,7 +1478,8 @@ def getDigiTaskName(det):
14631478
getDPL_global_options(),
14641479
putConfigValues(),
14651480
('',' --disable-mc')[args.no_mc_labels]])
1466-
workflow['stages'].append(ZDCRECOtask)
1481+
if isActive("ZDC"):
1482+
workflow['stages'].append(ZDCRECOtask)
14671483

14681484
## forward matching
14691485
#<--------- MCH-MID forward matching
@@ -1509,7 +1525,7 @@ def getDigiTaskName(det):
15091525

15101526
#<--------- HMP forward matching
15111527
hmpmatchneeds = [HMPRECOtask['name'], ITSTPCMATCHtask['name'], TOFTPCMATCHERtask['name'], TRDTRACKINGtask2['name']]
1512-
hmp_match_sources = dpl_option_from_config(anchorConfig, 'o2-hmpid-matcher-workflow', 'track-sources', default_value='ITS-TPC,ITS-TPC-TRD,TPC-TRD')
1528+
hmp_match_sources = cleanDetectorInputList(dpl_option_from_config(anchorConfig, 'o2-hmpid-matcher-workflow', 'track-sources', default_value='ITS-TPC,ITS-TPC-TRD,TPC-TRD'))
15131529
HMPMATCHtask = createTask(name='hmpmatch_'+str(tf), needs=hmpmatchneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], mem='1000')
15141530
HMPMATCHtask['cmd'] = task_finalizer(
15151531
['${O2_ROOT}/bin/o2-hmpid-matcher-workflow',
@@ -1524,24 +1540,29 @@ def getDigiTaskName(det):
15241540
'o2-primary-vertexing-workflow',
15251541
'vertexing-sources',
15261542
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP')
1543+
pvfinder_sources = cleanDetectorInputList(pvfinder_sources)
1544+
15271545
pvfinder_matching_sources = dpl_option_from_config(anchorConfig,
15281546
'o2-primary-vertexing-workflow',
15291547
'vertex-track-matching-sources',
15301548
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP')
1531-
pvfinderneeds = [TRDTRACKINGtask2['name'],
1532-
FT0RECOtask['name'],
1533-
FV0RECOtask['name'],
1534-
EMCRECOtask['name'],
1535-
PHSRECOtask['name'],
1536-
CPVRECOtask['name'],
1537-
FDDRECOtask['name'],
1538-
ZDCRECOtask['name'],
1539-
HMPMATCHtask['name'],
1540-
HMPMATCHtask['name'],
1541-
ITSTPCMATCHtask['name'],
1542-
TOFTPCMATCHERtask['name'],
1543-
MFTMCHMATCHtask['name'],
1549+
pvfinder_matching_sources = cleanDetectorInputList(pvfinder_matching_sources)
1550+
1551+
pvfinderneeds = [TRDTRACKINGtask2['name'],
1552+
FT0RECOtask['name'],
1553+
FV0RECOtask['name'],
1554+
EMCRECOtask['name'],
1555+
PHSRECOtask['name'] if isActive("PHS") else None,
1556+
CPVRECOtask['name'] if isActive("CPV") else None,
1557+
FDDRECOtask['name'],
1558+
ZDCRECOtask['name'] if isActive("ZDC") else None,
1559+
HMPMATCHtask['name'],
1560+
HMPMATCHtask['name'],
1561+
ITSTPCMATCHtask['name'],
1562+
TOFTPCMATCHERtask['name'],
1563+
MFTMCHMATCHtask['name'],
15441564
MCHMIDMATCHtask['name']]
1565+
pvfinderneeds = [ p for p in pvfinderneeds if p != None ]
15451566

15461567
PVFINDERtask = createTask(name='pvfinder_'+str(tf), needs=pvfinderneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS_TF, mem='4000')
15471568
PVFINDERtask['cmd'] = task_finalizer(
@@ -1572,6 +1593,7 @@ def getDigiTaskName(det):
15721593
'o2-primary-vertexing-workflow',
15731594
'vertex-track-matching-sources',
15741595
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,ZDC,FDD,HMP,FV0,TRD,MCH,CTP')
1596+
svfinder_sources = cleanDetectorInputList(svfinder_sources)
15751597
SVFINDERtask = createTask(name='svfinder_'+str(tf), needs=[PVFINDERtask['name'], FT0FV0EMCCTPDIGItask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=svfinder_cpu, mem='5000')
15761598
SVFINDERtask['cmd'] = task_finalizer(
15771599
[ '${O2_ROOT}/bin/o2-secondary-vertexing-workflow',
@@ -1591,6 +1613,7 @@ def getDigiTaskName(det):
15911613
# TODO This needs further refinement, sources and dependencies should be constructed dynamically
15921614
aod_info_souces_default = 'ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,ZDC,FDD,HMP,FV0,TRD,MCH,CTP'
15931615
aodinfosources = dpl_option_from_config(anchorConfig, 'o2-aod-producer-workflow', 'info-sources', default_value=aod_info_souces_default)
1616+
aodinfosources = cleanDetectorInputList(aodinfosources)
15941617
aodneeds = [PVFINDERtask['name'], SVFINDERtask['name']]
15951618

15961619
if usebkgcache:
@@ -1644,20 +1667,20 @@ def getDigiTaskName(det):
16441667
print ("Adding TPC residuals extraction and aggregation")
16451668

16461669
#<------------- TPC residuals extraction
1647-
scdcalib_vertex_sources = dpl_option_from_config(anchorConfig,
1670+
scdcalib_vertex_sources = cleanDetectorInputList(dpl_option_from_config(anchorConfig,
16481671
'o2-tpc-scdcalib-interpolation-workflow',
16491672
'vtx-sources',
1650-
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP')
1673+
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP'))
16511674

1652-
scdcalib_track_sources = dpl_option_from_config(anchorConfig,
1675+
scdcalib_track_sources = cleanDetectorInputList(dpl_option_from_config(anchorConfig,
16531676
'o2-tpc-scdcalib-interpolation-workflow',
16541677
'tracking-sources',
1655-
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP')
1678+
default_value='ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,FDD,HMP,FV0,TRD,MCH,CTP'))
16561679

1657-
scdcalib_track_extraction = dpl_option_from_config(anchorConfig,
1680+
scdcalib_track_extraction = cleanDetectorInputList(dpl_option_from_config(anchorConfig,
16581681
'o2-tpc-scdcalib-interpolation-workflow',
16591682
'tracking-sources-map-extraction',
1660-
default_value='ITS-TPC')
1683+
default_value='ITS-TPC'))
16611684

16621685
SCDCALIBtask = createTask(name='scdcalib_'+str(tf), needs=[PVFINDERtask['name']], tf=tf, cwd=timeframeworkdir, lab=["CALIB"], mem='4000')
16631686
SCDCALIBtask['cmd'] = task_finalizer(

MC/config/PWGDQ/external/generator/GeneratorCocktailPromptCharmoniaToMuonEvtGen_pp5TeV.C

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,17 @@ class O2_GeneratorParamPsi : public GeneratorTGenerator
133133
static Double_t YPsipp5TeV(const Double_t* py, const Double_t* /*dummy*/)
134134
{
135135
// psi2s y in pp at 5.02 TeV, tuned on https://www.hepdata.net/record/ins1935680
136+
// WARNING! The shape extracted from data provide wired rapidity shape (low stat.), the J/psi one is used
136137
Double_t y = *py;
137138
Float_t p0, p1, p2;
139+
// Extracted from Psi(2S) Run 2 data
140+
//p0 = 1;
141+
//p1 = -17.4857;
142+
//p2 = 2.98887;
143+
// Same parametrization as J/psi
138144
p0 = 1;
139-
p1 = -17.4857;
140-
p2 = 2.98887;
145+
p1 = 0.0338222;
146+
p2 = 2.96748;
141147
return p0 * TMath::Exp(-(1. / 2.) * TMath::Power(((y - p1) / p2), 2));
142148
}
143149

0 commit comments

Comments
 (0)