1 /* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "smpi_errhandler.hpp"
11 simgrid::smpi::Errhandler mpi_MPI_ERRORS_RETURN;
12 MPI_Errhandler MPI_ERRORS_RETURN=&mpi_MPI_ERRORS_RETURN;
13 simgrid::smpi::Errhandler mpi_MPI_ERRORS_ARE_FATAL;
14 MPI_Errhandler MPI_ERRORS_ARE_FATAL=&mpi_MPI_ERRORS_ARE_FATAL;
19 MPI_Errhandler Errhandler::f2c(int id) {
20 if(F2C::f2c_lookup() != nullptr && id >= 0) {
22 return static_cast<MPI_Errhandler>(F2C::f2c_lookup()->at(get_key(key, id)));
24 return MPI_ERRHANDLER_NULL;
28 void Errhandler::call(MPI_Comm comm, int errorcode) const
30 comm_func_(&comm, &errorcode);
33 void Errhandler::call(MPI_Win win, int errorcode) const
35 win_func_(&win, &errorcode);
38 void Errhandler::call(MPI_File file, int errorcode) const
40 file_func_(&file, &errorcode);
43 void Errhandler::ref()
48 void Errhandler::unref(Errhandler* errhandler){
49 errhandler->refcount_--;
50 if(errhandler->refcount_==0){