Skip to content

Commit

Permalink
Allow user to override <lrms>_local_submit_attributes.sh. HTCONDOR-614
Browse files Browse the repository at this point in the history
If ~/.blah/<lrms>_local_submit_attributes.sh exists, it is used instead
of the normal <libexec>/<lrms>_local_submit_attributes.sh for adding
batch system directives to the submit file.
  • Loading branch information
JaimeFrey committed Jul 28, 2021
1 parent 3bf3cdc commit 7d0a5d8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
9 changes: 8 additions & 1 deletion src/scripts/blah_common_submit_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,14 @@ function bls_parse_submit_options ()
bls_opt_prnlifetime=0

bls_BLClient="${blah_libexec_directory}/BLClient"


bls_lrms=`basename $0 _submit.sh`
if [ -r ~/.blah/${bls_lrms}_local_submit_attributes.sh ] ; then
bls_local_submit_attributes_file=~/.blah/${bls_lrms}_local_submit_attributes.sh
else
bls_local_submit_attributes_file="${blah_libexec_directory}/${bls_lrms}_local_submit_attributes.sh"
fi

###############################################################
# Parse parameters
###############################################################
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/condor_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ leave_in_queue = JobStatus == 4 && (CompletionDate =?= UNDEFINED || CompletionDa
EOF


#local batch system-specific file output must be added to the submit file
bls_local_submit_attributes_file=${blah_libexec_directory}/condor_local_submit_attributes.sh

bls_set_up_local_and_extra_args

echo "queue 1" >> $submit_file
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/lsf_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ if [ "x$bls_opt_runtime" != "x" ] ; then
echo "#BSUB -W $((bls_opt_runtime / 60))" >> $bls_tmp_file
fi

#local batch system-specific file output must be added to the submit file
bls_local_submit_attributes_file=${blah_libexec_directory}/lsf_local_submit_attributes.sh

bls_set_up_local_and_extra_args

# Write LSF directives according to command line options
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/pbs_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ if [ "x$bls_opt_runtime" != "x" ] ; then
echo "#PBS -l walltime=$bls_opt_runtime" >> $bls_tmp_file
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

# Begin building the select statement: select=x where x is the number of 'chunks'
# to request. Chunk requests should precede any resource requests (resource
# requests are order independent). An example from the PBS Pro manual:
Expand Down
5 changes: 2 additions & 3 deletions src/scripts/sge_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ if [ "x$bls_opt_runtime" != "x" ] ; then
fi

#local batch system-specific file output must be added to the submit file
local_submit_attributes_file=${blah_libexec_directory}/sge_local_submit_attributes.sh
if [ -r $local_submit_attributes_file ] ; then
if [ -r $bls_local_submit_attributes_file ] ; then
echo \#\!/bin/sh > $bls_opt_tmp_req_file
if [ ! -z $bls_opt_req_file ] ; then
cat $bls_opt_req_file >> $bls_opt_tmp_req_file
fi
echo "source $local_submit_attributes_file" >> $bls_opt_tmp_req_file
echo "source $bls_local_submit_attributes_file" >> $bls_opt_tmp_req_file
chmod +x $bls_opt_tmp_req_file
$bls_opt_tmp_req_file >> $bls_tmp_file 2> /dev/null
rm -f $bls_opt_tmp_req_file
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/slurm_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ if [ "x$bls_opt_runtime" != "x" ] ; then
echo "#SBATCH -t $((bls_opt_runtime / 60))" >> $bls_tmp_file
fi

#local batch system-specific file output must be added to the submit file
bls_local_submit_attributes_file=${blah_libexec_directory}/slurm_local_submit_attributes.sh

if [ "x$bls_opt_req_mem" != "x" ]
then
# Different schedulers require different memory checks
Expand Down

0 comments on commit 7d0a5d8

Please sign in to comment.