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 #68 from brianhlin/sw2827_save_dirs
Browse files Browse the repository at this point in the history
Save debug submit info before submission (SOFTWARE-2827)
brianhlin authored Feb 23, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 747ac45 + 0941ca7 commit f6b05d7
Showing 5 changed files with 35 additions and 31 deletions.
61 changes: 31 additions & 30 deletions src/scripts/blah_common_submit_functions.sh
Original file line number Diff line number Diff line change
@@ -814,38 +814,39 @@ function bls_set_up_local_and_extra_args ()
fi
}
function bls_wrap_up_submit ()
{
if [ -d "$blah_debug_save_submit_info" -a -n "$bls_tmp_name" ]; then
# Store files used for this job in a directory
bls_info_dir="$blah_debug_save_submit_info/$bls_tmp_name.debug"
mkdir "$bls_info_dir"
if [ $? -eq 0 ]; then
# Best effort.
if [ -r "$bls_proxy_local_file" ]; then
cp "$bls_proxy_local_file" "$bls_info_dir/submit.proxy"
fi
if [ -r "$bls_opt_stdout" ]; then
ln "$bls_opt_stdout" "$bls_info_dir/job.stdout"
if [ $? -ne 0 ]; then
# If we cannot hardlink, try a soft link.
ln -s "$bls_opt_stdout" "$bls_info_dir/job.stdout"
fi
fi
if [ -r "$bls_opt_stderr" ]; then
ln "$bls_opt_stderr" "$bls_info_dir/job.stderr"
if [ $? -ne 0 ]; then
# If we cannot hardlink, try a soft link.
ln -s "$bls_opt_stderr" "$bls_info_dir/job.stderr"
function bls_save_submit () {
if [ -d "$blah_debug_save_submit_info" -a -n "$bls_tmp_name" ]; then
# Store files used for this job in a directory
bls_info_dir="$blah_debug_save_submit_info/$bls_tmp_name.debug"
mkdir "$bls_info_dir"
if [ $? -eq 0 ]; then
# Best effort.
if [ -r "$bls_proxy_local_file" ]; then
cp "$bls_proxy_local_file" "$bls_info_dir/submit.proxy"
fi
if [ -r "$bls_opt_stdout" ]; then
ln "$bls_opt_stdout" "$bls_info_dir/job.stdout"
if [ $? -ne 0 ]; then
# If we cannot hardlink, try a soft link.
ln -s "$bls_opt_stdout" "$bls_info_dir/job.stdout"
fi
fi
if [ -r "$bls_opt_stderr" ]; then
ln "$bls_opt_stderr" "$bls_info_dir/job.stderr"
if [ $? -ne 0 ]; then
# If we cannot hardlink, try a soft link.
ln -s "$bls_opt_stderr" "$bls_info_dir/job.stderr"
fi
fi
if [ -r "$bls_tmp_file" ]; then
cp "$bls_tmp_file" "$bls_info_dir/submit.script"
fi
fi
fi
if [ -r "$bls_tmp_file" ]; then
cp "$bls_tmp_file" "$bls_info_dir/submit.script"
fi
fi
fi
fi
}
function bls_wrap_up_submit ()
{
bls_fl_clear inputsand
bls_fl_clear outputsand
bls_fl_clear inputcopy
1 change: 1 addition & 0 deletions src/scripts/lsf_submit.sh
Original file line number Diff line number Diff line change
@@ -161,6 +161,7 @@ echo " cd \$CERN_STARTER_ORIGINAL_CWD" >> $bls_tmp_file
echo "fi" >> $bls_tmp_file

bls_add_job_wrapper
bls_save_submit

# Let the wrap script be at least 1 second older than logfile
# for subsequent "find -newer" command to work
1 change: 1 addition & 0 deletions src/scripts/pbs_submit.sh
Original file line number Diff line number Diff line change
@@ -214,6 +214,7 @@ fi
echo "#PBS -m n" >> $bls_tmp_file

bls_add_job_wrapper
bls_save_submit

# Let the wrap script be at least 1 second older than logfile
# for subsequent "find -newer" command to work
1 change: 1 addition & 0 deletions src/scripts/sge_submit.sh
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ bls_fl_subst_and_accumulate outputsand "@@F_REMOTE@`hostname -f`:@@F_LOCAL" "@@@
echo "#$ -m n" >> $bls_tmp_file

bls_add_job_wrapper
bls_save_submit

###############################################################
# Submit the script
2 changes: 1 addition & 1 deletion src/scripts/slurm_submit.sh
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ bls_set_up_local_and_extra_args
# Assume all filesystems are shared.

bls_add_job_wrapper

bls_save_submit

###############################################################
# Submit the script

0 comments on commit f6b05d7

Please sign in to comment.