+MPI_Errhandler Comm::errhandler()
+{
+ if (this != MPI_COMM_WORLD){
+ if (errhandler_ != MPI_ERRHANDLER_NULL)
+ errhandler_->ref();
+ return errhandler_;
+ } else {
+ if(errhandlers_==nullptr)
+ return MPI_ERRORS_ARE_FATAL;
+ else {
+ if(errhandlers_[this->rank()] != MPI_ERRHANDLER_NULL)
+ errhandlers_[this->rank()]->ref();
+ return errhandlers_[this->rank()];
+ }
+ }
+}
+
+void Comm::set_errhandler(MPI_Errhandler errhandler)
+{
+ if(this != MPI_COMM_WORLD){
+ if (errhandler_ != MPI_ERRHANDLER_NULL)
+ simgrid::smpi::Errhandler::unref(errhandler_);
+ errhandler_ = errhandler;
+ }else{
+ if(errhandlers_==nullptr)
+ errhandlers_= new MPI_Errhandler[this->size()]{MPI_ERRHANDLER_NULL};
+ if(errhandlers_[this->rank()] != MPI_ERRHANDLER_NULL)
+ simgrid::smpi::Errhandler::unref(errhandlers_[this->rank()]);
+ errhandlers_[this->rank()]=errhandler;
+ }
+ if (errhandler != MPI_ERRHANDLER_NULL)
+ errhandler->ref();
+}
+
+MPI_Comm Comm::split_type(int type, int /*key*/, const Info*)