Hello,

    I have a small test case where a file created with MPI_File_open
is still open at the time MPI_Finalize is called.  In the actual
program there are lots of open files and it would be nice to avoid the
resulting "Your MPI job will now abort." by either having MPI_Finalize
close the files or honor the error handler and return an error code
without an abort.

  I've tried with with OpenMPI 1.4.3 and 1.5 with the same results.
Attached are the configure, compile and source files and the whole
program follows.

Any help would be appreciated,
Dr. James Overfelt
Sandia National Laboratories




#include <iostream>
#include "mpi.h"
using namespace std;
int main (int argc, char *argv[])
{
  MPI_Init(&argc, &argv);
  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
  MPI_Info         info ;
  MPI_Info_create(&info);
  MPI_File            fh;
  if (const int stat = MPI_File_open
    (MPI_COMM_SELF, "File_Test.txt", MPI_MODE_WRONLY |
MPI_MODE_CREATE, info, &fh))
    cerr<< "Error in MPI_File_open"<< stat<<endl;
  MPI_Finalize();
}

When run on a single processor the output is:

*** The MPI_Barrier() function was called after MPI_FINALIZE was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.
[r438767.sandia.gov:2767] Abort after MPI_FINALIZE completed
successfully; not able to guarantee that all other processes were
killed!

Attachment: ompi-output.tar.bz2
Description: BZip2 compressed data

Reply via email to