mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
improved exchangetable
This commit is contained in:
parent
7233ecdcd5
commit
8ef8c2e975
@ -185,6 +185,7 @@ namespace netgen
|
|||||||
send a table entry to each of the prcesses in the group ...
|
send a table entry to each of the prcesses in the group ...
|
||||||
receive-table entries will be set
|
receive-table entries will be set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void MyMPI_ExchangeTable (TABLE<T> & send_data,
|
inline void MyMPI_ExchangeTable (TABLE<T> & send_data,
|
||||||
@ -206,7 +207,7 @@ namespace netgen
|
|||||||
MPI_Probe (MPI_ANY_SOURCE, tag, comm, &status);
|
MPI_Probe (MPI_ANY_SOURCE, tag, comm, &status);
|
||||||
int size, src = status.MPI_SOURCE;
|
int size, src = status.MPI_SOURCE;
|
||||||
MPI_Get_count (&status, MPI_INT, &size);
|
MPI_Get_count (&status, MPI_INT, &size);
|
||||||
recv_data.SetEntrySize (src, size, sizeof(int));
|
recv_data.SetEntrySize (src, size, sizeof(T));
|
||||||
requests.Append (MyMPI_IRecv (recv_data[src], src, tag, comm));
|
requests.Append (MyMPI_IRecv (recv_data[src], src, tag, comm));
|
||||||
}
|
}
|
||||||
MPI_Barrier (comm);
|
MPI_Barrier (comm);
|
||||||
@ -230,13 +231,14 @@ namespace netgen
|
|||||||
|
|
||||||
MPI_Alltoall (&send_sizes[0], 1, MPI_INT,
|
MPI_Alltoall (&send_sizes[0], 1, MPI_INT,
|
||||||
&recv_sizes[0], 1, MPI_INT, comm);
|
&recv_sizes[0], 1, MPI_INT, comm);
|
||||||
/*
|
|
||||||
// in-place is buggy !
|
// in-place is buggy !
|
||||||
MPI_Alltoall (MPI_IN_PLACE, 1, MPI_INT,
|
// MPI_Alltoall (MPI_IN_PLACE, 1, MPI_INT,
|
||||||
&recv_sizes[0], 1, MPI_INT, comm);
|
// &recv_sizes[0], 1, MPI_INT, comm);
|
||||||
*/
|
|
||||||
|
|
||||||
for (int i = 0; i < ntasks; i++)
|
for (int i = 0; i < ntasks; i++)
|
||||||
recv_data.SetEntrySize (i, recv_sizes[i], sizeof(int));
|
recv_data.SetEntrySize (i, recv_sizes[i], sizeof(T));
|
||||||
|
|
||||||
Array<MPI_Request> requests;
|
Array<MPI_Request> requests;
|
||||||
for (int dest = 0; dest < ntasks; dest++)
|
for (int dest = 0; dest < ntasks; dest++)
|
||||||
|
Loading…
Reference in New Issue
Block a user