2004-01-21 00:05:46 +00:00
|
|
|
/*
|
2004-10-15 19:31:47 +00:00
|
|
|
* $HEADER$
|
2004-01-21 00:05:46 +00:00
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-21 00:05:46 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-03-19 17:29:39 +00:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-21 00:05:46 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-21 00:05:46 +00:00
|
|
|
#pragma weak MPI_Comm_get_errhandler = PMPI_Comm_get_errhandler
|
|
|
|
#endif
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_PROFILING_DEFINES
|
2004-04-20 18:50:43 +00:00
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
|
2004-07-30 02:58:53 +00:00
|
|
|
static const char FUNC_NAME[] = "MPI_Comm_get_errhandler";
|
|
|
|
|
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
|
|
|
|
{
|
|
|
|
/* Error checking */
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
2004-07-30 02:58:53 +00:00
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
2004-03-19 17:29:39 +00:00
|
|
|
if (NULL == comm ||
|
|
|
|
MPI_COMM_NULL == comm) {
|
2004-06-07 15:33:53 +00:00
|
|
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
2004-07-30 02:58:53 +00:00
|
|
|
FUNC_NAME);
|
2004-03-19 17:29:39 +00:00
|
|
|
} else if (NULL == errhandler) {
|
2004-06-07 15:33:53 +00:00
|
|
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
2004-07-30 02:58:53 +00:00
|
|
|
FUNC_NAME);
|
2004-03-19 17:29:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-27 03:13:54 +00:00
|
|
|
/* Return the errhandler. Do not increase the refcount here; we
|
|
|
|
only refcount on communicators */
|
2004-03-19 17:29:39 +00:00
|
|
|
|
|
|
|
*errhandler = comm->error_handler;
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2004-01-21 00:05:46 +00:00
|
|
|
}
|