mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-27 06:10:34 +05:00
copy assignment
This commit is contained in:
parent
cb635105e9
commit
ce75b69cd6
@ -79,6 +79,21 @@ namespace ngcore
|
|||||||
MPI_Comm_free(&comm);
|
MPI_Comm_free(&comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NgMPI_Comm & operator= (const NgMPI_Comm & c)
|
||||||
|
{
|
||||||
|
if (refcount)
|
||||||
|
if (--(*refcount) == 0)
|
||||||
|
MPI_Comm_free(&comm);
|
||||||
|
|
||||||
|
refcount = c.refcount;
|
||||||
|
if (refcount) (*refcount)++;
|
||||||
|
size = c.size;
|
||||||
|
rank = c.rank;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
operator MPI_Comm() const { return comm; }
|
operator MPI_Comm() const { return comm; }
|
||||||
|
|
||||||
int Rank() const { return rank; } // int r; MPI_Comm_rank(comm, &r); return r; }
|
int Rank() const { return rank; } // int r; MPI_Comm_rank(comm, &r); return r; }
|
||||||
|
Loading…
Reference in New Issue
Block a user