Skip to content

Commit

Permalink
Merge pull request #36 from zenotech/develop
Browse files Browse the repository at this point in the history
update to exit code handling
  • Loading branch information
mike-jt79 committed Jan 18, 2018
2 parents 7da7dbf + 9ab07fd commit aa4f837
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions mycluster/templates/lsf.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ echo -e "\nnumtasks={{num_tasks}}, numnodes={{num_nodes}}, tasks_per_node={{tpn}
echo -e "\nExecuting command:\n==================\n{{my_script}}\n"

# Run user script
exitcode=. {{my_script}}
. {{my_script}}
exitcode=$?

# Report on completion
echo -e "\nJob Complete:\n==================\n"
Expand All @@ -89,5 +90,5 @@ if [ "$MYCLUSTER_APP_DATA" ]; then
fi
{% endif %}

echo -e "Complete========\n"
echo -e "Complete with exit code $exitcode========\n"
exit $exitcode
5 changes: 3 additions & 2 deletions mycluster/templates/pbs.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ echo -e "\nnumtasks={{num_tasks}}, numnodes={{num_nodes}}, tasks_per_node={{tpn}
echo -e "\nExecuting command:\n==================\n{{my_script}}\n"

# Run user script
exitcode=. {{my_script}}
. {{my_script}}
exitcode=$?

# Report on completion
echo -e "\nJob Complete:\n==================\n"
Expand All @@ -84,5 +85,5 @@ echo -e "\nJob Complete:\n==================\n"
mycluster --jobid $PBS_JOBID --appdata=$MYCLUSTER_APP_DATA
fi
{% endif %}
echo -e "Complete========\n"
echo -e "Complete with exit code $exitcode========\n"
exit $exitcode
6 changes: 4 additions & 2 deletions mycluster/templates/sge.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ echo -e "\nnumtasks={{num_tasks}}, numnodes={{num_nodes}}, tasks_per_node={{tpn}
echo -e "\nExecuting command:\n==================\n{{my_script}}\n"

# Run user script
exitcode=. {{my_script}}
. {{my_script}}
exitcode=$?

# Report on completion
echo -e "\nJob Complete:\n==================\n"
Expand All @@ -83,6 +84,7 @@ echo -e "\nJob Complete:\n==================\n"
mycluster --jobid $JOBID --appdata=$MYCLUSTER_APP_DATA
fi
{% endif %}
echo -e "Complete========\n"

echo -e "Complete with exit code $exitcode========\n"

exit $exitcode
5 changes: 3 additions & 2 deletions mycluster/templates/slurm.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ echo -e "\nnumtasks={{num_tasks}}, numnodes={{num_nodes}}, tasks_per_node={{tpn}
echo -e "\nExecuting command:\n==================\n{{my_script}}\n"

# Run user script
exitcode=. {{my_script}}
. {{my_script}}
exitcode=$?

# Report on completion
echo -e "\nJob Complete:\n==================\n"
Expand All @@ -103,5 +104,5 @@ if [ "$MYCLUSTER_APP_DATA" ]; then
fi
{% endif %}

echo -e "Complete========\n"
echo -e "Complete with exit code $exitcode========\n"
exit $exitcode

0 comments on commit aa4f837

Please sign in to comment.