Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Type struct question
From: Thomas Anderson (t.dt.aanderson_at_[hidden])
Date: 2011-11-11 06:20:42

I read doc explaining struct at

I haven't used mpi so I have a newbie question.

In the example function MPI_Type_struct(3, {2, 1, 3}, {0, 16, 26},
{MPI_FLOAT, type1, MPI_CHAR} ) is executed where type1 is consisted of
{(double,0)(char,8)}. The user defined datatype has extent 16 with
displacement at 16. However, the third block starts from displacement
26. This seems to me the end of type1 (at 32) would overlap the
displacement of MPI_CHAR (at 26). How does MPI solve this issue? Do
they simply ignore the rest space because it is only char type in
type1? Or if the type1 is defined by {(double, 0) (double, 8)}, won't
the data in the second block be truncated?