std::unordered_map<std::string, unsigned int> sent_messages_;
std::unordered_map<std::string, unsigned int> recv_messages_;
unsigned int collectives_count_ = 0;
- std::unique_ptr<unsigned int[]> collectives_counts_; // for MPI_COMM_WORLD only
+ std::vector<unsigned int> collectives_counts_; // for MPI_COMM_WORLD only
public:
static std::unordered_map<int, smpi_key_elem> keyvals_;
if (this==MPI_COMM_UNINITIALIZED){
return smpi_process()->comm_world()->get_collectives_count();
}else if(this == MPI_COMM_WORLD || this == smpi_process()->comm_world()){
- if (not collectives_counts_)
- collectives_counts_ = std::make_unique<unsigned int[]>(this->size());
+ if (collectives_counts_.empty())
+ collectives_counts_.resize(this->size());
return collectives_counts_[this->rank()];
}else{
return collectives_count_;
if (this==MPI_COMM_UNINITIALIZED){
smpi_process()->comm_world()->increment_collectives_count();
}else if (this == MPI_COMM_WORLD || this == smpi_process()->comm_world()){
- if (not collectives_counts_)
- collectives_counts_ = std::make_unique<unsigned int[]>(this->size());
+ if (collectives_counts_.empty())
+ collectives_counts_.resize(this->size());
collectives_counts_[this->rank()]++;
}else{
collectives_count_++;