Skip to content

Commit

Permalink
Rework the MPI_Op support.
Browse files Browse the repository at this point in the history
Remove all ops with 3 buffers, we ended up not using them anywhere in
the code.
Change the loop order in the base MPI_Op to allow for more
optimizations, as discussed in open-mpi#9717.

Fixes open-mpi#9717.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
  • Loading branch information
bosilca committed Dec 2, 2021
1 parent f33221f commit f4b4c4f
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 1,520 deletions.
1 change: 0 additions & 1 deletion ompi/debuggers/predefined_gap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ int main(int argc, char **argv) {
GAP_CHECK("o_flags", test_op, o_flags, o_name, 1)
GAP_CHECK("o_f_to_c_index", test_op, o_f_to_c_index, o_flags, 1)
GAP_CHECK("o_func", test_op, o_func, o_f_to_c_index, 1)
GAP_CHECK("o_3buff_instrinsic", test_op, o_3buff_intrinsic, o_func, 1)

/* Test Predefined datatype sizes */
printf("=============================================\n");
Expand Down
13 changes: 0 additions & 13 deletions ompi/mca/op/avx/op_avx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,12 @@ avx_component_init_query(bool enable_progress_threads,

#if OMPI_MCA_OP_HAVE_AVX512
extern ompi_op_base_handler_fn_t ompi_op_avx_functions_avx512[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
extern ompi_op_base_3buff_handler_fn_t ompi_op_avx_3buff_functions_avx512[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
#endif
#if OMPI_MCA_OP_HAVE_AVX2
extern ompi_op_base_handler_fn_t ompi_op_avx_functions_avx2[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
extern ompi_op_base_3buff_handler_fn_t ompi_op_avx_3buff_functions_avx2[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
#endif
#if OMPI_MCA_OP_HAVE_AVX
extern ompi_op_base_handler_fn_t ompi_op_avx_functions_avx[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
extern ompi_op_base_3buff_handler_fn_t ompi_op_avx_3buff_functions_avx[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
#endif
/*
* Query whether this component can be used for a specific op
Expand Down Expand Up @@ -274,35 +271,25 @@ avx_component_op_query(struct ompi_op_t *op, int *priority)
#if OMPI_MCA_OP_HAVE_AVX512
if( mca_op_avx_component.flags & OMPI_OP_AVX_HAS_AVX512F_FLAG ) {
module->opm_fns[i] = ompi_op_avx_functions_avx512[op->o_f_to_c_index][i];
module->opm_3buff_fns[i] = ompi_op_avx_3buff_functions_avx512[op->o_f_to_c_index][i];
}
#endif
#if OMPI_MCA_OP_HAVE_AVX2
if( mca_op_avx_component.flags & OMPI_OP_AVX_HAS_AVX2_FLAG ) {
if( NULL == module->opm_fns[i] ) {
module->opm_fns[i] = ompi_op_avx_functions_avx2[op->o_f_to_c_index][i];
}
if( NULL == module->opm_3buff_fns[i] ) {
module->opm_3buff_fns[i] = ompi_op_avx_3buff_functions_avx2[op->o_f_to_c_index][i];
}
}
#endif
#if OMPI_MCA_OP_HAVE_AVX
if( mca_op_avx_component.flags & OMPI_OP_AVX_HAS_AVX_FLAG ) {
if( NULL == module->opm_fns[i] ) {
module->opm_fns[i] = ompi_op_avx_functions_avx[op->o_f_to_c_index][i];
}
if( NULL == module->opm_3buff_fns[i] ) {
module->opm_3buff_fns[i] = ompi_op_avx_3buff_functions_avx[op->o_f_to_c_index][i];
}
}
#endif
if( NULL != module->opm_fns[i] ) {
OBJ_RETAIN(module);
}
if( NULL != module->opm_3buff_fns[i] ) {
OBJ_RETAIN(module);
}
}
break;
case OMPI_OP_BASE_FORTRAN_LAND:
Expand Down
649 changes: 0 additions & 649 deletions ompi/mca/op/avx/op_avx_functions.c

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions ompi/mca/op/base/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ BEGIN_C_DECLS
*/
OMPI_DECLSPEC extern ompi_op_base_handler_fn_t
ompi_op_base_functions[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];
OMPI_DECLSPEC extern ompi_op_base_3buff_handler_fn_t
ompi_op_base_3buff_functions[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TYPE_MAX];

END_C_DECLS

Expand Down
2 changes: 0 additions & 2 deletions ompi/mca/op/base/op_base_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ static void module_constructor(ompi_op_base_module_t *m)
m->opm_enable = NULL;
m->opm_op = NULL;
memset(&(m->opm_fns), 0, sizeof(m->opm_fns));
memset(&(m->opm_3buff_fns), 0, sizeof(m->opm_3buff_fns));
}

static void module_constructor_1_0_0(ompi_op_base_module_1_0_0_t *m)
{
m->opm_enable = NULL;
m->opm_op = NULL;
memset(&(m->opm_fns), 0, sizeof(m->opm_fns));
memset(&(m->opm_3buff_fns), 0, sizeof(m->opm_3buff_fns));
}

OBJ_CLASS_INSTANCE(ompi_op_base_module_t, opal_object_t,
Expand Down
Loading

0 comments on commit f4b4c4f

Please sign in to comment.