Commit 42d5be31 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

diy: Add support for MPI_COMM_NULL.

parent 6a4edd87
......@@ -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_; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment