[mpich-discuss] MPI_Type_struct error
Ichrak Mehrez
m_ichrak at hotmail.fr
Mon Mar 12 02:40:00 CDT 2012
Hi,
I have a problem with creating a new MPI datatype,
my old_type is a linked list:
struct ListeElt
{
long indice;
long val;
struct ListeElt *suiv;
};
typedef struct ListeElt LISTE_Elt:
I try to create a new datatype MPI_Liste:
MPI_Datatype MPI_Liste;
MPI_Datatype type[3] = {MPI_LONG,MPI_LONG,MPI_Liste};
int longueur_bloc[3]={1,1,1};
MPI_Aint disp[3];
LISTE_Elt L;
MPI_Address(&L.indice, disp);
MPI_Address(&L.val, disp+1);
MPI_Address(&L.suiv, disp+2);
int base = disp[0];
for (j=0; j <3; j++) disp[j] -= base;
MPI_Type_struct(3, longueur_bloc,disp, type,&MPI_Liste);
MPI_Type_commit(&MPI_Liste);
but i got the following error:
Fatal error in PMPI_Type_struct: Invalid datatype, error stack:
PMPI_Type_struct(210): MPI_Type_struct(count=3, blocklens=0x7fff830c6db0, indices=0x7fff830c6d40, old_types=0x7fff830c6da0, new_type_p=0x7fff830c6e40) failed
PMPI_Type_struct(177): Invalid datatype
Thank you for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120312/0bf55bdd/attachment.htm>
More information about the mpich-discuss
mailing list