From 820065c681031dc0a0f1396e8d80369f57996d1f Mon Sep 17 00:00:00 2001 From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be> Date: Fri, 15 Jan 2010 12:41:32 +0000 Subject: [PATCH] dg : ouppssss, build again without mpi --- Solver/dgDofContainer.cpp | 6 ++++++ Solver/dgGroupOfElements.cpp | 6 ++++++ Solver/dgSystemOfEquations.cpp | 5 ++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Solver/dgDofContainer.cpp b/Solver/dgDofContainer.cpp index 9d20e7ba14..4464e03d37 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 16c6ac338b..86b641e776 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 405537ccc1..d369c32f9b 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 } -- GitLab