MPI_Comm_create_errhandler
int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *, MPI_Errhandler *);
Creates an error handler that can be attached to communicators.