1 /* Copyright (c) 2010-2021. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SMPI_ERRHANDLER_HPP_INCLUDED
8 #define SMPI_ERRHANDLER_HPP_INCLUDED
9 #include "smpi_f2c.hpp"
10 #include <smpi/smpi.h>
16 class Errhandler: public F2C {
19 MPI_Comm_errhandler_fn* comm_func_=nullptr;
20 MPI_File_errhandler_fn* file_func_=nullptr;
21 MPI_Win_errhandler_fn* win_func_=nullptr;
23 Errhandler() = default;
24 explicit Errhandler(MPI_Comm_errhandler_fn *function):comm_func_(function){};
25 explicit Errhandler(MPI_File_errhandler_fn *function):file_func_(function){};
26 explicit Errhandler(MPI_Win_errhandler_fn *function):win_func_(function){};
28 std::string name() const {return "MPI_Errhandler";}
29 void call(MPI_Comm comm, int errorcode) const;
30 void call(MPI_Win win, int errorcode) const;
31 void call(MPI_File file, int errorcode) const;
32 static void unref(Errhandler* errhandler);
33 static Errhandler* f2c(int id);