diff --git a/Solver/dgDofContainer.cpp b/Solver/dgDofContainer.cpp index 9d20e7ba149e8ead4436cdffbee0aa2dea230faa..4464e03d37d4e7f05e661a128d200ef69dc3fb6c 100644 --- a/Solver/dgDofContainer.cpp +++ b/Solver/dgDofContainer.cpp @@ -3,6 +3,8 @@ #include "dgGroupOfElements.h" #ifdef HAVE_MPI #include "mpi.h" +#else +#include "string.h" #endif dgDofContainer::dgDofContainer (dgGroupCollection &groups, int nbFields): _groups(groups) @@ -129,7 +131,11 @@ void dgDofContainer::scatter() { } } //2) send + #ifdef HAVE_MPI MPI_Alltoallv(sendBuf,countSend,shiftSend,MPI_DOUBLE,recvBuf,countRecv,shiftRecv,MPI_DOUBLE,MPI_COMM_WORLD); + #else + memcpy(recvBuf,sendBuf,countSend[0]*sizeof(double)); + #endif //3) distribute for(int i=0; i< _groups.getNbGhostGroups();i++) { fullMatrix<double> &sol = getGroupProxy(i+_groups.getNbElementGroups()); diff --git a/Solver/dgGroupOfElements.cpp b/Solver/dgGroupOfElements.cpp index 16c6ac338bfd2e0ec771229cd8e49f9a8dd43510..86b641e776d445082b9cbb78262c350e5c23bfa0 100644 --- a/Solver/dgGroupOfElements.cpp +++ b/Solver/dgGroupOfElements.cpp @@ -10,6 +10,8 @@ #include "GModel.h" #ifdef HAVE_MPI #include "mpi.h" +#else +#include <string.h> #endif static fullMatrix<double> * dgGetIntegrationRule (MElement *e, int p){ @@ -792,7 +794,11 @@ void dgGroupCollection::buildGroups(GModel *model, int dim, int order) idSend[curShiftSend[part]++] = group->getElement(j)->getNum(); } } + #ifdef HAVE_MPI MPI_Alltoallv(idSend,nGhostElements,shiftSend,MPI_INT,idRecv,nParentElements,shiftRecv,MPI_INT,MPI_COMM_WORLD); + #else + memcpy(idRecv,idSend,nParentElements[0]*sizeof(int)); + #endif //create a Map elementNum :: group, position in group std::map<int, std::pair<int,int> > elementMap; for(size_t i = 0; i< getNbElementGroups(); i++) { diff --git a/Solver/dgSystemOfEquations.cpp b/Solver/dgSystemOfEquations.cpp index 405537ccc18a011b8d24245b8926f78ef6728cb2..d369c32f9bb15b99b335a79d20d1fd7b34961d8f 100644 --- a/Solver/dgSystemOfEquations.cpp +++ b/Solver/dgSystemOfEquations.cpp @@ -119,11 +119,10 @@ double dgSystemOfEquations::computeInvSpectralRadius(){ } #ifdef HAVE_MPI double sr_min; - MPI_Allreduce((void *)&sr, &sr_min, 1, MPI_DOUBLE, MPI_MIN, - MPI_COMM_WORLD); + MPI_Allreduce((void *)&sr, &sr_min, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); return sr_min; #else - return sr + return sr; #endif }