mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 02:25:42 +00:00
diy: Add support for MPI_COMM_NULL.
This commit is contained in:
parent
6a4edd87f7
commit
42d5be319b
@ -9,7 +9,7 @@ namespace mpi
|
||||
{
|
||||
public:
|
||||
communicator(MPI_Comm comm = MPI_COMM_WORLD):
|
||||
comm_(comm) { MPI_Comm_rank(comm_, &rank_); MPI_Comm_size(comm_, &size_); }
|
||||
comm_(comm), rank_(0), size_(1) { if (comm != MPI_COMM_NULL) { MPI_Comm_rank(comm_, &rank_); MPI_Comm_size(comm_, &size_); } }
|
||||
|
||||
int rank() const { return rank_; }
|
||||
int size() const { return size_; }
|
||||
|
Loading…
Reference in New Issue
Block a user