Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Is Datatype extent for INTEGER4 set incorrectly for files in OpenMPI 1.3?
From: Manuel Holtgrewe (holtgrewe_at_[hidden])
Date: 2009-03-11 06:00:41


Hi

I think that the datatype extent for INTEGER4 is set incorrectly for files.

Attached is a small program that shows the problem. The juicy bits:

  MPI_Aint extent;
  MPI_Type_extent(MPI_INTEGER, &extent);
  printf("MPI_Type_extent(MPI_INTEGER) == %d\n", extent);
  MPI_Type_extent(MPI_INTEGER4, &extent);
  printf("MPI_Type_extent(MPI_INTEGER4) == %d\n", extent);
// ...
  printf("f.Get_type_extent(MPI::INTEGER) == %d\n",
         f.Get_type_extent(MPI::INTEGER));
  printf("f.Get_type_extent(MPI::INTEGER4) == %d\n",
         f.Get_type_extent(MPI::INTEGER4));

The result is:

MPI_Type_extent(MPI_INTEGER) == 4
MPI_Type_extent(MPI_INTEGER4) == 4
f.Get_type_extent(MPI::INTEGER) == 4
f.Get_type_extent(MPI::INTEGER4) == 2

The program creates two files. This is the output when writing INTEGER values:

$ hexdump -C test.integer.dat
00000000 44 00 00 00 41 00 00 00 41 00 00 00 01 00 00 00 |D...A...A.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

And this is the output when writing INTEGER4 values:

$ hexdump -C test.integer4.dat
00000000 44 00 00 00 41 00 01 00 00 00 00 00 00 00 00 00 |D...A...........|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

Bests,
-- Manuel