Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Problem with cascading derived data types
From: Markus Blatt (mblatt_at_[hidden])
Date: 2009-02-27 06:44:11


Hi,

In one of my applications I am using cascaded derived MPI datatypes
created with MPI_Type_struct. One of these types is used to just send
a part (one MPI_Char) of a struct consisting of an int followed by two
chars. I.e, the int at the beginning is/should be ignored.

This works fine if I use this data type on its own.

Unfortunately I need to send another struct that contains an int and
the int-char-char struct from above. Again I construct a custom MPI
data type for this.

When sending this cascaded data type It seems that the offset of the
char in the inner custom type is disregarded on the receiving end and
the
received data ('1') is stored in the first int instead of the
following char.

I have tested this code with both lam and mpich. There it worked as
expected (saving the '1' in the first char).

The last two lines of the output of the attached test case read

received global=10 attribute=0 (local=1 public=0)
received attribute=1 (local=100 public=0)

for openmi instead of

received global=10 attribute=1 (local=100 public=0)
received attribute=1 (local=100 public=0)

for lam and mpich.

The same problem is experienced when using version 1.3-2 of openmpi.

Am I doing something completely wrong or have I accidentally found a bug?

Cheers,

Markus