|
@@ -268,6 +268,23 @@ if (( leg_end_epoch < run_end_epoch )) ; then
|
|
|
exec "$0" "$@"
|
|
|
elif [ "${submit_command}" == *sbatch* ] ; 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"
|
|
|
+ fi
|
|
|
+ script_name=`cat ${PBS_O_WORKDIR-$PWD}"/"script_name`
|
|
|
+ run_path=`cat ${PBS_O_WORKDIR-$PWD}"/"address`
|
|
|
+ ssh login2 "cd $run_path; qsub -A $credits $script_name | tee -a coral_jobs"
|
|
|
+ sleep 2
|
|
|
+ jobid=`cat coral_jobs`
|
|
|
+ rm -f coral_jobs
|
|
|
+ jobid=${jobid%%.*}
|
|
|
+ echo "${jobid}" >> "${run_dir}"/.coral_jobs ;
|
|
|
else
|
|
|
"qsub" -v PBS_OPTIONS="$@" "$0" | tee -a coral_jobs
|
|
|
sleep 2
|
|
@@ -277,6 +294,12 @@ if (( leg_end_epoch < run_end_epoch )) ; then
|
|
|
echo "${jobid}" >> "${run_dir}"/.coral_jobs
|
|
|
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
|
|
|
+ fi
|
|
|
+
|
|
|
echo "Nothing left to do. Cleaning and exiting." # FIXME Factorize this (we have two exit points)
|
|
|
for (( n=0 ; n<nem_numproc ; n++ ))
|
|
|
do
|