Skip to content

Commit bdaf073

Browse files
committed
communicator cannot be changed once initialized. So MPI scope of Vector never changes.
1 parent 1ceb57b commit bdaf073

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/linalg/Vector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ Vector&
114114
Vector::operator = (
115115
const Vector& rhs)
116116
{
117+
CAROM_VERIFY(d_comm == rhs.getComm());
117118
d_distributed = rhs.d_distributed;
118119
d_num_procs = rhs.d_num_procs;
119-
d_comm = rhs.getComm();
120120
setSize(rhs.d_dim);
121121
memcpy(d_vec, rhs.d_vec, d_dim*sizeof(double));
122122
return *this;

lib/linalg/Vector.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Vector
3232
public:
3333
/**
3434
* @brief Constructor creating a Vector with uninitialized values and size.
35-
*
35+
*
3636
* @param[in] comm MPI communicator of the processors that own this Vector.
3737
*/
3838
Vector(MPI_Comm comm = MPI_COMM_WORLD);
@@ -817,8 +817,9 @@ class Vector
817817

818818
/**
819819
* @brief MPI communicator of the processors that own this Vector.
820+
* Cannot change once initialized.
820821
*/
821-
MPI_Comm d_comm;
822+
const MPI_Comm d_comm;
822823
};
823824

824825
/**

0 commit comments

Comments
 (0)