[mpich-discuss] How to fix Invalid arguments during creation of MPI derived Datatypes

Gopal Rastogi gopalrastogi.mmmec at gmail.com
Tue Jan 24 04:29:03 CST 2012


    I have one `structure xyz` as given below and i need
to broadcast it among 20 nodes. so i used `MPI_Bcast()` function
to do this. This function requires MPI datatype of corresponding
structure xyz type as third arguments.
`struct xyz
{
 char a;
 int32_t b;
 char c[50];
 uint32_t d;
 uchar e[10];
}`

So i used `MPI_Type_creat_struct()` function to create a new MPI datatype
as `MPI_Datatype MPI_my_new_datatype, oldtypes[4];`
 where i used MPI datatypes corresponding to above structure members
datatype
as followings
 `oldtypes[4] = {MPI_CHAR, MPI_INT, MPI_UNSIGNED, MPI_UNSIGNED_CHAR};`

and to craete new datatype i used following arguments in the function..
    MPI_Type_create_struct(4, blockcounts, offsets, oldtypes,
&MPI_my_new_datatype);
    MPI_Type_commit(&MPI_my_new_datatype);
Now it is compiling but giving run time error as below::

*** An error occurred in `MPI_Type_create_struct`on
communicator `MPI_COMM_WORLD`
`MPI_ERR_ARG`: invalid argument of some other kind
`MPI_ERRORS_ARE_FATAL` (goodbye).

Can any one find out where is the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120124/0340c205/attachment-0001.htm>


More information about the mpich-discuss mailing list