mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +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)
|
||||
: comm(_comm), valid_comm(true)
|
||||
{
|
||||
int flag;
|
||||
MPI_Initialized (&flag);
|
||||
if (!flag)
|
||||
{
|
||||
valid_comm = false;
|
||||
refcount = nullptr;
|
||||
rank = 0;
|
||||
size = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!owns)
|
||||
refcount = nullptr;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user