Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed script name for sinline as the original name caused failure. Ma… #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions sinline
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ if [ -z "${sbatch_args}" ]; then
sbatch_args="--time=00:30:00"
fi

echo '#!/bin/bash' > /tmp/bash_script.sh
echo '#SBATCH -o sbatch_stdout.log' >> /tmp/bash_script.sh
echo '#SBATCH -e sbatch_stderr.log' >> /tmp/bash_script.sh
echo "${cmd}" >> /tmp/bash_script.sh
dt=$(date '+%d_%m_%Y__%H_%M_%S')
uname=$(whoami)
TMPFILEPATH=/tmp/bash_script_${uname}_${dt}.sh

sbatch --wait ${sbatch_args} -w ${node} /tmp/bash_script.sh

echo '#!/bin/bash' > ${TMPFILEPATH}
echo '#SBATCH -o sbatch_stdout.log' >> ${TMPFILEPATH}
echo '#SBATCH -e sbatch_stderr.log' >> ${TMPFILEPATH}
echo "${cmd}" >> ${TMPFILEPATH}
chmod u+x ${TMPFILEPATH} # make sure it is executable

sbatch --wait ${sbatch_args} -w ${node} ${TMPFILEPATH}
wait

cat sbatch_stdout.log >&1
Expand All @@ -83,5 +89,5 @@ cat sbatch_stderr.log >&2
# Clean up
if [ "${cleanup}" -eq "1" ]; then
rm sbatch_std{out,err}.log
rm /tmp/bash_script.sh
rm ${TMPFILEPATH}
fi