Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:23:42

0001 #!/bin/bash
0002 #
0003 # submit jobs to condor
0004 # 
0005 # $executable the program to execute (usually a shell script)
0006 # $arg is what is passed to the run.cmd script
0007 # $log is what the log file names are
0008 # $user is the email to send to
0009 #
0010 
0011 executable=$1
0012 arg=$2
0013 arg="${@:2}"
0014 logfname=${executable}
0015 
0016 echo $executable $arg
0017 
0018 # make sure log directory exists
0019 TMPLOG=/tmp/${USER}/${executable##*/}/log
0020 echo mkdir -p ${TMPLOG}
0021 mkdir -p ${TMPLOG}
0022 logdir=log/${executable##*/}
0023 mkdir -p $logdir
0024 
0025 echo "Submitting Run ${ijob}"
0026 
0027 log=${arg##*/}           # log file names
0028 
0029 #prepend pwd to executable if needed
0030 if [[ ! $executable =~ ^/ ]]
0031 then
0032   executable=${PWD}/${executable}
0033 fi
0034 
0035 echo "Queue" | condor_submit \
0036     -a "Executable=${executable}" \
0037     -a "Arguments=\"${arg}\"" \
0038     -a "Log=${TMPLOG}/${log}.log" \
0039     -a "Output=$PWD/${logdir}/${log}.out" \
0040     -a "Error=$PWD/${logdir}/${log}.err" \
0041     -a "Initialdir=$PWD" \
0042     -a "request_memory=4096MB" \
0043     -a "PeriodicHold=(NumJobStarts>=1 && JobStatus == 1)" \
0044     -a "GetEnv=True"
0045 
0046 
0047 echo Condor submit logs are in $TMPLOG and output logs are in $logdir
0048