From 7d0a5d8d3dc11fd976f01ef93823c5e3e10fdcb1 Mon Sep 17 00:00:00 2001 From: Jaime Frey Date: Wed, 28 Jul 2021 14:05:32 -0500 Subject: [PATCH] Allow user to override _local_submit_attributes.sh. HTCONDOR-614 If ~/.blah/_local_submit_attributes.sh exists, it is used instead of the normal /_local_submit_attributes.sh for adding batch system directives to the submit file. --- src/scripts/blah_common_submit_functions.sh | 9 ++++++++- src/scripts/condor_submit.sh | 3 --- src/scripts/lsf_submit.sh | 3 --- src/scripts/pbs_submit.sh | 3 --- src/scripts/sge_submit.sh | 5 ++--- src/scripts/slurm_submit.sh | 3 --- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/scripts/blah_common_submit_functions.sh b/src/scripts/blah_common_submit_functions.sh index 717338f..23f4e31 100755 --- a/src/scripts/blah_common_submit_functions.sh +++ b/src/scripts/blah_common_submit_functions.sh @@ -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 ############################################################### diff --git a/src/scripts/condor_submit.sh b/src/scripts/condor_submit.sh index c7d4a22..730fa52 100755 --- a/src/scripts/condor_submit.sh +++ b/src/scripts/condor_submit.sh @@ -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 diff --git a/src/scripts/lsf_submit.sh b/src/scripts/lsf_submit.sh index 4388e8a..a439b82 100755 --- a/src/scripts/lsf_submit.sh +++ b/src/scripts/lsf_submit.sh @@ -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 diff --git a/src/scripts/pbs_submit.sh b/src/scripts/pbs_submit.sh index 4a2df7f..bcc1d53 100755 --- a/src/scripts/pbs_submit.sh +++ b/src/scripts/pbs_submit.sh @@ -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: diff --git a/src/scripts/sge_submit.sh b/src/scripts/sge_submit.sh index 32696e2..a17731e 100755 --- a/src/scripts/sge_submit.sh +++ b/src/scripts/sge_submit.sh @@ -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 diff --git a/src/scripts/slurm_submit.sh b/src/scripts/slurm_submit.sh index 5a5c523..468a414 100755 --- a/src/scripts/slurm_submit.sh +++ b/src/scripts/slurm_submit.sh @@ -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