2004-01-29 21:21:55 +03:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-29 21:21:55 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-04-20 03:46:16 +04:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "win/win.h"
|
2004-07-30 06:58:53 +04:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-29 21:21:55 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-29 21:21:55 +03:00
|
|
|
#pragma weak MPI_Win_set_errhandler = PMPI_Win_set_errhandler
|
|
|
|
#endif
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_PROFILING_DEFINES
|
2004-04-20 22:50:43 +04:00
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-07-30 06:58:53 +04:00
|
|
|
static const char FUNC_NAME[] = "MPI_Win_set_errhandler";
|
|
|
|
|
|
|
|
|
|
|
|
int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
|
|
|
|
{
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is not yet implemented */
|
|
|
|
|
|
|
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
2004-04-20 03:46:16 +04:00
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
if (NULL == win ||
|
|
|
|
MPI_WIN_NULL == win) {
|
2004-06-07 19:33:53 +04:00
|
|
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
2004-04-20 03:46:16 +04:00
|
|
|
"MPI_Win_set_errhandler");
|
|
|
|
} else if (NULL == errhandler ||
|
|
|
|
MPI_ERRHANDLER_NULL == errhandler ||
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_ERRHANDLER_TYPE_WIN != errhandler->eh_mpi_object_type) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG,
|
2004-04-20 03:46:16 +04:00
|
|
|
"MPI_Win_set_errhandler");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Ditch the old errhandler, and decrement its refcount */
|
|
|
|
|
|
|
|
OBJ_RELEASE(win->error_handler);
|
|
|
|
|
|
|
|
/* We have a valid comm and errhandler, so increment its refcount */
|
|
|
|
|
|
|
|
win->error_handler = errhandler;
|
|
|
|
OBJ_RETAIN(win->error_handler);
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2004-01-29 21:21:55 +03:00
|
|
|
}
|