Commit 4727d0a1 authored by cz7's avatar cz7

Darshan Wrapper fixes for Spectrum/OpenMPI 2

parent 2d14002d
......@@ -28,6 +28,20 @@
#define DARSHAN_DECL(__func) __func
#define DARSHAN_MPI_DECL(__func) __wrap_ ## __func
#define DARSHAN_MPI_MAP(__func,__ret,__args,__fcall) \
__ret __func __args { \
__ret i; \
i = __wrap_ ## __fcall; \
return i; \
} \
__ret P ## __func __args { \
__ret i; \
i = __wrap_ ## __fcall; \
return i; \
}
#define DARSHAN_MPI_CALL(__func) __real_ ## __func
#define MAP_OR_FAIL(__func) \
......@@ -47,6 +61,10 @@
#define DARSHAN_DECL(__name) __wrap_ ## __name
#define DARSHAN_MPI_DECL(__func) __func
#define DARSHAN_MPI_MAP(__func,__ret,__args,__fcall)
#define DARSHAN_MPI_CALL(__func) __func
#define MAP_OR_FAIL(__func)
......@@ -182,4 +200,5 @@ int darshan_core_excluded_path(
*/
int darshan_core_disabled_instrumentation(void);
#endif /* __DARSHAN_H */
......@@ -205,10 +205,9 @@ void resolve_mpi_symbols (void)
#endif
int MPI_Init(int *argc, char ***argv)
int DARSHAN_MPI_DECL(MPI_Init)(int *argc, char ***argv)
{
int ret;
#ifdef DARSHAN_PRELOAD
resolve_mpi_symbols();
#endif
......@@ -232,6 +231,8 @@ int MPI_Init(int *argc, char ***argv)
return(ret);
}
DARSHAN_MPI_MAP(MPI_Init, int, (int *argc, char ***argv), MPI_Init(argc,argv))
int MPI_Init_thread(int *argc, char ***argv, int required, int *provided)
{
int ret;
......@@ -259,7 +260,7 @@ int MPI_Init_thread(int *argc, char ***argv, int required, int *provided)
return(ret);
}
int MPI_Finalize(void)
int DARSHAN_MPI_DECL(MPI_Finalize)(void)
{
int ret;
......@@ -268,6 +269,7 @@ int MPI_Finalize(void)
ret = DARSHAN_MPI_CALL(PMPI_Finalize)();
return(ret);
}
DARSHAN_MPI_MAP(MPI_Finalize, int, (void), MPI_Finalize())
/*
* Local variables:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment