[mpich-discuss] How to fix Invalid arguments during creation of MPI derived Datatypes
Dave Goodell
goodell at mcs.anl.gov
Tue Jan 24 12:46:55 CST 2012
This appears to have been answered sufficiently here: http://stackoverflow.com/questions/8985651/how-to-fix-invalid-arguments-during-creation-of-mpi-derived-datatypes
-Dave
On Jan 24, 2012, at 11:22 AM CST, Rajeev Thakur wrote:
> How are you filling the blockcounts and offsets arrays? Have you declared offsets as MPI_Aint * ?
>
>
> On Jan 24, 2012, at 4:29 AM, Gopal Rastogi wrote:
>
>> 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?
>> _______________________________________________
>> mpich-discuss mailing list mpich-discuss at mcs.anl.gov
>> To manage subscription options or unsubscribe:
>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
> _______________________________________________
> mpich-discuss mailing list mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
More information about the mpich-discuss
mailing list