Skip to content
Snippets Groups Projects
Commit 893750fc authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix compile without mpi

parent 58716f17
Branches
Tags
No related merge requests found
......@@ -34,8 +34,7 @@ static void computeAndSendVertexArrays(GmshClient *client, bool compute=true)
#if defined(HAVE_POST)
for(unsigned int i = 0; i < PView::list.size(); i++){
PView *p = PView::list[i];
if (compute)
p->fillVertexArrays();
if(compute) p->fillVertexArrays();
PViewData *data = p->getData();
PViewOptions *opt = p->getOptions();
double min = data->getMin(), max = data->getMax();
......@@ -133,7 +132,9 @@ static void addToVertexArrays(int length, const char* bytes, int swap)
delete toAdd;
}
static void gatherAndSendVertexArrays(GmshClient* client, bool swap) {
static void gatherAndSendVertexArrays(GmshClient* client, bool swap)
{
#if defined(HAVE_POST) && defined(HAVE_MPI)
int rank = Msg::GetCommRank();
int nbDaemon = Msg::GetCommSize();
// tell every node to start computing
......@@ -163,9 +164,9 @@ static void gatherAndSendVertexArrays(GmshClient* client, bool swap) {
}
}
computeAndSendVertexArrays(client, false);
#endif
}
int GmshRemote()
{
GmshClient *client = Msg::GetClient();
......@@ -175,8 +176,10 @@ int GmshRemote()
if(!client && rank == 0) return 0;
if(client && nbDaemon < 2) computeAndSendVertexArrays(client);
else if(client && nbDaemon >= 2 && rank == 0) gatherAndSendVertexArrays(client,false);
if(client && nbDaemon < 2)
computeAndSendVertexArrays(client);
else if(client && nbDaemon >= 2 && rank == 0)
gatherAndSendVertexArrays(client, false);
while(1){
......@@ -212,7 +215,6 @@ int GmshRemote()
}
else if(type == GmshSocket::GMSH_VERTEX_ARRAY){
ParseString(msg);
#if !defined(HAVE_MPI)
computeAndSendVertexArrays(client);
#else
......@@ -220,7 +222,6 @@ int GmshRemote()
MPI_Bcast(&mpi_msg, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast(&length, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast(msg, length, MPI_CHAR, 0, MPI_COMM_WORLD);
gatherAndSendVertexArrays(client, swap);
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment