Discussion:
[OMPI users] Crash during MPI_Finalize
George Reeke
2016-10-04 20:08:23 UTC
Permalink
Dear colleagues,
I have a parallel MPI application written in C that works normally in
a serial version and in the parallel version in the sense that all
numerical output is correct. When it tries to shut down, it gives the
following console error messsage:

Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status,
thus causing
the job to be terminated. The first process to do so was:

Process name: [[51524,1],0]
Exit code: 13

The Process name given is not the number of any Linux process.
The Exit code seems to be any number in the range ~12 to 17.
The core dumps produced do not have usable backtrace information.
I cannot determine the cause of the problem. Let me be as explicit
as possible:
OS RHEL 6.8, compiler gcc with -g, no optimization
Version of MPI (RedHat package): openmpi-1.10-1.10.2-2.el6.x86_64
The startup command is like this:
mpirun --output-filename junk -n 1 cnsP0 NOSP : -n 3 cnsPn < v8tin/dan

cnsP0 is a master code that reads a control file (specified after the
'<' on the command line). The other executables (cnsPn) only send and
receive messages (and do math), no file IO. I only tried with 4 nodes
so far.
Early in startup, another process is started via MPI_Comm_spawn.
I suspect this is relevant to the problem, although simple test
programs using the same setup complete normally. This process,
andmsg, receives status or debug information asynchronously via
messages from the other processes and writes them to stderr.
I have tried many versions of the shutdown code, all with the same
result. Here is one version (debug writes deleted, comments modified):
Notes: "is_host(NC.node)" returns 1 if this is the rank 0 node.
NC.dmsgid is the node id of the andmsg process, which uses the
intercommunicator NC.commd. andmsg counts the number of ival
messages received and tries to shut down when it has one from
each of the original 4 (or however many) nodes.

Application code:
/* Everything works OK up to here. */
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid,
SHUTDOWN_ANDMSG, NC.commd); /* andmsg counts these */
/* This message confirms that andmsg got 4 SHUTDOWN messages */
if (is_host(NC.node)) { MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid,
CLOSING_ANDMSG, NC.commd, MPI_STATUS_IGNORE);
}
/* Results similar with or without this barrier */
rc = MPI_Barrier(NC.commc); /* NC.commc is original world comm */
/* Behavior is same with or without this extra message exchange */
if (is_host(NC.node)) {
ival = SHUTDOWN_ANDMSG;
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid,
SHUTDOWN_ANDMSG, NC.commd);
}
/* Behavior is same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);

Spawned process code extract:

if (num2stop <= 0) { /* Countdown of shutdown messages received */
int rc;
rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid,
CLOSING_ANDMSG, NC.commd);
/* Receive extra synch message commented above */
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG,
NC.commd, MPI_STATUS_IGNORE);
sleep(1); /* Results same with or without this sleep */
/* Results same with or without this disconnect [see above] */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
}

I would much appreciate any suggestions how to debug this.
From the suggestions at the community help web page, here is more
information:
config.log file, bzipped version, is attached.
ompi_info --all output is attached.
I am not sending information from other nodes or network config--for
test purposes, all processes are running on the one node, my laptop
with i7 processor.
I did not set any MCA environment parameters.
Thanks,
George Reeke
George Reeke
2016-10-06 17:53:59 UTC
Permalink
Dear colleagues,
I have a parallel MPI application written in C that works normally in
a serial version and in the parallel version in the sense that all
numerical output is correct. When it tries to shut down, it gives the
following console error messsage:

Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status,
thus causing
the job to be terminated. The first process to do so was:

Process name: [[51524,1],0]
Exit code: 13
-----End quoted console text-----
The Process name given is not the number of any Linux process.
The Exit code given seems to be any number in the range 12 to 17.
The core dumps produced do not have usable backtrace information.
There is no output on stderr (besides my debug messages).
The last message written by rank 0 node on stdout and flushed is lost.
I cannot determine the cause of the problem.
Let me be as explicit as possible:
OS RHEL 6.8, compiler gcc 4.4.7 with -g, no optimization
Version of MPI (RedHat package): openmpi-1.10-1.10.2-2.el6.x86_64
The startup command is like this:
mpirun --output-filename junk -mca btl_tcp_if_include lo -n 1 cnsP0 NOSP : -n 3 cnsPn < v8tin/dan

cnsP0 is a master code that reads a control file (specified after the
'<' on the command line). The other executables (cnsPn) only send and
receive messages and do math, no file IO. I get same results with
3 or 4 compute nodes.
Early in startup, another process is started via MPI_Comm_spawn.
I suspect this is relevant to the problem, although simple test
programs using the same setup complete normally. This process,
andmsg, receives status or debug information asynchronously via
messages from the other processes and writes them to stderr.
I have tried many versions of the shutdown code, all with the same
result. Here is one version (debug writes (using fwrite()and
fflush()) are deleted, comments modified for clarity):

Application code (cnsP0 and cnsPn):
/* Everything works OK up to here (stdout and debug output). */
int rc, ival = 0;
/* In next line, NC.dmsgid is rank # of andmsg process and
* NC.commd is intercommunicator to it. andmsg counts these
* shutdown messages, one from each app node. */
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG,
NC.commd);
/* This message confirms that andmsg got 4 SHUTDOWN messages.
* "is_host(NC.node)" returns 1 if this is the rank 0 node. */
if (is_host(NC.node)) { MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid,
CLOSING_ANDMSG, NC.commd, MPI_STATUS_IGNORE); }
/* Results are similar with or without this barrier. Debug lines
* written on stderr from all nodes after barrier appear OK. */
rc = MPI_Barrier(NC.commc); /* NC.commc is original world comm */
/* Behavior is same with or without this extra message exchange,
* which I added to keep andmsg from terminating before the
* barrier among the other nodes completes. */
if (is_host(NC.node)) { rc = MPI_Send(&ival, 1, MPI_INT,
NC.dmsgid, SHUTDOWN_ANDMSG, NC.commd); }
/* Behavior is same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);

Spawned process (andmsg) code extract:

if (num2stop <= 0) { /* Countdown of shutdown messages received */
int rc;
/* This message confirms to main app that shutdown messages
* were received from all nodes. */
rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid,
CLOSING_ANDMSG, NC.commd);
/* Receive extra synch message commented above */
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG,
NC.commd, MPI_STATUS_IGNORE);
sleep(1); /* Results are same with or without this sleep */
/* Results are same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
}

I would much appreciate any suggestions how to debug this.
From the suggestions at the community help web page, here is more
information:
config.log file, bzipped version, is attached.
ompi_info --all bzipped output is attached.
I am not sending information from other nodes or network config--for
test purposes, all processes are running on the one node, my laptop
with i7 processor. I set the "-mca btl_tcp_if_include lo" parameter
earlier when I got an error message about a refused connection
(that my code never asked for in the first place). This got rid
of that error message but application still fails and dumps.
Thanks,
George Reeke
Gilles Gouaillardet
2016-10-11 01:10:03 UTC
Permalink
George,


i tried to mimick this with the latest v1.10, and failed to reproduce
the error.


at first, i recommend you try the latest v1.10 (1.10.4) or event 2.0.1.


unusable stack trace can sometimes be caused by unloaded modules,

so if the issue persists, you might want to try rebuilding Open MPI with

--disable-dlopen

and since you want to do some debugging, you might also want to add

--enable-debug

Then if the issue still persists, i suggest you prepare a trimmed
version of your program

that is enough to reproduce the issue and post it so some of us can have
a look


Cheers,


Gilles
Post by George Reeke
Dear colleagues,
I have a parallel MPI application written in C that works normally in
a serial version and in the parallel version in the sense that all
numerical output is correct. When it tries to shut down, it gives the
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status,
thus causing
Process name: [[51524,1],0]
Exit code: 13
-----End quoted console text-----
The Process name given is not the number of any Linux process.
The Exit code given seems to be any number in the range 12 to 17.
The core dumps produced do not have usable backtrace information.
There is no output on stderr (besides my debug messages).
The last message written by rank 0 node on stdout and flushed is lost.
I cannot determine the cause of the problem.
OS RHEL 6.8, compiler gcc 4.4.7 with -g, no optimization
Version of MPI (RedHat package): openmpi-1.10-1.10.2-2.el6.x86_64
mpirun --output-filename junk -mca btl_tcp_if_include lo -n 1 cnsP0 NOSP : -n 3 cnsPn < v8tin/dan
cnsP0 is a master code that reads a control file (specified after the
'<' on the command line). The other executables (cnsPn) only send and
receive messages and do math, no file IO. I get same results with
3 or 4 compute nodes.
Early in startup, another process is started via MPI_Comm_spawn.
I suspect this is relevant to the problem, although simple test
programs using the same setup complete normally. This process,
andmsg, receives status or debug information asynchronously via
messages from the other processes and writes them to stderr.
I have tried many versions of the shutdown code, all with the same
result. Here is one version (debug writes (using fwrite()and
/* Everything works OK up to here (stdout and debug output). */
int rc, ival = 0;
/* In next line, NC.dmsgid is rank # of andmsg process and
* NC.commd is intercommunicator to it. andmsg counts these
* shutdown messages, one from each app node. */
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG,
NC.commd);
/* This message confirms that andmsg got 4 SHUTDOWN messages.
* "is_host(NC.node)" returns 1 if this is the rank 0 node. */
if (is_host(NC.node)) { MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid,
CLOSING_ANDMSG, NC.commd, MPI_STATUS_IGNORE); }
/* Results are similar with or without this barrier. Debug lines
* written on stderr from all nodes after barrier appear OK. */
rc = MPI_Barrier(NC.commc); /* NC.commc is original world comm */
/* Behavior is same with or without this extra message exchange,
* which I added to keep andmsg from terminating before the
* barrier among the other nodes completes. */
if (is_host(NC.node)) { rc = MPI_Send(&ival, 1, MPI_INT,
NC.dmsgid, SHUTDOWN_ANDMSG, NC.commd); }
/* Behavior is same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
if (num2stop <= 0) { /* Countdown of shutdown messages received */
int rc;
/* This message confirms to main app that shutdown messages
* were received from all nodes. */
rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid,
CLOSING_ANDMSG, NC.commd);
/* Receive extra synch message commented above */
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG,
NC.commd, MPI_STATUS_IGNORE);
sleep(1); /* Results are same with or without this sleep */
/* Results are same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
}
I would much appreciate any suggestions how to debug this.
Post by George Reeke
From the suggestions at the community help web page, here is more
config.log file, bzipped version, is attached.
ompi_info --all bzipped output is attached.
I am not sending information from other nodes or network config--for
test purposes, all processes are running on the one node, my laptop
with i7 processor. I set the "-mca btl_tcp_if_include lo" parameter
earlier when I got an error message about a refused connection
(that my code never asked for in the first place). This got rid
of that error message but application still fails and dumps.
Thanks,
George Reeke
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
George Reeke
2016-10-14 17:30:07 UTC
Permalink
Post by Gilles Gouaillardet
George,
at first, i recommend you try the latest v1.10 (1.10.4) or event 2.0.1.
Dear Gilles et al,
Can this coexist with the version of open-mpi on my RedHat
system (1.10.2)? Is this a matter of downloading source and running
the usual .configure-make sequence? I understand some library
references may also require updating, I can deal with that, but
I want to have my old system back in case the install fails.
Would you advise trying this in a VM?
Thanks,
George Reeke

George Bosilca
2016-10-11 01:37:48 UTC
Permalink
George,

There is too much information missing from your example. If I try to run
the code on the top assuming the process is is_host(NC.node), I have
on NC.commd
3 communications (ignore the others):

rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG, NC.commd);
MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid, CLOSING_ANDMSG, NC.commd,
MPI_STATUS_IGNORE);
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG, NC.commd); }

On the andmsg I can only see 2 matching communications:

rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid, CLOSING_ANDMSG, NC.commd);
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG, NC.commd,
MPI_STATUS_IGNORE);

So either there is a pending send (which is treated as an eager by OMPI
because it is of length 4 bytes), or there is something missing on the code
example. Can you post a more complete example ?

Thanks,
George.
Post by George Reeke
Dear colleagues,
I have a parallel MPI application written in C that works normally in
a serial version and in the parallel version in the sense that all
numerical output is correct. When it tries to shut down, it gives the
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status,
thus causing
Process name: [[51524,1],0]
Exit code: 13
-----End quoted console text-----
The Process name given is not the number of any Linux process.
The Exit code given seems to be any number in the range 12 to 17.
The core dumps produced do not have usable backtrace information.
There is no output on stderr (besides my debug messages).
The last message written by rank 0 node on stdout and flushed is lost.
I cannot determine the cause of the problem.
OS RHEL 6.8, compiler gcc 4.4.7 with -g, no optimization
Version of MPI (RedHat package): openmpi-1.10-1.10.2-2.el6.x86_64
-n 3 cnsPn < v8tin/dan
cnsP0 is a master code that reads a control file (specified after the
'<' on the command line). The other executables (cnsPn) only send and
receive messages and do math, no file IO. I get same results with
3 or 4 compute nodes.
Early in startup, another process is started via MPI_Comm_spawn.
I suspect this is relevant to the problem, although simple test
programs using the same setup complete normally. This process,
andmsg, receives status or debug information asynchronously via
messages from the other processes and writes them to stderr.
I have tried many versions of the shutdown code, all with the same
result. Here is one version (debug writes (using fwrite()and
/* Everything works OK up to here (stdout and debug output). */
int rc, ival = 0;
/* In next line, NC.dmsgid is rank # of andmsg process and
* NC.commd is intercommunicator to it. andmsg counts these
* shutdown messages, one from each app node. */
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG,
NC.commd);
/* This message confirms that andmsg got 4 SHUTDOWN messages.
* "is_host(NC.node)" returns 1 if this is the rank 0 node. */
if (is_host(NC.node)) { MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid,
CLOSING_ANDMSG, NC.commd, MPI_STATUS_IGNORE); }
/* Results are similar with or without this barrier. Debug lines
* written on stderr from all nodes after barrier appear OK. */
rc = MPI_Barrier(NC.commc); /* NC.commc is original world comm */
/* Behavior is same with or without this extra message exchange,
* which I added to keep andmsg from terminating before the
* barrier among the other nodes completes. */
if (is_host(NC.node)) { rc = MPI_Send(&ival, 1, MPI_INT,
NC.dmsgid, SHUTDOWN_ANDMSG, NC.commd); }
/* Behavior is same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
if (num2stop <= 0) { /* Countdown of shutdown messages received */
int rc;
/* This message confirms to main app that shutdown messages
* were received from all nodes. */
rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid,
CLOSING_ANDMSG, NC.commd);
/* Receive extra synch message commented above */
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG,
NC.commd, MPI_STATUS_IGNORE);
sleep(1); /* Results are same with or without this sleep */
/* Results are same with or without this disconnect */
rc = MPI_Comm_disconnect(&NC.commd);
rc = MPI_Finalize();
exit(0);
}
I would much appreciate any suggestions how to debug this.
From the suggestions at the community help web page, here is more
config.log file, bzipped version, is attached.
ompi_info --all bzipped output is attached.
I am not sending information from other nodes or network config--for
test purposes, all processes are running on the one node, my laptop
with i7 processor. I set the "-mca btl_tcp_if_include lo" parameter
earlier when I got an error message about a refused connection
(that my code never asked for in the first place). This got rid
of that error message but application still fails and dumps.
Thanks,
George Reeke
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
George Reeke
2016-10-11 15:58:55 UTC
Permalink
George B. et al,
--Is it normal to top-post on this list? I am following your
example but other lists I am on prefer bottom-posting.
--I attach the complete code of the andmsg program, as it is
quite short (some bits removed for brevity and I have omitted
my headers and startup function aninit() as they are probably
irrelevant to the problem). The idea I had
was to have each node in the main program send a SHUTDOWN_ANDMSG
when it is ready to shut down and andmsg counts these and does not
begin its own shutdown until the number received matches the number
of nodes in the main program. Debugging shows that the number it
is counting is correct. It then sends a message back to the main
application so each node there waits to shut down until they are
all ready to shut down. I developed this protocol with tiny test
programs where just having everybody stop when finished led to
similar MPI console messages. In my initial posting I did not
show the code that counts these messages; that is why your matchup
seems wrong. Also, I have since added code to the main nodes to do
an IProbe before stopping and report any unread messages. There are
none.
--I cannot really post the main program, as it is about 40,000
lines of C code, recently updated for parallel processing with MPI.
When I have time I will try to make a short version for further testing.
Thanks,
George Reeke
Post by Gilles Gouaillardet
George,
There is too much information missing from your example. If I try to
run the code on the top assuming the process is is_host(NC.node), I
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid,
SHUTDOWN_ANDMSG, NC.commd);
MPI_Recv(&ival, 1, MPI_INT, NC.dmsgid, CLOSING_ANDMSG, NC.commd,
MPI_STATUS_IGNORE);
rc = MPI_Send(&ival, 1, MPI_INT, NC.dmsgid, SHUTDOWN_ANDMSG,
NC.commd); }
rc = MPI_Send(&num2stop, 1, MPI_INT, NC.hostid, CLOSING_ANDMSG, NC.commd);
rc = MPI_Recv(&sdmsg, 1, MPI_INT, NC.hostid, MPI_ANY_TAG, NC.commd,
MPI_STATUS_IGNORE);
So either there is a pending send (which is treated as an eager by
OMPI because it is of length 4 bytes), or there is something missing
on the code example. Can you post a more complete example ?
Thanks,
George.
Jeff Squyres (jsquyres)
2016-10-11 16:05:00 UTC
Permalink
Post by George Reeke
George B. et al,
--Is it normal to top-post on this list? I am following your
example but other lists I am on prefer bottom-posting.
Stylistic note: we do both on this list. Specifically: there's no religious hate if you top-post.
--
Jeff Squyres
***@cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
Loading...