Skip to content
Snippets Groups Projects

First DVMP analysis

Merged Sylvester Joosten requested to merge dvmp_ana into master
5 files
+ 213
74
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 65
26
#!/bin/bash
#!/bin/bash
if [[ ! -n "${JUGGLER_DETECTOR}" ]] ; then
## =============================================================================
 
## Global configuration variables for the benchmark scripts
 
## The script defines the following environment variables that are meant to
 
## be overriden by the Gitlab continuous integration (CI)
 
##
 
## - JUGGLER_DETECTOR: detector package to be used for the benchmark
 
## - JUGGLER_N_EVENTS: #events processed by simulation/reconstruction
 
## - JUGGLER_INSTALL_PREFIX: location where Juggler (digi/recon) is installed
 
##
 
## It also defines the following additional variables for internal usage
 
## - LOCAL_PREFIX: prefix for packages installed during the benchmark
 
## - DETECTOR_PREFIX: prefix for the detector definitions
 
## - DETECTOR_PATH: actual path with the detector definitions
 
##
 
## Finally, it makes sure LOCAL_PREFIX and JUGGLER_PREFIX are added to PATH
 
## and LD_LIBRARY_PATH
 
## =============================================================================
 
 
echo "Setting up the Physics Benchmarks environment"
 
 
## =============================================================================
 
## Default variable definitions, normally these should be set
 
## by the CI. In case of local development you may want to change these
 
## in case you would like to modify the detector package or
 
## number of events to be analyzed during the benchmark
 
 
## Detector package to be used during the benchmark process
 
if [ ! -n "${JUGGLER_DETECTOR}" ] ; then
export JUGGLER_DETECTOR="topside"
export JUGGLER_DETECTOR="topside"
fi
fi
 
echo "JUGGLER_DETECTOR: ${JUGGLER_DETECTOR}"
if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
## Number of events that will be processed by the reconstruction
 
if [ ! -n "${JUGGLER_N_EVENTS}" ] ; then
export JUGGLER_N_EVENTS=100
export JUGGLER_N_EVENTS=100
fi
fi
 
echo "JUGGLER_N_EVENTS: ${JUGGLER_N_EVENTS}"
if [[ ! -n "${JUGGLER_INSTALL_PREFIX}" ]] ; then
## Install prefix for juggler, needed to locate the Juggler xenv files.
 
## Also used by the CI as install prefix for other packages where needed.
 
## You should not have to touch this. Note that for local usage a different
 
## prefix structure is automatically used.
 
if [ ! -n "${JUGGLER_INSTALL_PREFIX}" ] ; then
export JUGGLER_INSTALL_PREFIX="/usr/local"
export JUGGLER_INSTALL_PREFIX="/usr/local"
fi
fi
 
## Ensure the juggler prefix is an absolute path
 
export JUGGLER_INSTALL_PREFIX=`realpath ${JUGGLER_INSTALL_PREFIX}`
 
echo "JUGGLER_INSTALL_PREFIX: ${JUGGLER_INSTALL_PREFIX}"
# not sure this is needed
## =============================================================================
if [[ ! -n "${DETECTOR_INSTALL_PREFIX}" ]]; then
## Other utility variables that govern how some of the dependent packages
# reuse the custom juggler install prefix for detector if in CI
## are built and installed. You should not have to change these.
if [ ! -n ${CI} ]; then
echo "Setting up detector prefix for CI usage"
export DETECTOR_INSTALL_PREFIX=${JUGGLER_INSTALL_PREFIX}
# for local builds, just use a "detector" directory
else
echo "Setting up detector prefix for local usage"
export DETECTOR_INSTALL_PREFIX="detector"
fi
fi
## ensure absolute paths
## local prefix to be used for local storage of packages
# not sure this is needed either
## downloaded/installed during the benchmark process
export JUGGLER_INSTALL_PREFIX=`realpath ${JUGGLER_INSTALL_PREFIX}`
LOCAL_PREFIX=".local"
export DETECTOR_INSTALL_PREFIX=`realpath ${DETECTOR_INSTALL_PREFIX}`
mkdir -p ${LOCAL_PREFIX}
 
export LOCAL_PREFIX=`realpath ${LOCAL_PREFIX}`
 
echo "LOCAL_PREFIX: ${LOCAL_PREFIX}"
 
 
## detector prefix: prefix for the detector definitions
 
export DETECTOR_PREFIX="${LOCAL_PREFIX}/detector"
 
mkdir -p ${DETECTOR_PREFIX}
 
echo "DETECTOR_PREFIX: ${DETECTOR_PREFIX}"
## Ensure Juggler and Detector prefixes are in our paths
## detector path: actual detector definition path
export PATH=${JUGGLER_INSTALL_PREFIX}/bin:${DETECTOR_INSTALL_PREFIX}/bin:${PATH}
export DETECTOR_PATH="${DETECTOR_PREFIX}/${JUGGLER_DETECTOR}"
export LD_LIBRARY_PATH=${JUGGLER_INSTALL_PREFIX}/lib:${DETECTOR_INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
echo "DETECTOR_PATH: ${DETECTOR_PATH}"
 
## =============================================================================
 
## Setup PATH and LD_LIBRARY_PATH to include our prefixes
 
echo "Adding JUGGLER_INSTALL_PREFIX and LOCAL_PREFIX to PATH and LD_LIBRARY_PATH"
 
export PATH=${JUGGLER_INSTALL_PREFIX}/bin:${LOCAL_PREFIX}/bin:${PATH}
 
export LD_LIBRARY_PATH=${JUGGLER_INSTALL_PREFIX}/lib:${LOCAL_PREFIX}/lib:${LD_LIBRARY_PATH}
## setup root results artifact path
## =============================================================================
# this should be in the CI File instead
## That's all!
# https://docs.gitlab.com/ee/ci/yaml/README.html#variables
echo "Environment setup complete."
# export RESULTS_PATH=`realpath results`
Loading