Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/mergemesh_pmmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,22 @@ int PMMG_gather_parmesh( PMMG_pParMesh parmesh,

/* Gather the packed parmeshes */
ier = MG_MIN ( ier, ier_pack );
MPI_CHECK( MPI_Gatherv ( ptr,pack_size,MPI_CHAR,

// Remplacer MPI_Gatherv par une boucle Send/Recv
if (parmesh->myrank == root) {
for (int i = 0; i < nprocs; ++i) {
if (i != root) {
MPI_CHECK(MPI_Recv(rcv_buffer + displs[i], rcv_pack_size[i], MPI_CHAR, i, 0, parmesh->comm, MPI_STATUS_IGNORE), ier = 0);
}
}
} else {
MPI_CHECK(MPI_Send(ptr, pack_size, MPI_CHAR, root, 0, parmesh->comm), ier = 0);
}
/*MPI_CHECK( MPI_Gatherv ( ptr,pack_size,MPI_CHAR,
rcv_buffer,rcv_pack_size,
displs,MPI_CHAR,root,parmesh->comm ),ier=0 );

displs,MPI_CHAR,root,parmesh->comm ),ier=0 );*/


PMMG_DEL_MEM(parmesh,ptr,char,"buffer to send");

/** 4: Unpack parmeshes */
Expand Down