diff --git a/ompi/communicator/comm_init.c b/ompi/communicator/comm_init.c index f1078d06143..9e90e8461cc 100644 --- a/ompi/communicator/comm_init.c +++ b/ompi/communicator/comm_init.c @@ -441,7 +441,7 @@ static void ompi_comm_construct(ompi_communicator_t* comm) /* A keyhash will be created if/when an attribute is cached on this communicator */ comm->c_keyhash = NULL; - + comm->errhandler_type = OMPI_ERRHANDLER_TYPE_COMM; comm->error_handler = &ompi_mpi_errors_are_fatal.eh; #ifdef OMPI_WANT_PERUSE comm->c_peruse_handles = NULL; diff --git a/ompi/communicator/communicator.h b/ompi/communicator/communicator.h index 8c8cfac4f91..d6115a46138 100644 --- a/ompi/communicator/communicator.h +++ b/ompi/communicator/communicator.h @@ -313,6 +313,7 @@ struct ompi_communicator_t { that the OMPI_ERRHDL_* macros can find it, regardless of whether it's a comm, window, or file. */ ompi_errhandler_t *error_handler; + ompi_errhandler_type_t errhandler_type; /* Hooks for PML to hang things */ struct mca_pml_comm_t *c_pml_comm; diff --git a/ompi/debuggers/predefined_gap_test.c b/ompi/debuggers/predefined_gap_test.c index 4ad207988a1..36adc09fb7b 100644 --- a/ompi/debuggers/predefined_gap_test.c +++ b/ompi/debuggers/predefined_gap_test.c @@ -71,6 +71,8 @@ int main(int argc, char **argv) { #else GAP_CHECK("error_handler", test_comm, error_handler, c_f_to_c_index, 1); #endif + GAP_CHECK("errhandler_type", test_comm, errhandler_type, error_handler, 1); + GAP_CHECK("c_pml_comm", test_comm, c_pml_comm, errhandler_type, 1); GAP_CHECK("c_coll", test_comm, c_coll, c_pml_comm, 1); /* Test Predefined group sizes */ @@ -125,7 +127,8 @@ int main(int argc, char **argv) { GAP_CHECK("w_keyhash", test_win, w_keyhash, w_flags, 1); GAP_CHECK("w_f_to_c_index", test_win, w_f_to_c_index, w_keyhash, 1); GAP_CHECK("error_handler", test_win, error_handler, w_f_to_c_index, 1); - + GAP_CHECK("errhandler_type", test_win, errhandler_type, error_handler, 1); + GAP_CHECK("w_osc_module", test_win, w_osc_module, errhandler_type, 1); /* Test Predefined info sizes */ printf("=============================================\n"); printf("ompi_predefined_info_t = %lu bytes\n", sizeof(ompi_predefined_info_t)); @@ -145,6 +148,8 @@ int main(int argc, char **argv) { GAP_CHECK("f_flags", test_file, f_flags, f_amode, 1); GAP_CHECK("f_f_to_c_index", test_file, f_f_to_c_index, f_flags, 1); GAP_CHECK("error_handler", test_file, error_handler, f_f_to_c_index, 1); + GAP_CHECK("errhandler_type", test_file, errhandler_type, error_handler, 1); + GAP_CHECK("f_io_version", test_file, f_io_version, errhandler_type, 1); GAP_CHECK("f_io_selected_component", test_file, f_io_selected_component, f_io_version, 1); GAP_CHECK("f_io_selected_module", test_file, f_io_selected_module, f_io_selected_component, 1); GAP_CHECK("f_io_selected_data", test_file, f_io_selected_data, f_io_selected_module, 1); diff --git a/ompi/errhandler/errhandler.c b/ompi/errhandler/errhandler.c index bcdd2f345c6..76b902932f9 100644 --- a/ompi/errhandler/errhandler.c +++ b/ompi/errhandler/errhandler.c @@ -388,10 +388,10 @@ int ompi_errhandler_proc_failed_internal(ompi_proc_t* ompi_proc, int status, boo OMPI_NAME_PRINT(&ompi_proc->super.proc_name), ompi_comm_print_cid(comm), proc_rank, - (OMPI_ERRHANDLER_TYPE_PREDEFINED == comm->error_handler->eh_mpi_object_type ? "P" : - (OMPI_ERRHANDLER_TYPE_COMM == comm->error_handler->eh_mpi_object_type ? "C" : - (OMPI_ERRHANDLER_TYPE_WIN == comm->error_handler->eh_mpi_object_type ? "W" : - (OMPI_ERRHANDLER_TYPE_FILE == comm->error_handler->eh_mpi_object_type ? "F" : "U") ) ) ) + (OMPI_ERRHANDLER_TYPE_PREDEFINED == comm->errhandler_type ? "P" : + (OMPI_ERRHANDLER_TYPE_COMM == comm->errhandler_type ? "C" : + (OMPI_ERRHANDLER_TYPE_WIN == comm->errhandler_type ? "W" : + (OMPI_ERRHANDLER_TYPE_FILE == comm->errhandler_type ? "F" : "U") ) ) ) )); } diff --git a/ompi/errhandler/errhandler.h b/ompi/errhandler/errhandler.h index 519a84d9961..40909f3f140 100644 --- a/ompi/errhandler/errhandler.h +++ b/ompi/errhandler/errhandler.h @@ -238,7 +238,7 @@ extern opal_atomic_int32_t ompi_instance_count; #define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \ ompi_errhandler_invoke((mpi_object)->error_handler, \ (mpi_object), \ - (int)(mpi_object)->error_handler->eh_mpi_object_type, \ + (int)(mpi_object)->errhandler_type, \ ompi_errcode_get_mpi_code(err_code), \ (message)); @@ -269,7 +269,7 @@ extern opal_atomic_int32_t ompi_instance_count; int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \ ompi_errhandler_invoke((mpi_object)->error_handler, \ (mpi_object), \ - (int) (mpi_object)->error_handler->eh_mpi_object_type, \ + (int) (mpi_object)->errhandler_type, \ (__mpi_err_code), \ (message)); \ return (__mpi_err_code); \ @@ -307,7 +307,7 @@ extern opal_atomic_int32_t ompi_instance_count; int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \ ompi_errhandler_invoke((mpi_object)->error_handler, \ (mpi_object), \ - (int)(mpi_object)->error_handler->eh_mpi_object_type, \ + (int)(mpi_object)->errhandler_type, \ (__mpi_err_code), \ (message)); \ return (__mpi_err_code); \ diff --git a/ompi/errhandler/errhandler_invoke.c b/ompi/errhandler/errhandler_invoke.c index fc9a0818e1b..d9d3ede4677 100644 --- a/ompi/errhandler/errhandler_invoke.c +++ b/ompi/errhandler/errhandler_invoke.c @@ -202,19 +202,19 @@ int ompi_errhandler_request_invoke(int count, case OMPI_REQUEST_COLL: return ompi_errhandler_invoke(mpi_object.comm->error_handler, mpi_object.comm, - mpi_object.comm->error_handler->eh_mpi_object_type, + mpi_object.comm->errhandler_type, ec, message); break; case OMPI_REQUEST_IO: return ompi_errhandler_invoke(mpi_object.file->error_handler, mpi_object.file, - mpi_object.file->error_handler->eh_mpi_object_type, + mpi_object.file->errhandler_type, ec, message); break; case OMPI_REQUEST_WIN: return ompi_errhandler_invoke(mpi_object.win->error_handler, mpi_object.win, - mpi_object.win->error_handler->eh_mpi_object_type, + mpi_object.win->errhandler_type, ec, message); break; default: diff --git a/ompi/group/group_init.c b/ompi/group/group_init.c index 3865c935eff..77fd697aa22 100644 --- a/ompi/group/group_init.c +++ b/ompi/group/group_init.c @@ -419,16 +419,6 @@ int ompi_group_init(void) return OMPI_ERROR; } -#if OPAL_ENABLE_FT_MPI - /* Setup global list of failed processes */ - ompi_group_all_failed_procs = OBJ_NEW(ompi_group_t); - ompi_group_all_failed_procs->grp_proc_count = 0; - ompi_group_all_failed_procs->grp_my_rank = MPI_UNDEFINED; - ompi_group_all_failed_procs->grp_proc_pointers = NULL; - ompi_group_all_failed_procs->grp_flags |= OMPI_GROUP_DENSE; - ompi_group_all_failed_procs->grp_flags |= OMPI_GROUP_INTRINSIC; -#endif - /* add MPI_GROUP_NULL to table */ OBJ_CONSTRUCT(&ompi_mpi_group_null, ompi_group_t); ompi_mpi_group_null.group.grp_proc_count = 0; @@ -445,6 +435,17 @@ int ompi_group_init(void) ompi_mpi_group_empty.group.grp_flags |= OMPI_GROUP_DENSE; ompi_mpi_group_empty.group.grp_flags |= OMPI_GROUP_INTRINSIC; +#if OPAL_ENABLE_FT_MPI + /* Setup global list of failed processes */ + ompi_group_all_failed_procs = OBJ_NEW(ompi_group_t); + ompi_group_all_failed_procs->grp_proc_count = 0; + ompi_group_all_failed_procs->grp_my_rank = MPI_UNDEFINED; + ompi_group_all_failed_procs->grp_proc_pointers = NULL; + ompi_group_all_failed_procs->grp_flags |= OMPI_GROUP_DENSE; + ompi_group_all_failed_procs->grp_flags |= OMPI_GROUP_INTRINSIC; +#endif + + ompi_mpi_instance_append_finalize (ompi_group_finalize); return OMPI_SUCCESS; diff --git a/ompi/mca/coll/han/coll_han_reduce.c b/ompi/mca/coll/han/coll_han_reduce.c index 5f0bc1770c6..a208b41d784 100644 --- a/ompi/mca/coll/han/coll_han_reduce.c +++ b/ompi/mca/coll/han/coll_han_reduce.c @@ -172,7 +172,10 @@ mca_coll_han_reduce_intra(const void *sbuf, mca_coll_task_t *t_next_seg = OBJ_NEW(mca_coll_task_t); /* Setup up t_next_seg task arguments */ t->cur_task = t_next_seg; - t->sbuf = (char *) t->sbuf + extent * t->seg_count; + if (t->sbuf != MPI_IN_PLACE) { + t->sbuf = (char *) t->sbuf + extent * t->seg_count; + } + if (up_rank == root_up_rank) { t->rbuf = (char *) t->rbuf + extent * t->seg_count; } @@ -242,6 +245,7 @@ int mca_coll_han_reduce_t1_task(void *task_args) { if (next_seg <= t->num_segments - 1) { int tmp_count = t->seg_count; char *tmp_rbuf = NULL; + char *tmp_sbuf = NULL; if (next_seg == t->num_segments - 1 && t->last_seg_count != t->seg_count) { tmp_count = t->last_seg_count; } @@ -250,7 +254,10 @@ int mca_coll_han_reduce_t1_task(void *task_args) { } else if (NULL != t->rbuf) { tmp_rbuf = (char*)t->rbuf + extent * t->seg_count; } - t->low_comm->c_coll->coll_reduce((char *) t->sbuf + extent * t->seg_count, + + tmp_sbuf = (t->sbuf == MPI_IN_PLACE) ? MPI_IN_PLACE : (char *)t->sbuf + extent * t->seg_count; + + t->low_comm->c_coll->coll_reduce((char *) tmp_sbuf, (char *) tmp_rbuf, tmp_count, t->dtype, t->op, t->root_low_rank, t->low_comm, t->low_comm->c_coll->coll_reduce_module); diff --git a/ompi/mca/pml/cm/pml_cm_sendreq.h b/ompi/mca/pml/cm/pml_cm_sendreq.h index 56ade0719f9..ad99474d74b 100644 --- a/ompi/mca/pml/cm/pml_cm_sendreq.h +++ b/ompi/mca/pml/cm/pml_cm_sendreq.h @@ -381,7 +381,7 @@ do { \ &max_data ); \ opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, \ &(ompi_mpi_packed.dt.super), \ - max_data, sendreq->req_buff ); \ + max_data, sendreq->req_addr ); \ } \ } \ } while(0); diff --git a/ompi/runtime/ompi_mpi_params.c b/ompi/runtime/ompi_mpi_params.c index dba22726659..c31e47e4af8 100644 --- a/ompi/runtime/ompi_mpi_params.c +++ b/ompi/runtime/ompi_mpi_params.c @@ -83,7 +83,7 @@ bool ompi_async_mpi_finalize = false; uint32_t ompi_add_procs_cutoff = OMPI_ADD_PROCS_CUTOFF_DEFAULT; bool ompi_mpi_dynamics_enabled = true; -bool ompi_mpi_compat_mpi3 = false; +bool ompi_mpi_compat_mpi3 = true; char *ompi_mpi_spc_attach_string = NULL; bool ompi_mpi_spc_dump_enabled = false; @@ -362,7 +362,7 @@ int ompi_mpi_register_params(void) MCA_BASE_VAR_SYN_FLAG_DEPRECATED); } - ompi_mpi_compat_mpi3 = false; + ompi_mpi_compat_mpi3 = true; (void) mca_base_var_register("ompi", "mpi", NULL, "compat_mpi3", "A boolean value for whether Open MPI operates in MPI-3 compatibility mode; this changes the following behavior: in operations without a handle, errors are raised on (true) MPI_COMM_WORLD (MPI-3 behavior) or (false) MPI_COMM_SELF (MPI-4 behavior).", MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, diff --git a/ompi/runtime/params.h b/ompi/runtime/params.h index ce164f05916..d9f48f80b59 100644 --- a/ompi/runtime/params.h +++ b/ompi/runtime/params.h @@ -123,8 +123,8 @@ OMPI_DECLSPEC extern int ompi_mpi_abort_delay; /** * Whether we operate in MPI3 compatibility, or MPI4 mode (default). * - * true: use MPI3 compatibility - * false: use MPI4 compatibility (default) + * true: use MPI3 compatibility (default) + * false: use MPI4 compatibility * * Behavioral changes: * - errors in operations without a handle are raised on MPI_COMM_WORLD (MPI-3 behavior) or MPI_COMM_SELF (MPI-4 behavior)