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
No related branches found
No related tags found
No related merge requests found
......@@ -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());
......
......@@ -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++) {
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment