Exit status

Pete Wyckoff pw at osc.edu
Thu Feb 27 14:36:16 EST 2003


collis at rice.edu said on Thu, 27 Feb 2003 12:34 -0600:
> The Warnings are okay, its just that I want my PBS script to be able to 
> access the exit status of my program.

Here's a teensy patch that implements this.  It'll be in the next
release too, sometime.  (An extra change to the manpage leaked in too,
shouldn't cause you any problems).

		-- Pete

Index: mpiexec.c
===================================================================
RCS file: /cvs/mpiexec/mpiexec.c,v
retrieving revision 1.29
diff -u -r1.29 mpiexec.c
--- mpiexec.c	3 Feb 2003 18:50:45 -0000	1.29
+++ mpiexec.c	27 Feb 2003 19:29:36 -0000
@@ -528,5 +529,5 @@
 		  tasks[i].status, tasks[i].status);
 	}
 
-    return 0;
+    return tasks[0].status;
 }
Index: mpiexec.1
===================================================================
RCS file: /cvs/mpiexec/mpiexec.1,v
retrieving revision 1.13
diff -u -r1.13 mpiexec.1
--- mpiexec.1	19 Feb 2003 18:36:47 -0000	1.13
+++ mpiexec.1	27 Feb 2003 19:29:36 -0000
@@ -287,6 +287,19 @@
 A fatal error occurred in communications between the mpiexec process and the
 local pbs_mom.  This might occur due to bugs in pbs_mom, and is not
 recoverable.
+.TP 0.6i
+mpiexec: Error: PBS_JOBID not set in environment.  Code must be run from a PBS script, perhaps interactively using "qsub -I".
+It is not possible to run mpiexec unless you are within a PBS environment,
+either created in a batch or interactive PBS job.  See tha man page for
+qsub on how to submit a job.
+
+.SH EXIT VALUE
+.LP
+Mpiexec returns to its environment the exit status of process number zero in
+a parallel task.  With this, scripts which use mpiexec can access the return
+value of the parallel program.  If task zero exited with a signal, as opposed
+to naturally with STOP or exit(), mpiexec returns 256 + signum, where signum
+is the signal that killed task zero.  This is a convention inherited from PBS.
 
 .SH AUTHORS
 .LP



More information about the mpiexec mailing list