From 8ef8c2e9751edc2b179ba2f86c42c28ecf2a3d42 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 3 Sep 2012 09:49:18 +0000 Subject: [PATCH] improved exchangetable --- libsrc/general/mpi_interface.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libsrc/general/mpi_interface.hpp b/libsrc/general/mpi_interface.hpp index b3983519..a78794b1 100644 --- a/libsrc/general/mpi_interface.hpp +++ b/libsrc/general/mpi_interface.hpp @@ -185,6 +185,7 @@ namespace netgen send a table entry to each of the prcesses in the group ... receive-table entries will be set */ + /* template inline void MyMPI_ExchangeTable (TABLE & send_data, @@ -206,7 +207,7 @@ namespace netgen MPI_Probe (MPI_ANY_SOURCE, tag, comm, &status); int size, src = status.MPI_SOURCE; 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)); } MPI_Barrier (comm); @@ -230,13 +231,14 @@ namespace netgen MPI_Alltoall (&send_sizes[0], 1, MPI_INT, &recv_sizes[0], 1, MPI_INT, comm); - /* + // in-place is buggy ! - MPI_Alltoall (MPI_IN_PLACE, 1, MPI_INT, - &recv_sizes[0], 1, MPI_INT, comm); - */ +// MPI_Alltoall (MPI_IN_PLACE, 1, MPI_INT, +// &recv_sizes[0], 1, MPI_INT, comm); + + 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 requests; for (int dest = 0; dest < ntasks; dest++)