Skip to content
Snippets Groups Projects
Commit 820065c6 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

dg : ouppssss, build again without mpi

parent 0c448941
Branches
Tags
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "dgGroupOfElements.h" #include "dgGroupOfElements.h"
#ifdef HAVE_MPI #ifdef HAVE_MPI
#include "mpi.h" #include "mpi.h"
#else
#include "string.h"
#endif #endif
dgDofContainer::dgDofContainer (dgGroupCollection &groups, int nbFields): dgDofContainer::dgDofContainer (dgGroupCollection &groups, int nbFields):
_groups(groups) _groups(groups)
...@@ -129,7 +131,11 @@ void dgDofContainer::scatter() { ...@@ -129,7 +131,11 @@ void dgDofContainer::scatter() {
} }
} }
//2) send //2) send
#ifdef HAVE_MPI
MPI_Alltoallv(sendBuf,countSend,shiftSend,MPI_DOUBLE,recvBuf,countRecv,shiftRecv,MPI_DOUBLE,MPI_COMM_WORLD); 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 //3) distribute
for(int i=0; i< _groups.getNbGhostGroups();i++) { for(int i=0; i< _groups.getNbGhostGroups();i++) {
fullMatrix<double> &sol = getGroupProxy(i+_groups.getNbElementGroups()); fullMatrix<double> &sol = getGroupProxy(i+_groups.getNbElementGroups());
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "GModel.h" #include "GModel.h"
#ifdef HAVE_MPI #ifdef HAVE_MPI
#include "mpi.h" #include "mpi.h"
#else
#include <string.h>
#endif #endif
static fullMatrix<double> * dgGetIntegrationRule (MElement *e, int p){ static fullMatrix<double> * dgGetIntegrationRule (MElement *e, int p){
...@@ -792,7 +794,11 @@ void dgGroupCollection::buildGroups(GModel *model, int dim, int order) ...@@ -792,7 +794,11 @@ void dgGroupCollection::buildGroups(GModel *model, int dim, int order)
idSend[curShiftSend[part]++] = group->getElement(j)->getNum(); 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); 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 //create a Map elementNum :: group, position in group
std::map<int, std::pair<int,int> > elementMap; std::map<int, std::pair<int,int> > elementMap;
for(size_t i = 0; i< getNbElementGroups(); i++) { for(size_t i = 0; i< getNbElementGroups(); i++) {
......
...@@ -119,11 +119,10 @@ double dgSystemOfEquations::computeInvSpectralRadius(){ ...@@ -119,11 +119,10 @@ double dgSystemOfEquations::computeInvSpectralRadius(){
} }
#ifdef HAVE_MPI #ifdef HAVE_MPI
double sr_min; double sr_min;
MPI_Allreduce((void *)&sr, &sr_min, 1, MPI_DOUBLE, MPI_MIN, MPI_Allreduce((void *)&sr, &sr_min, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
MPI_COMM_WORLD);
return sr_min; return sr_min;
#else #else
return sr return sr;
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment