Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #31 from brianhlin/sw2260_pbs_mem
Browse files Browse the repository at this point in the history
Fix mem requests (SOFTWARE-2260)
  • Loading branch information
djw8605 committed Apr 22, 2016
2 parents 283e4b5 + 470c720 commit d586e2b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
3 changes: 3 additions & 0 deletions config/blah.config.template
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ pbs_nologaccess=yes
#locally from the logs if BLParser is not present
pbs_fallback=no

#Set to 'yes' to request pvmem when submitting jobs
pbs_set_pvmem=no


##LSF common variables

Expand Down
29 changes: 17 additions & 12 deletions src/scripts/pbs_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fi
#local batch system-specific file output must be added to the submit file
bls_local_submit_attributes_file=${blah_libexec_directory}/pbs_local_submit_attributes.sh

${pbs_binpath}/qstat --version | grep PBSPro
${pbs_binpath}/qstat --version 2>&1 | grep PBSPro > /dev/null 2>&1
is_pbs_pro=$?
# Begin building the select statement: select=x where x is the number of 'chunks'
# to request. Chunk requests should precede any resource requests (resource
Expand All @@ -126,15 +126,20 @@ is_pbs_pro=$?
# Only one chunk is required for OSG needs at this time.
pbs_select="#PBS -l select=1"

if [ "x$bls_opt_req_mem" != "x" ]
then
# Different schedulers require different memory checks
echo "#PBS -l pmem=${bls_opt_req_mem}mb" >> $bls_tmp_file
echo "#PBS -l pvmem=${bls_opt_req_mem}mb" >> $bls_tmp_file
pbs_select="$pbs_select:mem=${bls_opt_req_mem}mb"
if [ "$is_pbs_pro" -neq "0" ]; then
echo "#PBS -l mem=${bls_opt_req_mem}mb" >> $bls_tmp_file
fi
if [ "x$bls_opt_req_mem" != "x" ]; then
# Max amount of virtual memory allocated to a single process
if [[ "x$pbs_set_pvmem" == "xyes" ]]; then
echo "#PBS -l pvmem=${bls_opt_req_mem}mb" >> $bls_tmp_file
fi
# Max amount of physical memory allocated to a single process
if [[ "$bls_opt_smpgranularity" == 1 ]]; then
echo "#PBS -l pmem=${bls_opt_req_mem}mb" >> $bls_tmp_file
fi
# Total amount of memory allocated to the job
pbs_select="$pbs_select:mem=${bls_opt_req_mem}mb"
if [ "$is_pbs_pro" != 0 ]; then
echo "#PBS -l mem=${bls_opt_req_mem}mb" >> $bls_tmp_file
fi
fi

bls_set_up_local_and_extra_args
Expand All @@ -144,7 +149,7 @@ bls_set_up_local_and_extra_args
[ -z "$bls_opt_queue" ] || grep -q "^#PBS -q" $bls_tmp_file || echo "#PBS -q $bls_opt_queue" >> $bls_tmp_file

# Extended support for MPI attributes
if [ "$is_pbs_pro" -eq "0" ]; then
if [ "$is_pbs_pro" == 0 ]; then
pbs_select="$pbs_select:ncpus=1"
else
if [ "x$bls_opt_wholenodes" == "xyes" ]; then
Expand Down Expand Up @@ -204,7 +209,7 @@ else
[ -z "$bls_fl_subst_and_accumulate_result" ] || echo "#PBS -W stageout=\\'$bls_fl_subst_and_accumulate_result\\'" >> $bls_tmp_file
fi

if [ "$is_pbs_pro" -eq "0" ]; then
if [ "$is_pbs_pro" == 0 ]; then
echo $pbs_select >> $bls_tmp_file
fi

Expand Down

0 comments on commit d586e2b

Please sign in to comment.