Skip to content

Commit

Permalink
Fixes dtarb#232. Replace MPI deprecated functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kandread committed Feb 24, 2022
1 parent 98137bb commit e45d795
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/linklib.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ offsets[0] = 0;
oldtypes[o] = MPI_LONG;
blockcounts[0]= 2;
MPI_Type_extent(MPI_LONG, &extent);
MPI_Type_get_extent(MPI_LONG, &extent);
offsets[1] = 2 * extent;
oldtypes[1] = MPI_FLOAT;
blockcounts[1] = 1;
MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_create_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_comit(&PointType);
MPI_Send(coord,numCoords,PointType,dest,tag,MCW);
Expand Down Expand Up @@ -271,19 +271,19 @@ bool sendLink(int32_t Id, int dest){
MPI_Datatype PointType, oldtypes[2];
int blockcounts[2];

MPI_Aint offsets[2], extent;
MPI_Aint offsets[2], extent, lb;
MPI_Status stat;
//set up first blocks of storage
offsets[0] = 0;
oldtypes[0] = MPI_LONG;
blockcounts[0]= 2;
//set up second block of storage
MPI_Type_extent(MPI_LONG, &extent);
MPI_Type_get_extent(MPI_LONG, &lb, &extent);
offsets[1] = 2 * extent;
oldtypes[1] = MPI_FLOAT;
blockcounts[1] = 3;
//create define it as an MPI data type and comit it.
MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_create_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_commit(&PointType);

MPI_Status status;
Expand Down Expand Up @@ -339,19 +339,19 @@ bool recvLink(int src){
MPI_Datatype PointType, oldtypes[2];
int blockcounts[2];

MPI_Aint offsets[2], extent;
MPI_Aint offsets[2], extent, lb;
MPI_Status stat1;
//set up first blocks of storage
offsets[0] = 0;
oldtypes[0] = MPI_LONG;
blockcounts[0]= 2;
//set up second block of storage
MPI_Type_extent(MPI_LONG, &extent);
MPI_Type_get_extent(MPI_LONG, &lb, &extent);
offsets[1] = 2 * extent;
oldtypes[1] = MPI_FLOAT;
blockcounts[1] = 3;
//create define it as an MPI data type and comit it.
MPI_Type_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_create_struct(2,blockcounts,offsets,oldtypes,&PointType);
MPI_Type_commit(&PointType);
int flag;
//MPI_Request req;
Expand Down

0 comments on commit e45d795

Please sign in to comment.