gen_in_values_list () { host=`hostname -I` host=`echo $host` #trim whitespace local f1_base=$1 local f2_base=$2 f_pbs="" f_idx=0 f_var="${f1_base}${f_idx}" while [ -n "${!f_var}" ]; do f_location_var="${f2_base}${f_idx}" f_path=` find / -name ${!f_var}` f_pbs="${f_pbs}${!f_var}@$host:$f_path," #\"${!f_location_var}\")" f_idx=$((f_idx+1)) f_var="${f1_base}${f_idx}" done f_path=` find / -name $EXECUTABLE` f_pbs=${f_pbs}$EXECUTABLE@$host:$f_path echo ${f_pbs} } gen_out_values_list () { host=`hostname -I` host=`echo $host` #trim whitespace local f1_base=$1 local f2_base=$2 f_pbs="" f_idx=0 f_var="${f1_base}${f_idx}" while [ -n "${!f_var}" ]; do f_location_var="${f2_base}${f_idx}" f_pbs="${f_pbs}${!f_var}@$host:$PWD/${!f_var}," #\"${!f_location_var}\")" f_idx=$((f_idx+1)) f_var="${f1_base}${f_idx}" done echo ${f_pbs::-1} #delete trailing comma } get_jobdescription_type () { echo "pbs" } gen_job_description () { local pbs_f=$1 # CPUS overrides NODES/PPN way if [ -n "$CPUS" ]; then NODES=1 PPN=$CPUS else [ -z "${NODES}" ] && NODES=1 [ -z "${PPN}" ] && PPN=1 fi [ -n "$WALLTIME" ] && _WALLTIME="#PBS -l walltime=${WALLTIME}" [ -n "$MEMORY" ] && _MEMORY="#PBS -l mem=${MEMORY}" [ -n "$MAILTO" ] && _MAILTO="#PBS -M ${MAILTO}" cat < $pbs_f #!/bin/bash #PBS -N ${JOBNAME} ${_WALLTIME} #PBS -l nodes=${NODES}:ppn=${PPN} ${_MEMORY} ${_MAILTO} END [ -n "$PBS_EXTRA_HEADER" ] && echo "$PBS_EXTRA_HEADER" >> $pbs_f echo -e "\ncd \$PBS_O_WORKDIR\n" >> $pbs_f [ -n "$PBS_EXTRA_COMMANDS" ] && echo "$PBS_EXTRA_COMMANDS" >> $pbs_f cat $EXECUTABLE >> $pbs_f } jobdescription_gen_params () { cat <