[Dart-dev] [6095] DART/branches/development/models/POP/shell_scripts/shell_exit.sh: Example of how to make sure the LSF job exits with
nancy at ucar.edu
nancy at ucar.edu
Mon Apr 29 10:06:10 MDT 2013
Revision: 6095
Author: nancy
Date: 2013-04-29 10:06:08 -0600 (Mon, 29 Apr 2013)
Log Message:
-----------
Example of how to make sure the LSF job exits with
a non-zero exit code when the problem is in a serial
section of the job script. see the comments for how
to call this script.
Added Paths:
-----------
DART/branches/development/models/POP/shell_scripts/shell_exit.sh
-------------- next part --------------
Added: DART/branches/development/models/POP/shell_scripts/shell_exit.sh
===================================================================
--- DART/branches/development/models/POP/shell_scripts/shell_exit.sh (rev 0)
+++ DART/branches/development/models/POP/shell_scripts/shell_exit.sh 2013-04-29 16:06:08 UTC (rev 6095)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# LSF does not reliably return an exit code from
+# a serial section of a batch script, only the return
+# from the last call to mpirun.lsf. so to make a
+# batch script exit, call this:
+#
+# setenv LSB_PJL_TASK_GEOMETRY "{(0)}"
+# setenv EXITCODE -1
+# mpirun.lsf shell_exit.sh
+#
+
+if [[ $# -gt 0 ]]; then
+ EXITCODE=$1
+fi
+
+if [[ "$EXITCODE" == "" ]]; then
+ EXITCODE=0
+fi
+
+echo exiting with status code $EXITCODE
+exit $EXITCODE
+
Property changes on: DART/branches/development/models/POP/shell_scripts/shell_exit.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
More information about the Dart-dev
mailing list