diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01da6a16228384f878c365efbf8a9de372791f34..e1a1d43619e8ec95475cbfd332fc3e42cc3cba12 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,9 +16,10 @@ stages: include: - local: 'dis/config.yml' - local: 'dvmp/config.yml' + - local: 'dvcs/config.yml' summary: stage: finish - needs: ["dis:results", "dvmp:results"] + needs: ["dis:results", "dvcs:results", "dvmp:results"] script: - echo "All benchmarks passed" diff --git a/dvcs/config.yml b/dvcs/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..9582ea62208316fd874bec5864122a4c4f6cc337 --- /dev/null +++ b/dvcs/config.yml @@ -0,0 +1,21 @@ +dvcs:process: + stage: process + timeout: 1 hour + script: + - bash dvcs/dvcs.sh + artifacts: + paths: + - results + +dvcs:analysis: + stage: analyze + needs: ["dvcs:process"] + script: + - echo "THIS IS A PLACE HOLDER" + + +dvcs:results: + stage: collect + needs: ["dvcs:analysis"] + script: + - echo "All DVCS benchmarks successful" diff --git a/dvcs/dvcs.sh b/dvcs/dvcs.sh new file mode 100644 index 0000000000000000000000000000000000000000..32c1816da56dc81c73a46f4abd28842b4dd07d64 --- /dev/null +++ b/dvcs/dvcs.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +if [[ ! -n "${JUGGLER_DETECTOR}" ]] ; then + export JUGGLER_DETECTOR="topside" +fi + +if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then + export JUGGLER_N_EVENTS=100 +fi + +# only used when running locally (not in CI) +if [[ ! -n "${JUGGLER_INSTALL_PREFIX}" ]] ; then + export JUGGLER_INSTALL_PREFIX="/usr/local" +fi + +# these variables might not need exported. +export JUGGLER_FILE_NAME_TAG="dvcs" + +export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root" +export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root" + +echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}" +echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}" +echo "JUGGLER_FILE_NAME_TAG = ${JUGGLER_FILE_NAME_TAG}" + +### Build the detector constructors. +git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git +git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git +pushd ${JUGGLER_DETECTOR} +ln -s ../accelerator/eic +popd +mkdir ${JUGGLER_DETECTOR}/build +pushd ${JUGGLER_DETECTOR}/build +cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install +popd + +pushd ${JUGGLER_DETECTOR} + +curl -o test_proton_dvcs_eic.hepmc "https://eicweb.phy.anl.gov/api/v4/projects/345/jobs/artifacts/master/raw/data/test_proton_dvcs_eic.hepmc?job=compile" +if [[ "$?" -ne "0" ]] ; then + echo "Failed to download hepmc file" + exit 1 +fi + + +## run geant4 simulations +npsim --runType batch \ + --part.minimalKineticEnergy 1000*GeV \ + -v WARNING \ + --numberOfEvents ${JUGGLER_N_EVENTS} \ + --compactFile ${JUGGLER_DETECTOR}.xml \ + --inputFiles test_proton_dvcs_eic.hepmc \ + --outputFile ${JUGGLER_SIM_FILE} +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running script" + exit 1 +fi + +# Need to figure out how to pass file name to juggler from the commandline +xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \ + gaudirun.py ../options/tracker_reconstruction.py +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running juggler" + exit 1 +fi +ls -l +popd + +pwd +mkdir -p results/dvcs + +echo "STAND-IN FOR ANALYSIS SCRIPT" +#root -b -q "dis/scripts/rec_dis_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")" +#if [[ "$?" -ne "0" ]] ; then +# echo "ERROR running root script" +# exit 1 +#fi + +if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then +cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/dvcs/. +fi +