Bug 1087 - Call MPI_Finalize to exit MPI environment
Call MPI_Finalize to exit MPI environment
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mpi
pre-release
All All
: P5 minor
Assigned To: John Abraham
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-30 12:53 UTC by John Abraham
Modified: 2011-05-14 13:17 UTC (History)
2 users (show)

See Also:


Attachments
patch (2.61 KB, patch)
2011-04-30 13:42 UTC, John Abraham
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Abraham 2011-03-30 12:53:10 UTC
We could have a static function
void
MpiInterface::Disable()
{
  int flag = 0 ;
  MPI_Initialized(&flag);
  if(flag)
  {
      MPI_Finalize();
  }
}

to be called by the code that invokes MpiInterface::Enable(...)
so that we terminate the MPI execution environment correctly. Without proper termination we would get messages like below from openmpi
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 12720 on
node ubuntu exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
Comment 1 John Abraham 2011-04-30 13:42:31 UTC
Created attachment 1101 [details]
patch

Running MPI examples yielded identical results
Comment 2 Josh Pelkey 2011-05-14 13:17:43 UTC
I just ran tests with this applied on ferrari. I got similar results to https://www.nsnam.org/bugzilla/attachment.cgi?id=1099

Closing bug. Changeset 90a20d9a0fee

Thanks John.