|
@@ -270,12 +270,14 @@ if (( leg_end_epoch < run_end_epoch )) ; then
|
|
|
sbatch $0 $@ | awk '{print $4}' >> ${run_dir}/.coral_jobs
|
|
|
elif [[ $USER == "vsc"* ]]; then
|
|
|
# Retrieve credits
|
|
|
- logfiletmp=`echo ${PBS_O_WORKDIR-$PWD} | rev | cut -d'/' -f1 | rev`
|
|
|
- logfiletmp2=`echo $logfiletmp | cut -d'_' -f1`
|
|
|
- logfile=`ls ${PBS_O_WORKDIR-$PWD}"/"$logfiletmp2*.o*`
|
|
|
- credits=`grep "account string:" $logfile | sed 's/^.*: //'`
|
|
|
- if [ -z "$credits" ]; then
|
|
|
- credits="laerocloud"
|
|
|
+ if [ -f ${PBS_O_WORKDIR-$PWD}"/"credits_file ]; then
|
|
|
+ credits=`cat ${PBS_O_WORKDIR-$PWD}"/"credits_file`
|
|
|
+ else
|
|
|
+ logfiletmp=`echo ${PBS_O_WORKDIR-$PWD} | rev | cut -d'/' -f1 | rev`
|
|
|
+ logfiletmp2=`echo $logfiletmp | cut -d'_' -f1`
|
|
|
+ logfile=`ls ${PBS_O_WORKDIR-$PWD}"/"$logfiletmp2*.o*`
|
|
|
+ credits=`grep "account string:" $logfile | sed 's/^.*: //'`
|
|
|
+ echo ${credits} > credits_file
|
|
|
fi
|
|
|
script_name=`cat ${PBS_O_WORKDIR-$PWD}"/"script_name`
|
|
|
run_path=`cat ${PBS_O_WORKDIR-$PWD}"/"address`
|
|
@@ -298,6 +300,7 @@ else
|
|
|
run_path=`cat ${PBS_O_WORKDIR-$PWD}"/"address`
|
|
|
rm -f $run_path/script_name
|
|
|
rm -f $run_path/address
|
|
|
+ rm -f $run_path/credits_file
|
|
|
fi
|
|
|
|
|
|
echo "Nothing left to do. Cleaning and exiting." # FIXME Factorize this (we have two exit points)
|