From c274126487ade4e872780c03aa1f90d9e19329b2 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 12 Feb 2019 15:01:34 +0100 Subject: [PATCH] Don't allow MPI-parallel GUI --- libsrc/meshing/meshclass.hpp | 2 +- libsrc/visualization/visual.hpp | 6 +++--- ng/ngappinit.cpp | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 0f88ddcd..2aea32fe 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -33,7 +33,7 @@ namespace netgen T_POINTS points; // The communicator for this mesh. Just a dummy if compiled without MPI. - NgMPI_Comm comm = MPI_COMM_NULL; + NgMPI_Comm comm; /// line-segments at edges Array segments; diff --git a/libsrc/visualization/visual.hpp b/libsrc/visualization/visual.hpp index 6db3fa18..493cb739 100644 --- a/libsrc/visualization/visual.hpp +++ b/libsrc/visualization/visual.hpp @@ -13,9 +13,9 @@ Visualization */ -#ifdef PARALLEL -#define PARALLELGL -#endif +// #ifdef PARALLEL +// #define PARALLELGL +// #endif #include "../include/incopengl.hpp" diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index a83957a7..8c90d069 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -73,8 +73,12 @@ int main(int argc, char ** argv) MPI_Comm_size(MPI_COMM_WORLD, &netgen::ntasks); MPI_Comm_rank(MPI_COMM_WORLD, &netgen::id); + if(netgen::ntasks!=1) + throw ngcore::Exception("Netgen GUI cannot run MPI-parallel"); + + // MPI_COMM_WORLD is just a local communicator + netgen::ng_comm = ngcore::NgMPI_Comm{MPI_COMM_WORLD, false}; - MPI_Comm_dup ( MPI_COMM_WORLD, &netgen::mesh_comm); #endif if ( netgen::id == 0 )