Как создать новый тип в MPI
Я новичок в MPI и хочу создать новый тип данных дляResidence
struct
, Я просто хочу посмотреть, смогу ли я создать новый тип правильно. структура резиденция {двойной х; двойной у; };
Мой новый тип MPI
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);
}