mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-27 09:40:59 -06:00
fixed: do not send and recv from same buffer
even though it's perfectly fine to do so in this case, mpich will error out with an error if send and recv buffer is the same
This commit is contained in:
parent
63cbd2adce
commit
70c9e5345d
@ -86,15 +86,17 @@ void RSTConv::gatherAndAccumulate(const std::vector<int>& lIdx,
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<double> values(comm_.rank() == 0 ? comm_.size() * N_ : N_);
|
||||
std::vector<int> gIdx(comm_.rank() == 0 ? comm_.size() * N_ : N_);
|
||||
std::vector<double> send_values(N_);
|
||||
std::vector<double> values(comm_.rank() == 0 ? comm_.size() * N_ : 0);
|
||||
std::vector<int> send_idx(N_);
|
||||
std::vector<int> gIdx(comm_.rank() == 0 ? comm_.size() * N_ : 0);
|
||||
for (int i = 0; i < N_; ++i) {
|
||||
values[i] = std::abs(resid[lIdx[i]][compIdx_[comp]]);
|
||||
gIdx[i] = globalCell_[lIdx[i]];
|
||||
send_values[i] = std::abs(resid[lIdx[i]][compIdx_[comp]]);
|
||||
send_idx[i] = globalCell_[lIdx[i]];
|
||||
}
|
||||
|
||||
comm_.gather(gIdx.data(), gIdx.data(), N_, 0);
|
||||
comm_.gather(values.data(), values.data(), N_, 0);
|
||||
comm_.gather(send_idx.data(), gIdx.data(), N_, 0);
|
||||
comm_.gather(send_values.data(), values.data(), N_, 0);
|
||||
if (comm_.rank() != 0) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user