|
@@ -269,18 +269,21 @@ if (( leg_end_epoch < run_end_epoch )) ; then
|
|
|
elif [ "${submit_command}" == *sbatch* ] ; then
|
|
|
sbatch $0 $@ | awk '{print $4}' >> ${run_dir}/.coral_jobs
|
|
|
elif [[ $USER == "vsc"* ]]; then
|
|
|
- # Retrieve credits
|
|
|
- if [ -f ${PBS_O_WORKDIR-$PWD}"/"credits_file ]; then
|
|
|
- credits=`cat ${PBS_O_WORKDIR-$PWD}"/"credits_file`
|
|
|
+ if [ -f ${PBS_O_WORKDIR-$PWD}/tmp/credits_file ]; then
|
|
|
+ credits=`cat ${PBS_O_WORKDIR-$PWD}/tmp/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
|
|
|
+ #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/^.*: //'`
|
|
|
+ credits_tmp=`grep "account string:" ${PBS_O_WORKDIR-$PWD}/*.o* -R | sed 's/^.*: //'`
|
|
|
+ credits=`echo $credits_tmp | awk '{ print $1 }'`
|
|
|
+
|
|
|
+ mkdir -p tmp
|
|
|
+ echo ${credits} > tmp/credits_file
|
|
|
fi
|
|
|
- script_name=`cat ${PBS_O_WORKDIR-$PWD}"/"script_name`
|
|
|
- run_path=`cat ${PBS_O_WORKDIR-$PWD}"/"address`
|
|
|
+ script_name=`cat ${PBS_O_WORKDIR-$PWD}/tmp/script_name`
|
|
|
+ run_path=`cat ${PBS_O_WORKDIR-$PWD}/tmp/address`
|
|
|
ssh login2 "cd $run_path; qsub -A $credits $script_name | tee -a coral_jobs"
|
|
|
sleep 2
|
|
|
jobid=`cat coral_jobs`
|
|
@@ -297,10 +300,8 @@ if (( leg_end_epoch < run_end_epoch )) ; then
|
|
|
fi
|
|
|
else
|
|
|
if [[ $USER == "vsc"* ]]; then
|
|
|
- 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
|
|
|
+ run_path=`cat ${PBS_O_WORKDIR-$PWD}/tmp/address`
|
|
|
+ rm -rf $run_path/tmp
|
|
|
fi
|
|
|
|
|
|
echo "Nothing left to do. Cleaning and exiting." # FIXME Factorize this (we have two exit points)
|