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 17:29:39 +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_set_errhandler = PMPI_Comm_set_errhandler
|
|
|
|
#endif
|
|
|
|
|
2004-04-20 18:50:43 +00:00
|
|
|
#if LAM_PROFILING_DEFINES
|
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-03-19 17:29:39 +00:00
|
|
|
|
|
|
|
int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
|
|
|
|
{
|
|
|
|
/* Error checking */
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
if (NULL == comm ||
|
|
|
|
MPI_COMM_NULL == comm) {
|
|
|
|
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
|
|
|
"MPI_Comm_set_errhandler");
|
|
|
|
} else if (NULL == errhandler ||
|
|
|
|
MPI_ERRHANDLER_NULL == errhandler ||
|
|
|
|
LAM_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type) {
|
|
|
|
return LAM_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
|
|
|
|
"MPI_Comm_set_errhandler");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-27 03:13:54 +00:00
|
|
|
/* Ditch the old errhandler, and decrement its refcount */
|
2004-03-27 02:22:02 +00:00
|
|
|
|
|
|
|
OBJ_RELEASE(comm->error_handler);
|
|
|
|
|
2004-03-27 03:13:54 +00:00
|
|
|
/* We have a valid comm and errhandler, so increment its refcount */
|
2004-03-19 17:29:39 +00:00
|
|
|
|
|
|
|
comm->error_handler = errhandler;
|
2004-03-27 02:22:02 +00:00
|
|
|
OBJ_RETAIN(comm->error_handler);
|
2004-03-19 18:01:03 +00:00
|
|
|
|
|
|
|
/* All done */
|
2004-03-19 17:29:39 +00:00
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2004-01-21 00:05:46 +00:00
|
|
|
}
|