Bug 1087

Summary: Call MPI_Finalize to exit MPI environment
Product: ns-3 Reporter: John Abraham <john.abraham.in>
Component: mpiAssignee: John Abraham <john.abraham.in>
Status: RESOLVED FIXED    
Severity: minor CC: jpelkey, ns-bugs
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: patch

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.