Skip to content

Commit 7ec2a40

Browse files
committed
ompi/op: remove C++ function pointers
Remove some left-over infrastructure for handling callbacks into the MPI C++ bindings (which were removed long ago -- this code is now stale). Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 65d7846 commit 7ec2a40

File tree

2 files changed

+3
-58
lines changed

2 files changed

+3
-58
lines changed

ompi/op/op.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -383,22 +383,6 @@ ompi_op_t *ompi_op_create_user(bool commute,
383383
}
384384

385385

386-
/*
387-
* See lengthy comment in mpi/cxx/intercepts.cc for how the C++ MPI::Op
388-
* callbacks work.
389-
*/
390-
void ompi_op_set_cxx_callback(ompi_op_t *op, MPI_User_function *fn)
391-
{
392-
op->o_flags |= OMPI_OP_FLAGS_CXX_FUNC;
393-
/* The OMPI C++ intercept was previously stored in
394-
op->o_func.fort_fn by ompi_op_create_user(). So save that in
395-
cxx.intercept_fn and put the user's fn in cxx.user_fn. */
396-
op->o_func.cxx_data.intercept_fn =
397-
(ompi_op_cxx_handler_fn_t *) op->o_func.fort_fn;
398-
op->o_func.cxx_data.user_fn = fn;
399-
}
400-
401-
402386
/*
403387
* See lengthy comment in mpi/cxx/intercepts.cc for how the C++ MPI::Op
404388
* callbacks work.

ompi/op/op.h

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,9 @@ typedef void (ompi_op_c_handler_fn_t)(void *, void *, int *,
6767
typedef void (ompi_op_fortran_handler_fn_t)(void *, void *,
6868
MPI_Fint *, MPI_Fint *);
6969

70-
/**
71-
* Typedef for C++ op functions intercept (used for user-defined
72-
* MPI::Ops).
73-
*
74-
* See the lengthy explanation for why this is different than the C
75-
* intercept in ompi/mpi/cxx/intercepts.cc in the
76-
* ompi_mpi_cxx_op_intercept() function.
77-
*/
78-
typedef void (ompi_op_cxx_handler_fn_t)(void *, void *, int *,
79-
struct ompi_datatype_t **,
80-
MPI_User_function * op);
81-
8270
/**
8371
* Typedef for Java op functions intercept (used for user-defined
8472
* MPI.Ops).
85-
*
86-
* See the lengthy explanation for why this is different than the C
87-
* intercept in ompi/mpi/cxx/intercepts.cc in the
88-
* ompi_mpi_cxx_op_intercept() function.
8973
*/
9074
typedef void (ompi_op_java_handler_fn_t)(void *, void *, int *,
9175
struct ompi_datatype_t **,
@@ -99,8 +83,6 @@ typedef void (ompi_op_java_handler_fn_t)(void *, void *, int *,
9983
#define OMPI_OP_FLAGS_INTRINSIC 0x0001
10084
/** Set if the callback function is in Fortran */
10185
#define OMPI_OP_FLAGS_FORTRAN_FUNC 0x0002
102-
/** Set if the callback function is in C++ */
103-
#define OMPI_OP_FLAGS_CXX_FUNC 0x0004
10486
/** Set if the callback function is in Java */
10587
#define OMPI_OP_FLAGS_JAVA_FUNC 0x0008
10688
/** Set if the callback function is associative (MAX and SUM will both
@@ -171,15 +153,7 @@ struct ompi_op_t {
171153
ompi_op_c_handler_fn_t *c_fn;
172154
/** Fortran handler function pointer */
173155
ompi_op_fortran_handler_fn_t *fort_fn;
174-
/** C++ intercept function data -- see lengthy comment in
175-
ompi/mpi/cxx/intercepts.cc::ompi_mpi_cxx_op_intercept() for
176-
an explanation */
177-
struct {
178-
/* The user's function (it's the wrong type, but that's ok) */
179-
ompi_op_c_handler_fn_t *user_fn;
180-
/* The OMPI C++ callback/intercept function */
181-
ompi_op_cxx_handler_fn_t *intercept_fn;
182-
} cxx_data;
156+
/** Java intercept function data */
183157
struct {
184158
/* The OMPI C++ callback/intercept function */
185159
ompi_op_java_handler_fn_t *intercept_fn;
@@ -393,17 +367,8 @@ ompi_op_t *ompi_op_create_user(bool commute,
393367
ompi_op_fortran_handler_fn_t func);
394368

395369
/**
396-
* Mark an MPI_Op as holding a C++ callback function, and cache
397-
* that function in the MPI_Op. See a lenghty comment in
398-
* ompi/mpi/cxx/op.c::ompi_mpi_cxx_op_intercept() for a full
399-
* expalantion.
400-
*/
401-
OMPI_DECLSPEC void ompi_op_set_cxx_callback(ompi_op_t * op,
402-
MPI_User_function * fn);
403-
404-
/**
405-
* Similar to ompi_op_set_cxx_callback(), mark an MPI_Op as holding a
406-
* Java calback function, and cache that function in the MPI_Op.
370+
* Mark an MPI_Op as holding a Java calback function, and cache that
371+
* function in the MPI_Op.
407372
*/
408373
OMPI_DECLSPEC void ompi_op_set_java_callback(ompi_op_t *op, void *jnienv,
409374
void *object, int baseType);
@@ -594,10 +559,6 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
594559
f_count = OMPI_INT_2_FINT(count);
595560
op->o_func.fort_fn(source, target, &f_count, &f_dtype);
596561
return;
597-
} else if (0 != (op->o_flags & OMPI_OP_FLAGS_CXX_FUNC)) {
598-
op->o_func.cxx_data.intercept_fn(source, target, &count, &dtype,
599-
op->o_func.cxx_data.user_fn);
600-
return;
601562
} else if (0 != (op->o_flags & OMPI_OP_FLAGS_JAVA_FUNC)) {
602563
op->o_func.java_data.intercept_fn(source, target, &count, &dtype,
603564
op->o_func.java_data.baseType,

0 commit comments

Comments
 (0)