+unsigned int Comm::get_collectives_count()
+{
+ 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(collectives_counts_==nullptr)
+ collectives_counts_=new unsigned int[this->size()]{0};
+ return collectives_counts_[this->rank()];
+ }else{
+ return collectives_count_;
+ }
+}
+
+void Comm::increment_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(collectives_counts_==nullptr)
+ collectives_counts_=new unsigned int[this->size()]{0};
+ collectives_counts_[this->rank()]++;
+ }else{
+ collectives_count_++;
+ }
+}
+