Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /job_submission_condor/scripts/run.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/bin/bash
0002 set -Euo pipefail
0003 trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
0004 IFS=$'\n\t'
0005 
0006 # check arguments
0007 if [ $# -lt 2 ] ; then
0008   echo "Usage: "
0009   echo "  $0 <type> <input> [n_chunk=10000] [i_chunk=]"
0010   echo
0011   echo "A typical npsim run requires from 0.5 to 5 core-seconds per event,"
0012   echo "and uses under 3 GB of memory. The output ROOT file for"
0013   echo "10k events take up about 2 GB in disk space."
0014   exit
0015 fi
0016 
0017 # startup
0018 date
0019 
0020 # Parse arguments
0021 # - input file basename
0022 INPUT_FILE_BASENAME=${1}
0023 shift
0024 # - input file extension to determine type of simulation 
0025 EXTENSION=${1}
0026 shift
0027 # - number of events
0028 EVENTS_PER_TASK=${1:-10000}
0029 shift
0030 # - current chunk
0031 TASK=${1:-}
0032 shift
0033 
0034 # clone repo
0035 if [ -n "${CAMPAIGNS:-}" ] ; then
0036   if [ -z "${CAMPAIGNS/http*/}" ] ; then
0037     echo "cloning ${CAMPAIGNS}"
0038     git clone ${CAMPAIGNS} campaigns
0039     CAMPAIGNS="campaigns"
0040   fi
0041 fi
0042 
0043 # dispatch job
0044 ${CAMPAIGNS:-/opt/campaigns/hepmc3}/scripts/run.sh ${INPUT_FILE_BASENAME} ${EXTENSION} ${EVENTS_PER_TASK} ${TASK}
0045 
0046 # closeout
0047 date