Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] MPI IO bug test case for OpenMPI 1.3
From: yvan.fournier_at_[hidden]
Date: 2009-07-09 06:17:36


Hello,

Some weeks ago, I reported a problem using MPI IO in OpenMPI 1.3,
which did not occur with OpenMPI 1.2 or MPICH2.

The bug was encountered with the Code_Saturne CFD tool (http://www.code-saturne.org),
and seemed to be an issue with individual file pointers, as another mode using
explicit offsets worked fine.

I have finally extracted the read pattern from the complete case, so as to
generate the simple test case attached. Further testing showed that the
bug could be reproduced easily using only part of the read pattern,
so I commented most of the patterns from the original case using #if 0 / #endif.

The test should be run with an MPI_COMM_WORLD size of 2. Initially,
rank 0 generates a simple binary file using Posix I/O and
containing the values 0, 1, 2, ... up to about 300000.

The file is then opened for reading using MPI IO, and as the values
expected at a given offset are easily determined, read values are compared
to expected values, and MPI_Abort is called in case of an error.

I also added a USE_FILE_TYPE macro definition, which can be undefined
to "turn off" the bug.

Basically, I have:

------------

#ifdef USE_FILE_TYPE
  MPI_Type_hindexed(1, lengths, disps, MPI_BYTE, &file_type);
  MPI_Type_commit(&file_type);
  MPI_File_set_view(fh, offset, MPI_BYTE, file_type, datarep, MPI_INFO_NULL);
#else
  MPI_File_set_view(fh, offset+disps[0], MPI_BYTE, MPI_BYTE, datarep, MPI_INFO_NULL);
#endif

retval = MPI_File_read_all(fh, buf, (int)(lengths[0]), MPI_BYTE, &status);

#if USE_FILE_TYPE
  MPI_Type_free(&file_type);
#endif

-------------

Using the file type indexed datatype, I exhibit the bug with both
versions 1.3.0 and 1.3.2 of OpenMPI.

Best regards,

  Yvan Fournier