You have to pass it an allocated datatype, and it tells you if the pointer object is a valid MPI datatype for communications (aka it has a corresponding type with a well defined size, extent and alignment).
There is no construct in C able to tell you if a random number if a valid C "object". George. On Thu, Jun 1, 2017 at 5:42 PM, Dahai Guo <dahai....@gmail.com> wrote: > Hi, > > if I insert following lines somewhere openmpi, such > as ompi/mpi/c/iscatter.c > > printf(" --- in MPI_Iscatter\n"); > //MPI_Datatype dt00 = (MPI_Datatype) MPI_INT; > *MPI_Datatype dt00 = (MPI_Datatype) -1;* > if(*!ompi_datatype_is_valid(dt00)* ) { > printf(" --- dt00 is NOT valid \n"); > } > > The attached test code will give the errors: > > *** Process received signal *** > Signal: Segmentation fault (11) > Signal code: Address not mapped (1) > Failing at address: 0xf > [ 0] [0x3fff9d480478] > ... > > Is it a bug in the function *ompi_datatype_is_valid(..) *? or I miss > something? > > Dahai > > _______________________________________________ > devel mailing list > devel@lists.open-mpi.org > https://rfd.newmexicoconsortium.org/mailman/listinfo/devel >
_______________________________________________ devel mailing list devel@lists.open-mpi.org https://rfd.newmexicoconsortium.org/mailman/listinfo/devel