mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
check if mpi is initialized
This commit is contained in:
parent
2763285b46
commit
8b5675a8e2
@ -67,6 +67,17 @@ namespace ngcore
|
|||||||
NgMPI_Comm (MPI_Comm _comm, bool owns = false)
|
NgMPI_Comm (MPI_Comm _comm, bool owns = false)
|
||||||
: comm(_comm), valid_comm(true)
|
: comm(_comm), valid_comm(true)
|
||||||
{
|
{
|
||||||
|
int flag;
|
||||||
|
MPI_Initialized (&flag);
|
||||||
|
if (!flag)
|
||||||
|
{
|
||||||
|
valid_comm = false;
|
||||||
|
refcount = nullptr;
|
||||||
|
rank = 0;
|
||||||
|
size = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!owns)
|
if (!owns)
|
||||||
refcount = nullptr;
|
refcount = nullptr;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user