So erstellen Sie einen neuen Typ in MPI

Ich bin neu bei MPI und möchte einen neuen Datentyp für erstellenResidence struct. Ich möchte nur sehen, ob ich den neuen Typ richtig erstellen kann. struct Residence {double x; doppeltes y; };

Mein neuer MPI-Typ

MPI_Datatype createRecType()
{
    // Set-up the arguments for the type constructor
    MPI_Datatype new_type;

    int count = 2;
    int blocklens[] = { 1,1 };

    MPI_Aint indices[2];
    //indices[0]=0;
    MPI_Type_extent( MPI_DOUBLE, &indices[0] );
    MPI_Type_extent( MPI_DOUBLE, &indices[1] );

    MPI_Datatype old_types[] = {MPI_DOUBLE,MPI_DOUBLE};

    MPI_Type_struct(count,blocklens,indices,old_types,&new_type);
    MPI_Type_commit(&new_type);

}

Antworten auf die Frage(1)

Ihre Antwort auf die Frage