Skip to content
Snippets Groups Projects
Commit a438e84b authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Cleaned up and simplified the config/env.sh and util/build.sh

 - We should limit the number of new environment variables. They
 increase complexity which should be mostly absorbed by using containers.
 - Any new environment variables should be set via the ci yml file
 or defined the UI. https://docs.gitlab.com/ee/ci/variables/README.html#custom-environment-variables
 - Removed dummy scripts
 - Removed dvmp dummy jobs.
 - Fixed dvmp output data. Note the out artifacts should go in
 `results/dvmp` if they are in the `dvmp` directory. This will just make
 things easier later on for collecting and summarizing results.
 - updated  dvmp/scripts/run_generator_instance.sh
 - Added dvmp.sh to run geant4/reconstruction. Note `dvmp/dvmp.sh` could be named something more specific, like `dvmp/dvmp_barrel_decays.sh` depending on the input, analysis, etc...
parent 779264b8
No related branches found
No related tags found
1 merge request!5Cleaned up and simplified the config/env.sh and util/build.sh
......@@ -15,11 +15,10 @@ stages:
include:
- local: 'dis/config.yml'
- local: 'dummy/config.yml'
- local: 'dvmp/config.yml'
summary:
stage: finish
needs: ["dis:results", "dummy:results", "dvmp:results"]
needs: ["dis:results", "dvmp:results"]
script:
- echo "All benchmarks passed"
......@@ -12,17 +12,18 @@ if [[ ! -n "${JUGGLER_INSTALL_PREFIX}" ]] ; then
export JUGGLER_INSTALL_PREFIX="/usr/local"
fi
# not sure this is needed
if [[ ! -n "${DETECTOR_PREFIX}" ]]; then
export DETECTOR_PREFIX=detector
# reuse the custom juggler install prefix for detector
export DETECTOR_INSTALL_PREFIX=${JUGGLER_INSTALL_PREFIX}
fi
## ensure absolute paths
# not sure this is needed either
export JUGGLER_INSTALL_PREFIX=`realpath ${JUGGLER_INSTALL_PREFIX}`
export DETECTOR_PREFIX=`realpath ${DETECTOR_PREFIX}`
## setup detector paths
export LD_LIBRARY_PATH=${DETECTOR_PREFIX}/lib:$LD_LIBRARY_PATH
export DETECTOR_SOURCE_PATH=${DETECTOR_PREFIX}/src
export DETECTOR_INSTALL_PREFIX=`realpath ${DETECTOR_INSTALL_PREFIX}`
## setup root results artifact path
export RESULTS_PATH=`realpath results`
# this should be in the CI File instead
# https://docs.gitlab.com/ee/ci/yaml/README.html#variables
# export RESULTS_PATH=`realpath results`
......@@ -60,7 +60,6 @@ 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
......@@ -78,6 +77,6 @@ if [[ "$?" -ne "0" ]] ; then
fi
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/.
cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/dis/.
fi
dummy:dummy_test:
stage: analyze
timeout: 1 hours
script:
- dummy/dummy_test.sh
dummy:dummy_test2:
stage: analyze
timeout: 1 hours
script:
- dummy/dummy_test2.sh
dummy:dummy_fail_test:
stage: analyze
timeout: 1 hours
allow_failure: true
script:
- dummy/dummy_fail_test.sh
dummy:results:
stage: collect
needs: ["dummy:dummy_test", "dummy:dummy_test2", "dummy:dummy_fail_test"]
script:
- echo "All DIS benchmarks successful"
#!/bin/bash
echo "Dummy Test..."
echo "..."
echo "Fails!"
exit 1
#!/bin/bash
echo "Dummy Test..."
echo "..."
echo "Passes!"
#exit 1
#!/bin/bash
echo "Dummy Test number 2..."
echo "..."
echo "Passes!"
#exit 1
......@@ -20,49 +20,22 @@ dvmp:generate:
dvmp:jpsi_central:process:
stage: process
needs: ["dvmp:generate"]
dependencies:
- dvmp:generate
timeout: 1 hour
script:
- mkdir -p results/data/dvmp
- mkdir -p results/plots/dvmp
- echo "Running the detector simulation"
- touch results/data/dvmp/sim-stub
- echo "Running the reconstruction"
- touch results/data/dvmp/rec-stub
- bash dvmp/dvmp.sh
artifacts:
paths:
- results
dvmp:jpsi_central:dummy_test:
dvmp:jpsi_central:test_analysis:
stage: analyze
needs: ["dvmp:jpsi_central:process"]
dependencies:
- dvmp:jpsi_central:process
script:
- dvmp/scripts/dummy_test.sh
- echo "THIS IS A PLACE HOLDER"
dvmp:jpsi_central:dummy_test2:
stage: analyze
needs: ["dvmp:jpsi_central:process"]
dependencies:
- dvmp:jpsi_central:process
script:
- dvmp/scripts/dummy_test2.sh
dvmp:jpsi_central:dummy_fail_test:
stage: analyze
needs: ["dvmp:jpsi_central:process"]
dependencies:
- dvmp:jpsi_central:process
allow_failure: true
script:
- dvmp/scripts/dummy_fail_test.sh
dvmp:results:
stage: collect
needs: ["dvmp:jpsi_central:dummy_test",
"dvmp:jpsi_central:dummy_test2",
"dvmp:jpsi_central:dummy_fail_test"]
needs: ["dvmp:jpsi_central:test_analysis"]
script:
- echo "All DVMP benchmarks successful"
#!/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="dvmp"
# Generator file
export JUGGLER_GEN_FILE="results/dvmp/jpsi_central_electron-10on100-gen.hepmc"
#export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
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}
## run geant4 simulations
npsim --runType batch \
--part.minimalKineticEnergy 1000*GeV \
-v WARNING \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${JUGGLER_DETECTOR}.xml \
--inputFiles ../${JUGGLER_GEN_FILE} \
--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/dis
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/dvmp/.
fi
#!/bin/bash
echo "Dummy Test..."
echo "..."
echo "Fails!"
exit 1
#!/bin/bash
echo "Dummy Test..."
echo "..."
echo "Passes!"
#exit 1
#!/bin/bash
echo "Dummy Test number 2..."
echo "..."
echo "Passes!"
#exit 1
......@@ -15,7 +15,7 @@ fi
export RNG_SEED=1
## Setup local environment
export DATA_PATH=$RESULTS_PATH/data/dvmp
export DATA_PATH=results/dvmp
EBEAM=
......@@ -110,9 +110,13 @@ sed "s/@TAG@/${FNAME}/" $CONFIG_IN | \
echo "Running the generator"
lager -r ${RNG_SEED} -c ${FNAME}.json -e ${NEVENTS} -o .
ls -lrth
popd
## Finally, move relevant output into the artifacts directory
echo "Moving generator output into ${DATA_PATH}"
mkdir -p ${DATA_PATH}
for ext in hepmc json log root; do
mv *.${FNAME}.*.${ext} ${DATA_PATH}/${FNAME}.${ext}
for ext in hepmc json log root ; do
mv dvmp/*.${FNAME}.*.${ext} ${DATA_PATH}/${FNAME}.${ext}
done
......@@ -4,15 +4,25 @@
source config/env.sh
## Build and install the detector plugins.
if [[ ! -d ${DETECTOR_SOURCE_PATH} ]]; then
git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git ${DETECTOR_SOURCE_PATH}
if [[ ! -d ${JUGGLER_DETECTOR} ]]; then
git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
# this might be temporary. There are multiple solutions here but this is the simple pattern for now
# I do not want to use git submodules here -whit
git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git
pushd ${JUGGLER_DETECTOR}
ln -s ../accelerator/eic
popd
else
pushd ${DETECTOR_SOURCE_PATH}
pushd ${JUGGLER_DETECTOR}
git pull --ff-only
popd
pushd accelerator
git pull --ff-only
popd
fi
mkdir -p detector-build
pushd detector-build
echo cmake ${DETECTOR_SOURCE_PATH} -DCMAKE_INSTALL_PREFIX=${DETECTOR_PREFIX} && make -j30 install
cmake ${DETECTOR_SOURCE_PATH} -DCMAKE_INSTALL_PREFIX=${DETECTOR_PREFIX} && make -j30 install
# Always keep the detector directory at the top level.
echo cmake ../${JUGGLER_DETECTOR} -DCMAKE_INSTALL_PREFIX=${DETECTOR_INSTALL_PREFIX} && make -j30 install
cmake ../${JUGGLER_DETECTOR} -DCMAKE_INSTALL_PREFIX=${DETECTOR_INSTALL_PREFIX} && make -j30 install
popd
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