Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:21

0001 #!/bin/bash
0002 
0003 USR="$(id -u -n)"
0004 PWD=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
0005 # The location of this shell script
0006 
0007 EXE="${PWD}/run.sh"
0008 DIR="${PWD}"
0009 MEM="4096MB"
0010 
0011 show_help() {
0012 cat << EOF
0013         usage:
0014                 ./$0 [run number] [num events (optional)] [run type (optional)]
0015         submits a condor job to do a calibration for [run number]
0016         the output will be in the local directory
0017 EOF
0018 }
0019 
0020 if [[ $# -lt 1 ]]; then
0021         show_help
0022         exit 1
0023 fi
0024 
0025 if [[ $1 == "-h" ]]; then
0026         show_help
0027         exit 0
0028 fi
0029 
0030 RUN_NUM="$1"
0031 
0032 [[ -d ${DIR}/job ]] || mkdir -p ${DIR}/job
0033 
0034 [[ -d ${DIR}/outtxt ]] || mkdir -p ${DIR}/outtxt
0035 [[ -d ${DIR}/err ]] || mkdir -p ${DIR}/err
0036 
0037 # rm -f ${DIR}/out/*
0038 # rm -f ${DIR}/err/*
0039 
0040 # underscore-deliminated list of command line args
0041 IFS="_"
0042 ARGS="$*"
0043 IFS=" "
0044 
0045 # used in naming the job file
0046 FILE="${DIR}/job/$(basename ${EXE} .sh)_${ARGS}.job"
0047 cat << EOF > ${FILE}
0048 universe        = vanilla
0049 executable      = ${EXE}
0050 arguments       = $*
0051 
0052 notification    = Never
0053 
0054 output          = ${DIR}/outtxt/out_${ARGS}.txt
0055 error           = ${DIR}/err/err_${ARGS}.txt
0056 log             = /tmp/jaein_${ARGS}.txt
0057 
0058 initialdir      = ${PWD}
0059 request_memory  = ${MEM}
0060 periodichold    = (NumJobStarts >= 1 && JobStatus == 1)
0061 concurrency_limits=CONCURRENCY_LIMIT_DEFAULT:100
0062 queue
0063 EOF
0064 
0065 echo "submitting job file ${FILE}"
0066 condor_submit ${FILE}
0067 
0068 exit 0