2004-01-21 00:05:46 +00:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
|
|
|
#include "lam_config.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-03-19 06:12:43 +00:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-21 00:05:46 +00:00
|
|
|
|
|
|
|
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
|
|
|
|
#pragma weak MPI_Comm_create_errhandler = PMPI_Comm_create_errhandler
|
|
|
|
#endif
|
|
|
|
|
2004-03-19 06:12:43 +00:00
|
|
|
|
2004-01-21 00:05:46 +00:00
|
|
|
int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function,
|
2004-03-19 06:12:43 +00:00
|
|
|
MPI_Errhandler *errhandler)
|
|
|
|
{
|
2004-03-19 17:29:39 +00:00
|
|
|
int err = MPI_SUCCESS;
|
|
|
|
|
2004-03-19 06:12:43 +00:00
|
|
|
/* Error checking */
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
if (NULL == function ||
|
|
|
|
NULL == errhandler) {
|
2004-03-19 17:29:39 +00:00
|
|
|
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
|
|
|
"MPI_Comm_create_errhandler");
|
2004-03-19 06:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
/* Create and cache the errhandler */
|
2004-03-19 06:12:43 +00:00
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
*errhandler =
|
|
|
|
lam_errhandler_create(LAM_ERRHANDLER_TYPE_COMM,
|
|
|
|
(lam_errhandler_fortran_handler_fn_t*) function);
|
|
|
|
if (NULL == *errhandler)
|
|
|
|
err = MPI_ERR_INTERN;
|
2004-03-19 06:12:43 +00:00
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
LAM_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN,
|
|
|
|
"MPI_Comm_create_errhandler");
|
2004-01-21 00:05:46 +00:00
|
|
|
}
|