Skip to content
Snippets Groups Projects
Commit b93af429 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

disabled debug logging for now, will re-enable after having established that...

disabled debug logging for now, will re-enable after having established that running many jobs works
parent 8ab2f69f
No related branches found
No related tags found
1 merge request!15Updated DVMP benchmark
...@@ -61,12 +61,13 @@ momenta_from_tracking(const std::vector<eic::TrackParametersData>& tracks, ...@@ -61,12 +61,13 @@ momenta_from_tracking(const std::vector<eic::TrackParametersData>& tracks,
[mass](const auto& track) { [mass](const auto& track) {
// make sure we don't divide by zero // make sure we don't divide by zero
if (fabs(track.qOverP) < 1e-9) { if (fabs(track.qOverP) < 1e-9) {
return ROOT::Math::PtEtaPhiMVector{}; return ROOT::Math::PxPyPzMVector{};
} }
const double pt = 1. / track.qOverP * sin(track.theta); const double p = fabs(1. / track.qOverP);
const double eta = -log(tan(track.theta / 2)); const double px = p * cos(track.phi) * sin(track.theta);
const double phi = track.phi; const double py = p * sin(track.phi) * sin(track.theta);
return ROOT::Math::PtEtaPhiMVector{pt, eta, phi, mass}; const double pz = p * cos(track.theta);
return ROOT::Math::PxPyPzMVector{px, py, pz, mass};
}); });
return momenta; return momenta;
} }
......
...@@ -15,14 +15,23 @@ dvmp:generate: ...@@ -15,14 +15,23 @@ dvmp:generate:
paths: paths:
- input - input
script: script:
- ./util/run_many.py ./dvmp/gen.sh --energy 10x100 --config jpsi_central --decay muon --decay electron - ./util/run_many.py ./dvmp/gen.sh
-c jpsi_barrel
-e 5x41 -e 10x100 -e 18x275
--decay muon --decay electron
--nproc 5
dvmp:process: dvmp:process:
stage: process stage: process
needs: ["detector", "dvmp:generate"] needs: ["detector", "dvmp:generate"]
timeout: 1 hour timeout: 1 hour
script: script:
- ./util/run_many.py dvmp/dvmp.sh --energy 10x100 --config jpsi_central --decay muon --decay electron --leading jpsi - ./util/run_many.py ./dvmp/dvmp.sh
-c jpsi_barrel
-e 5x41 -e 10x100 -e 18x275
--decay muon --decay electron
--leading jpsi
--nproc 5
artifacts: artifacts:
paths: paths:
- results - results
......
...@@ -51,9 +51,14 @@ source dvmp/env.sh ...@@ -51,9 +51,14 @@ source dvmp/env.sh
## Get a unique file names based on the configuration options ## Get a unique file names based on the configuration options
GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${DECAY}.hepmc GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${DECAY}.hepmc
SIM_FILE=${TMP_PATH}/sim-${CONFIG}_${DECAY}.root SIM_FILE=${TMP_PATH}/sim-${CONFIG}_${DECAY}.root
SIM_LOG=${TMP_PATH}/sim-${CONFIG}_${DECAY}.log
REC_FILE=${TMP_PATH}/rec-${CONFIG}_${DECAY}.root REC_FILE=${TMP_PATH}/rec-${CONFIG}_${DECAY}.root
PLOT_PREFIX=${CONFIG}_${DECAY} REC_LOG=${TMP_PATH}/sim-${CONFIG}_${DECAY}.log
PLOT_TAG=${CONFIG}_${DECAY}
## ============================================================================= ## =============================================================================
## Step 2: Run the simulation ## Step 2: Run the simulation
...@@ -64,7 +69,8 @@ npsim --runType batch \ ...@@ -64,7 +69,8 @@ npsim --runType batch \
--numberOfEvents ${JUGGLER_N_EVENTS} \ --numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
--inputFiles ${GEN_FILE} \ --inputFiles ${GEN_FILE} \
--outputFile ${SIM_FILE} --outputFile ${SIM_FILE} \
2>&1 > ${SIM_LOG}
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
echo "ERROR running npsim" echo "ERROR running npsim"
exit 1 exit 1
...@@ -85,10 +91,19 @@ export JUGGLER_SIM_FILE=${SIM_FILE} ...@@ -85,10 +91,19 @@ export JUGGLER_SIM_FILE=${SIM_FILE}
export JUGGLER_REC_FILE=${REC_FILE} export JUGGLER_REC_FILE=${REC_FILE}
export JUGGLER_DETECTOR_PATH=${DETECTOR_PATH} export JUGGLER_DETECTOR_PATH=${DETECTOR_PATH}
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \ xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
gaudirun.py options/tracker_reconstruction.py gaudirun.py options/tracker_reconstruction.py \
2>&1 > ${REC_LOG}
## on-error, first retry running juggler again as there is still a random
## crash we need to address FIXME
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler" echo "Juggler crashed, retrying..."
exit 1 xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
gaudirun.py options/tracker_reconstruction.py \
2>&1 > ${REC_LOG}
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler, both attempts failed"
exit 1
fi
fi fi
ls -l ls -l
...@@ -99,8 +114,7 @@ root -b -q "dvmp/analysis/vm_mass.cxx(\ ...@@ -99,8 +114,7 @@ root -b -q "dvmp/analysis/vm_mass.cxx(\
\"${LEADING}\", \ \"${LEADING}\", \
\"${DECAY}\", \ \"${DECAY}\", \
\"${JUGGLER_DETECTOR}\", \ \"${JUGGLER_DETECTOR}\", \
\"${RESULTS_PATH}/${PLOT_PREFIX}\")" \"${RESULTS_PATH}/${PLOT_TAG}\")"
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
echo "ERROR running root script" echo "ERROR running root script"
...@@ -117,6 +131,9 @@ if [ "${JUGGLER_N_EVENTS}" -lt "500" ] ; then ...@@ -117,6 +131,9 @@ if [ "${JUGGLER_N_EVENTS}" -lt "500" ] ; then
cp ${REC_FILE} ${RESULTS_PATH} cp ${REC_FILE} ${RESULTS_PATH}
fi fi
## Always move over log files to the results path
mv ${SIM_LOG} ${REC_LOG} ${RESULTS_PATH}
## cleanup output files ## cleanup output files
rm -f ${REC_FILE} ${SIM_FILE} rm -f ${REC_FILE} ${SIM_FILE}
......
...@@ -29,7 +29,7 @@ echo "INPUT_PATH: ${INPUT_PATH}" ...@@ -29,7 +29,7 @@ echo "INPUT_PATH: ${INPUT_PATH}"
## Data path for temporary data (not exported as artifacts) ## Data path for temporary data (not exported as artifacts)
TMP_PATH=${LOCAL_PREFIX} TMP_PATH=${LOCAL_PREFIX}/tmp/${EBEAM}on${PBEAM}
mkdir -p ${TMP_PATH} mkdir -p ${TMP_PATH}
export TMP_PATH=`realpath ${TMP_PATH}` export TMP_PATH=`realpath ${TMP_PATH}`
echo "TMP_PATH: ${TMP_PATH}" echo "TMP_PATH: ${TMP_PATH}"
......
...@@ -46,16 +46,16 @@ source config/env.sh ...@@ -46,16 +46,16 @@ source config/env.sh
source dvmp/env.sh source dvmp/env.sh
## Get a unique file name prefix based on the configuration options ## Get a unique file name prefix based on the configuration options
GEN_PREFIX=gen-${CONFIG}_${DECAY} GEN_TAG=gen-${CONFIG}_${DECAY} ## Generic file prefix
## ============================================================================= ## =============================================================================
## Step 2: Check if we really need to run, or can use the cache. ## Step 2: Check if we really need to run, or can use the cache.
if [ -f "${INPUT_PATH}/${GEN_PREFIX}.hepmc" ]; then if [ -f "${INPUT_PATH}/${GEN_TAG}.hepmc" ]; then
echo "Found cached generator output for $GEN_PREFIX, no need to rerun" echo "Found cached generator output for $GEN_TAG, no need to rerun"
exit 0 exit 0
fi fi
echo "Generator output for $GEN_PREFIX not found in cache, need to run generator" echo "Generator output for $GEN_TAG not found in cache, need to run generator"
## ============================================================================= ## =============================================================================
## Step 3: Create generator configuration file ## Step 3: Create generator configuration file
...@@ -73,22 +73,22 @@ fi ...@@ -73,22 +73,22 @@ fi
## generate the config file for this generator setup ## generate the config file for this generator setup
CONFIG_IN="${BENCHMARK_TAG}/generator/${CONFIG}.json.in" CONFIG_IN="${BENCHMARK_TAG}/generator/${CONFIG}.json.in"
echo "Creating generator configuration file ${GEN_PREFIX}.json" echo "Creating generator configuration file ${GEN_TAG}.json"
if [ ! -f ${CONFIG_IN} ]; then if [ ! -f ${CONFIG_IN} ]; then
echo "ERROR: cannot find master config file ${CONFIG_IN}" echo "ERROR: cannot find master config file ${CONFIG_IN}"
exit 1 exit 1
fi fi
sed "s/@TAG@/${GEN_PREFIX}/" $CONFIG_IN | \ sed "s/@TAG@/${GEN_TAG}/" $CONFIG_IN | \
sed "s/@EBEAM@/${EBEAM}/" | \ sed "s/@EBEAM@/${EBEAM}/" | \
sed "s/@PBEAM@/${PBEAM}/" | \ sed "s/@PBEAM@/${PBEAM}/" | \
sed "s/@DECAY_LEPTON@/${DECAY_PID}/" | \ sed "s/@DECAY_LEPTON@/${DECAY_PID}/" | \
sed "s/@BRANCHING@/${BRANCHING}/" > ${TMP_PATH}/${GEN_PREFIX}.json sed "s/@BRANCHING@/${BRANCHING}/" > ${TMP_PATH}/${GEN_TAG}.json
## ============================================================================= ## =============================================================================
## Step 4: Run the event generator ## Step 4: Run the event generator
echo "Running the generator" echo "Running the generator"
lager -r ${JUGGLER_RNG_SEED} \ lager -r ${JUGGLER_RNG_SEED} \
-c ${TMP_PATH}/${GEN_PREFIX}.json \ -c ${TMP_PATH}/${GEN_TAG}.json \
-e ${JUGGLER_N_EVENTS} \ -e ${JUGGLER_N_EVENTS} \
-o ${TMP_PATH} -o ${TMP_PATH}
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
...@@ -100,10 +100,10 @@ fi ...@@ -100,10 +100,10 @@ fi
## Step 5: Finally, move relevant output into the artifacts directory and clean up ## Step 5: Finally, move relevant output into the artifacts directory and clean up
echo "Moving generator output into ${INPUT_PATH}" echo "Moving generator output into ${INPUT_PATH}"
for ext in hepmc json log root ; do for ext in hepmc json log root ; do
mv ${TMP_PATH}/*.${GEN_PREFIX}.*.${ext} ${INPUT_PATH}/${GEN_PREFIX}.${ext} mv ${TMP_PATH}/*.${GEN_TAG}.*.${ext} ${INPUT_PATH}/${GEN_TAG}.${ext}
done done
## this step only matters for local execution ## this step only matters for local execution
echo "Cleaning up" echo "Cleaning up"
rm ${TMP_PATH}/${GEN_PREFIX}.json rm ${TMP_PATH}/${GEN_TAG}.json
## All done! ## All done!
{
"mc" : {
"type" : "eic",
"tag" : "@TAG@",
"events" : "10000",
"output_hepmc": true,
"generator" : {
"type" : "ep-2gluon",
"vertex" : {"type" : "origin"},
"beam": {
"lepton" : {
"type" : "constant",
"particle_type" : "e-",
"dir" : [ "0", "0", "-1" ],
"energy" : "@EBEAM@"
},
"ion" : {
"type" : "constant",
"particle_type" : "proton",
"dir" : [ "0", "0", "1" ],
"energy" : "@PBEAM@"
}
},
"target": {"type": "primary"},
"photon" : {
"type" : "vphoton",
"y_range" : [ "0.01", "1" ],
"Q2_range": [ "1.0", "1000"]
},
"process_0" : {
"type" : "brodsky_2vmX",
"vm_type" : "J/psi",
"recoil_type" : "proton",
"photo_b" : "4.50",
"photo_c2g" : "6.0e4",
"photo_c3g" : "0.0",
"R_vm_c" : "2.164",
"R_vm_n" : "2.131",
"dipole_n" : "2.575",
"note": "b from the H1 paper, c2g adjusted to fit HERA points"
}
},
"detector" : {
"type" : "composite",
"components" : {
"barrel" : {
"id" : "1",
"name" : "barrel",
"type" : "cone",
"acceptance" : {
"acceptance" : "1.0",
"p" : [ "1", "1000" ],
"theta" : [ "45", "135" ],
"pid" : [ "e+", "e-", "mu+", "mu-" ]
},
"smearing" : {"p" : "0.0", "theta" : "0.0", "phi" : "0.0"}
}
}
},
"reconstruction" : {"require_leading" : "true"},
"decay" : {
"vm_decay_lepton_type" : "@DECAY_LEPTON@",
"vm_branching_ratio" : "@BRANCHING@",
"do_radiative_decay_vm" : "true"
}
}
}
File moved
File moved
...@@ -19,13 +19,13 @@ parser.add_argument( ...@@ -19,13 +19,13 @@ parser.add_argument(
'command', 'command',
help="Script to be launched in parallel") help="Script to be launched in parallel")
parser.add_argument( parser.add_argument(
'--energy', '--energy', '-e',
dest='energies', dest='energies',
action='append', action='append',
help='One or more beam energy pairs (e.g. 10x100)', help='One or more beam energy pairs (e.g. 10x100)',
required=True) required=True)
parser.add_argument( parser.add_argument(
'--config', '--config', '-c',
dest='configs', dest='configs',
action='append', action='append',
help='One or more configurations', help='One or more configurations',
...@@ -55,7 +55,7 @@ def worker(command): ...@@ -55,7 +55,7 @@ def worker(command):
## use a temporary file to capture the terminal output, and then ## use a temporary file to capture the terminal output, and then
## print the terminal output once the command finishes ## print the terminal output once the command finishes
with NamedTemporaryFile() as f: with NamedTemporaryFile() as f:
cmd = [command, '2>1 >', f.name] cmd = [command, ' 2>&1 >', f.name]
cmd = ' '.join(cmd) cmd = ' '.join(cmd)
print("Executing '{}'".format(cmd)) print("Executing '{}'".format(cmd))
os.system(cmd) os.system(cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment