From 8bcbe173ad6eb53737478b6e71c67d5c1a0b2df0 Mon Sep 17 00:00:00 2001 From: Jake Tronge Date: Wed, 21 Feb 2024 13:37:14 -0700 Subject: [PATCH] Prepare osc framework for bigcount Update the osc framework to use size_t for counts and ptrdiff_t for displacements. Signed-off-by: Jake Tronge --- ompi/mca/osc/base/base.h | 2 +- ompi/mca/osc/base/osc_base_init.c | 2 +- .../monitoring/osc_monitoring_accumulate.h | 20 +-- ompi/mca/osc/monitoring/osc_monitoring_comm.h | 16 +-- .../osc/monitoring/osc_monitoring_component.c | 6 +- ompi/mca/osc/osc.h | 58 ++++---- ompi/mca/osc/portals4/osc_portals4.h | 40 +++--- ompi/mca/osc/portals4/osc_portals4_comm.c | 130 +++++++++--------- .../mca/osc/portals4/osc_portals4_component.c | 16 +-- ompi/mca/osc/rdma/osc_rdma.h | 4 +- ompi/mca/osc/rdma/osc_rdma_accumulate.c | 58 ++++---- ompi/mca/osc/rdma/osc_rdma_accumulate.h | 20 +-- ompi/mca/osc/rdma/osc_rdma_comm.c | 40 +++--- ompi/mca/osc/rdma/osc_rdma_comm.h | 18 +-- ompi/mca/osc/rdma/osc_rdma_component.c | 12 +- ompi/mca/osc/rdma/osc_rdma_peer.h | 2 +- ompi/mca/osc/sm/osc_sm.h | 40 +++--- ompi/mca/osc/sm/osc_sm_comm.c | 52 +++---- ompi/mca/osc/sm/osc_sm_component.c | 18 +-- ompi/mca/osc/ucx/osc_ucx.h | 56 ++++---- ompi/mca/osc/ucx/osc_ucx_comm.c | 78 +++++------ ompi/mca/osc/ucx/osc_ucx_component.c | 18 +-- 22 files changed, 353 insertions(+), 353 deletions(-) diff --git a/ompi/mca/osc/base/base.h b/ompi/mca/osc/base/base.h index 48986b2d776..8b9f7b525b2 100644 --- a/ompi/mca/osc/base/base.h +++ b/ompi/mca/osc/base/base.h @@ -47,7 +47,7 @@ void ompi_osc_base_set_memory_alignment(struct opal_info_t *info, int ompi_osc_base_select(ompi_win_t *win, void **base, size_t size, - int disp_unit, + ptrdiff_t disp_unit, ompi_communicator_t *comm, int flavor, int *model); diff --git a/ompi/mca/osc/base/osc_base_init.c b/ompi/mca/osc/base/osc_base_init.c index 41d8cb03afb..5dea1fae8fa 100644 --- a/ompi/mca/osc/base/osc_base_init.c +++ b/ompi/mca/osc/base/osc_base_init.c @@ -34,7 +34,7 @@ int ompi_osc_base_select(ompi_win_t *win, void **base, size_t size, - int disp_unit, + ptrdiff_t disp_unit, ompi_communicator_t *comm, int flavor, int *model) diff --git a/ompi/mca/osc/monitoring/osc_monitoring_accumulate.h b/ompi/mca/osc/monitoring/osc_monitoring_accumulate.h index d110c8f887b..ae678fbeaed 100644 --- a/ompi/mca/osc/monitoring/osc_monitoring_accumulate.h +++ b/ompi/mca/osc/monitoring/osc_monitoring_accumulate.h @@ -42,14 +42,14 @@ } \ \ static int ompi_osc_monitoring_## template ##_get_accumulate (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t*origin_datatype, \ void *result_addr, \ - int result_count, \ + size_t result_count, \ ompi_datatype_t*result_datatype, \ int target_rank, \ MPI_Aint target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t*target_datatype, \ ompi_op_t *op, ompi_win_t*win) \ { \ @@ -72,14 +72,14 @@ } \ \ static int ompi_osc_monitoring_## template ##_rget_accumulate (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t *origin_datatype, \ void *result_addr, \ - int result_count, \ + size_t result_count, \ ompi_datatype_t *result_datatype, \ int target_rank, \ MPI_Aint target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t*target_datatype, \ ompi_op_t *op, \ ompi_win_t *win, \ @@ -104,11 +104,11 @@ } \ \ static int ompi_osc_monitoring_## template ##_raccumulate (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int target_rank, \ ptrdiff_t target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t *target_datatype, \ ompi_op_t *op, ompi_win_t *win, \ ompi_request_t **request) \ @@ -129,11 +129,11 @@ } \ \ static int ompi_osc_monitoring_## template ##_accumulate (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int target_rank, \ ptrdiff_t target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t *target_datatype, \ ompi_op_t *op, ompi_win_t *win) \ { \ diff --git a/ompi/mca/osc/monitoring/osc_monitoring_comm.h b/ompi/mca/osc/monitoring/osc_monitoring_comm.h index dbe9cb1906c..99c10b5b2f3 100644 --- a/ompi/mca/osc/monitoring/osc_monitoring_comm.h +++ b/ompi/mca/osc/monitoring/osc_monitoring_comm.h @@ -19,11 +19,11 @@ #define OSC_MONITORING_GENERATE_TEMPLATE_COMM(template) \ \ static int ompi_osc_monitoring_## template ##_put (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int target_rank, \ ptrdiff_t target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t *target_datatype, \ ompi_win_t *win) \ { \ @@ -43,11 +43,11 @@ } \ \ static int ompi_osc_monitoring_## template ##_rput (const void *origin_addr, \ - int origin_count, \ + size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int target_rank, \ ptrdiff_t target_disp, \ - int target_count, \ + size_t target_count, \ ompi_datatype_t *target_datatype, \ ompi_win_t *win, \ ompi_request_t **request) \ @@ -67,11 +67,11 @@ return OMPI_OSC_MONITORING_MODULE_VARIABLE(template).osc_rput(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win, request); \ } \ \ - static int ompi_osc_monitoring_## template ##_get (void *origin_addr, int origin_count, \ + static int ompi_osc_monitoring_## template ##_get (void *origin_addr, size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int source_rank, \ ptrdiff_t source_disp, \ - int source_count, \ + size_t source_count, \ ompi_datatype_t *source_datatype, \ ompi_win_t *win) \ { \ @@ -91,11 +91,11 @@ return OMPI_OSC_MONITORING_MODULE_VARIABLE(template).osc_get(origin_addr, origin_count, origin_datatype, source_rank, source_disp, source_count, source_datatype, win); \ } \ \ - static int ompi_osc_monitoring_## template ##_rget (void *origin_addr, int origin_count, \ + static int ompi_osc_monitoring_## template ##_rget (void *origin_addr, size_t origin_count, \ ompi_datatype_t *origin_datatype, \ int source_rank, \ ptrdiff_t source_disp, \ - int source_count, \ + size_t source_count, \ ompi_datatype_t *source_datatype, \ ompi_win_t *win, \ ompi_request_t **request) \ diff --git a/ompi/mca/osc/monitoring/osc_monitoring_component.c b/ompi/mca/osc/monitoring/osc_monitoring_component.c index 26b49ea865b..dcb8a06492d 100644 --- a/ompi/mca/osc/monitoring/osc_monitoring_component.c +++ b/ompi/mca/osc/monitoring/osc_monitoring_component.c @@ -47,7 +47,7 @@ static int mca_osc_monitoring_component_register(void) return OMPI_SUCCESS; } -static int mca_osc_monitoring_component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int mca_osc_monitoring_component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor) { @@ -69,7 +69,7 @@ ompi_mca_osc_monitoring_set_template(ompi_osc_base_component_t *best_component, return OMPI_ERR_NOT_SUPPORTED; } -static int mca_osc_monitoring_component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int mca_osc_monitoring_component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model) { @@ -119,7 +119,7 @@ ompi_osc_monitoring_component_t mca_osc_monitoring_component = { /* First, the mca_base_component_t struct containing meta information about the component itself */ .osc_version = { - OMPI_OSC_BASE_VERSION_3_0_0, + OMPI_OSC_BASE_VERSION_4_0_0, .mca_component_name = "monitoring", /* MCA component name */ MCA_MONITORING_MAKE_VERSION, diff --git a/ompi/mca/osc/osc.h b/ompi/mca/osc/osc.h index 88556dbe963..82c1879ce93 100644 --- a/ompi/mca/osc/osc.h +++ b/ompi/mca/osc/osc.h @@ -115,7 +115,7 @@ typedef int (*ompi_osc_base_component_finalize_fn_t)(void); typedef int (*ompi_osc_base_component_query_fn_t)(struct ompi_win_t *win, void **base, size_t size, - int disp_unit, + ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor); @@ -147,7 +147,7 @@ typedef int (*ompi_osc_base_component_query_fn_t)(struct ompi_win_t *win, typedef int (*ompi_osc_base_component_select_fn_t)(struct ompi_win_t *win, void **base, size_t size, - int disp_unit, + ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, @@ -160,7 +160,7 @@ typedef int (*ompi_osc_base_component_select_fn_t)(struct ompi_win_t *win, * this structure, called mca_osc_[component_name]_component, must * exist in any OSC component. */ -struct ompi_osc_base_component_2_0_0_t { +struct ompi_osc_base_component_3_0_0_t { /** Base component description */ mca_base_component_t osc_version; /** Base component data block */ @@ -174,14 +174,14 @@ struct ompi_osc_base_component_2_0_0_t { /* Finalize the component infrastructure */ ompi_osc_base_component_finalize_fn_t osc_finalize; }; -typedef struct ompi_osc_base_component_2_0_0_t ompi_osc_base_component_2_0_0_t; -typedef ompi_osc_base_component_2_0_0_t ompi_osc_base_component_t; +typedef struct ompi_osc_base_component_3_0_0_t ompi_osc_base_component_3_0_0_t; +typedef ompi_osc_base_component_3_0_0_t ompi_osc_base_component_t; /* ******************************************************************** */ typedef int (*ompi_osc_base_module_win_shared_query_fn_t)(struct ompi_win_t *win, int rank, - size_t *size, int *disp_unit, void *baseptr); + size_t *size, ptrdiff_t *disp_unit, void *baseptr); typedef int (*ompi_osc_base_module_win_attach_fn_t)(struct ompi_win_t *win, void *base, size_t size); typedef int (*ompi_osc_base_module_win_detach_fn_t)(struct ompi_win_t *win, const void *base); @@ -205,31 +205,31 @@ typedef int (*ompi_osc_base_module_free_fn_t)(struct ompi_win_t *win); typedef int (*ompi_osc_base_module_put_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); typedef int (*ompi_osc_base_module_accumulate_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win); @@ -251,59 +251,59 @@ typedef int (*ompi_osc_base_module_fetch_and_op_fn_t)(const void *origin_addr, struct ompi_win_t *win); typedef int (*ompi_osc_base_module_get_accumulate_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win); typedef int (*ompi_osc_base_module_rput_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); typedef int (*ompi_osc_base_module_raccumulate_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request); typedef int (*ompi_osc_base_module_rget_accumulate_fn_t)(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win, @@ -367,7 +367,7 @@ typedef int (*ompi_osc_base_module_flush_local_all_fn_t)(struct ompi_win_t *win) * free to create a structure that inherits this one for use as the * module structure. */ -struct ompi_osc_base_module_3_0_0_t { +struct ompi_osc_base_module_4_0_0_t { ompi_osc_base_module_win_shared_query_fn_t osc_win_shared_query; ompi_osc_base_module_win_attach_fn_t osc_win_attach; @@ -405,16 +405,16 @@ struct ompi_osc_base_module_3_0_0_t { ompi_osc_base_module_flush_local_fn_t osc_flush_local; ompi_osc_base_module_flush_local_all_fn_t osc_flush_local_all; }; -typedef struct ompi_osc_base_module_3_0_0_t ompi_osc_base_module_3_0_0_t; -typedef ompi_osc_base_module_3_0_0_t ompi_osc_base_module_t; +typedef struct ompi_osc_base_module_4_0_0_t ompi_osc_base_module_4_0_0_t; +typedef ompi_osc_base_module_4_0_0_t ompi_osc_base_module_t; /* ******************************************************************** */ /** Macro for use in components that are of type osc */ -#define OMPI_OSC_BASE_VERSION_3_0_0 \ - OMPI_MCA_BASE_VERSION_2_1_0("osc", 3, 0, 0) +#define OMPI_OSC_BASE_VERSION_4_0_0 \ + OMPI_MCA_BASE_VERSION_2_1_0("osc", 4, 0, 0) /* ******************************************************************** */ diff --git a/ompi/mca/osc/portals4/osc_portals4.h b/ompi/mca/osc/portals4/osc_portals4.h index fd150e24285..8497f7e1245 100644 --- a/ompi/mca/osc/portals4/osc_portals4.h +++ b/ompi/mca/osc/portals4/osc_portals4.h @@ -88,8 +88,8 @@ struct ompi_osc_portals4_module_t { ompi_osc_base_module_t super; void *free_after; /* if non-null, this pointer should be free()ed when window destroyed */ struct ompi_communicator_t *comm; /* communicator which backs this window (unique to this window) */ - int disp_unit; /* if -1, have to look at disp_units */ - int *disp_units; /* array (possibly NULL!) of displacement units, per peer */ + ptrdiff_t disp_unit; /* if -1, have to look at disp_units */ + ptrdiff_t *disp_units; /* array (possibly NULL!) of displacement units, per peer */ ptl_handle_ni_t ni_h; /* network interface used by this window */ ptl_pt_index_t pt_idx; /* portal table index used by this window (this will be same across window) */ ptl_handle_ct_t ct_h; /* Counting event handle used for completion in this window */ @@ -144,29 +144,29 @@ int ompi_osc_portals4_detach(struct ompi_win_t *win, const void *base); int ompi_osc_portals4_free(struct ompi_win_t *win); int ompi_osc_portals4_put(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); int ompi_osc_portals4_get(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); int ompi_osc_portals4_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win); @@ -188,58 +188,58 @@ int ompi_osc_portals4_fetch_and_op(const void *origin_addr, struct ompi_win_t *win); int ompi_osc_portals4_get_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win); int ompi_osc_portals4_rput(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_portals4_rget(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_portals4_raccumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_portals4_rget_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win, diff --git a/ompi/mca/osc/portals4/osc_portals4_comm.c b/ompi/mca/osc/portals4/osc_portals4_comm.c index e9271e0de4e..5d318dc89c0 100644 --- a/ompi/mca/osc/portals4/osc_portals4_comm.c +++ b/ompi/mca/osc/portals4/osc_portals4_comm.c @@ -425,7 +425,7 @@ segmentedSwap(opal_atomic_int64_t *opcount, static int create_iov_list(const void *address, - int count, + size_t count, ompi_datatype_t *datatype, ptl_iovec_t **ptl_iovec, ptl_size_t *ptl_iovec_count) @@ -481,10 +481,10 @@ create_iov_list(const void *address, static int get_to_iovec(ompi_osc_portals4_module_t *module, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -542,7 +542,7 @@ get_to_iovec(ompi_osc_portals4_module_t *module, opal_atomic_add_fetch_64(&module->opcount, 1); OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d Get(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, size=%lu, length=%lu, offset=%lu, op_count=%ld)", + "%s,%d Get(origin_count=%d, origin_lb=%lu, target_count=%zu, target_lb=%lu, size=%zu, length=%lu, offset=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, size, length, offset, module->opcount)); ret = PtlGet(module->origin_iovec_md_h, (ptl_size_t) origin_lb, @@ -568,10 +568,10 @@ get_to_iovec(ompi_osc_portals4_module_t *module, static int atomic_get_to_iovec(ompi_osc_portals4_module_t *module, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -627,7 +627,7 @@ atomic_get_to_iovec(ompi_osc_portals4_module_t *module, } OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d Get(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, size=%lu, length=%lu, offset=%lu, op_count=%ld)", + "%s,%d Get(origin_count=%zu, origin_lb=%lu, target_count=%zu, target_lb=%lu, size=%zu, length=%lu, offset=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, size, length, offset, module->opcount)); ret = segmentedGet(&module->opcount, module->origin_iovec_md_h, @@ -650,10 +650,10 @@ atomic_get_to_iovec(ompi_osc_portals4_module_t *module, static int put_from_iovec(ompi_osc_portals4_module_t *module, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -711,7 +711,7 @@ put_from_iovec(ompi_osc_portals4_module_t *module, opal_atomic_add_fetch_64(&module->opcount, 1); OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d Put(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, size=%lu, length=%lu, offset=%lu, op_count=%ld)", + "%s,%d Put(origin_count=%zu, origin_lb=%lu, target_count=%zu, target_lb=%lu, size=%zu, length=%lu, offset=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, size, length, offset, module->opcount)); ret = PtlPut(module->origin_iovec_md_h, (ptl_size_t) origin_lb, @@ -739,10 +739,10 @@ put_from_iovec(ompi_osc_portals4_module_t *module, static int atomic_put_from_iovec(ompi_osc_portals4_module_t *module, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -798,7 +798,7 @@ atomic_put_from_iovec(ompi_osc_portals4_module_t *module, } OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d Put(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, length=%lu, op_count=%ld)", + "%s,%d Put(origin_count=%zu, origin_lb=%lu, target_count=%zu, target_lb=%lu, length=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, length, module->opcount)); ret = segmentedPut(&module->opcount, module->origin_iovec_md_h, @@ -823,10 +823,10 @@ atomic_put_from_iovec(ompi_osc_portals4_module_t *module, static int atomic_from_iovec(ompi_osc_portals4_module_t *module, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -920,13 +920,13 @@ atomic_from_iovec(ompi_osc_portals4_module_t *module, static int swap_to_iovec(ompi_osc_portals4_module_t *module, const void *result_address, - int result_count, + size_t result_count, ompi_datatype_t *result_datatype, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1044,13 +1044,13 @@ swap_to_iovec(ompi_osc_portals4_module_t *module, static int fetch_atomic_to_iovec(ompi_osc_portals4_module_t *module, const void *result_address, - int result_count, + size_t result_count, ompi_datatype_t *result_datatype, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1182,10 +1182,10 @@ static int put_to_noncontig(opal_atomic_int64_t *opcount, ptl_handle_md_t md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1291,10 +1291,10 @@ static int atomic_put_to_noncontig(ompi_osc_portals4_module_t *module, ptl_handle_md_t md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1394,10 +1394,10 @@ static int atomic_to_noncontig(ompi_osc_portals4_module_t *module, ptl_handle_md_t md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1516,10 +1516,10 @@ static int get_from_noncontig(opal_atomic_int64_t *opcount, ptl_handle_md_t md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1617,10 +1617,10 @@ static int atomic_get_from_noncontig(ompi_osc_portals4_module_t *module, ptl_handle_md_t md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1718,14 +1718,14 @@ static int swap_from_noncontig(ompi_osc_portals4_module_t *module, ptl_handle_md_t result_md_h, const void *result_address, - int result_count, + size_t result_count, ompi_datatype_t *result_datatype, ptl_handle_md_t origin_md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -1862,14 +1862,14 @@ static int fetch_atomic_from_noncontig(ompi_osc_portals4_module_t *module, ptl_handle_md_t result_md_h, const void *result_address, - int result_count, + size_t result_count, ompi_datatype_t *result_datatype, ptl_handle_md_t origin_md_h, const void *origin_address, - int origin_count, + size_t origin_count, ompi_datatype_t *origin_datatype, ptl_process_t peer, - int target_count, + size_t target_count, ompi_datatype_t *target_datatype, size_t offset, ptl_pt_index_t pt_index, @@ -2010,11 +2010,11 @@ fetch_atomic_from_noncontig(ompi_osc_portals4_module_t *module, int ompi_osc_portals4_rput(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **ompi_req) @@ -2028,7 +2028,7 @@ ompi_osc_portals4_rput(const void *origin_addr, ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rput: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", + "rput: 0x%lx, %zu, %s, %d, %lu, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -2096,7 +2096,7 @@ ompi_osc_portals4_rput(const void *origin_addr, request->ops_expected += number_of_fragments(length, mca_osc_portals4_component.ptl_max_msg_size); OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d RPut(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, length=%lu, op_count=%ld)", + "%s,%d RPut(origin_count=%zu, origin_lb=%lu, target_count=%zu, target_lb=%lu, length=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, length, module->opcount)); ret = segmentedPut(&module->opcount, module->req_md_h, @@ -2122,11 +2122,11 @@ ompi_osc_portals4_rput(const void *origin_addr, int ompi_osc_portals4_rget(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **ompi_req) @@ -2140,7 +2140,7 @@ ompi_osc_portals4_rget(void *origin_addr, ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rget: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", + "rget: 0x%lx, %zu, %s, %d, %lu, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -2227,11 +2227,11 @@ ompi_osc_portals4_rget(void *origin_addr, int ompi_osc_portals4_raccumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, @@ -2248,7 +2248,7 @@ ompi_osc_portals4_raccumulate(const void *origin_addr, ptrdiff_t sent, length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "raccumulate: 0x%lx, %d, %s, %d, %lu, %d, %s, %s 0x%lx", + "raccumulate: 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -2435,14 +2435,14 @@ ompi_osc_portals4_raccumulate(const void *origin_addr, int ompi_osc_portals4_rget_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, @@ -2459,7 +2459,7 @@ ompi_osc_portals4_rget_accumulate(const void *origin_addr, ptrdiff_t length, origin_lb, target_lb, result_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rget_accumulate: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", + "rget_accumulate: 0x%lx, %zu, %s, 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, (unsigned long) result_addr, result_count, result_dt->name, @@ -2787,11 +2787,11 @@ ompi_osc_portals4_rget_accumulate(const void *origin_addr, int ompi_osc_portals4_put(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { @@ -2803,7 +2803,7 @@ ompi_osc_portals4_put(const void *origin_addr, ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "put: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", + "put: 0x%lx, %zu, %s, %d, %lu, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -2861,7 +2861,7 @@ ompi_osc_portals4_put(const void *origin_addr, length = size * origin_count; OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output, - "%s,%d Put(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, length=%lu, op_count=%ld)", + "%s,%d Put(origin_count=%zu, origin_lb=%lu, target_count=%zu, target_lb=%lu, length=%lu, op_count=%ld)", __FILE__, __LINE__, origin_count, origin_lb, target_count, target_lb, length, module->opcount)); ret = segmentedPut(&module->opcount, module->md_h, @@ -2886,11 +2886,11 @@ ompi_osc_portals4_put(const void *origin_addr, int ompi_osc_portals4_get(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { @@ -2902,7 +2902,7 @@ ompi_osc_portals4_get(void *origin_addr, ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "get: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", + "get: 0x%lx, %zu, %s, %d, %lu, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -2982,11 +2982,11 @@ ompi_osc_portals4_get(void *origin_addr, int ompi_osc_portals4_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) @@ -3001,7 +3001,7 @@ ompi_osc_portals4_accumulate(const void *origin_addr, ptrdiff_t sent, length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "accumulate: 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", + "accumulate: 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (unsigned long) target_disp, target_count, target_dt->name, @@ -3172,14 +3172,14 @@ ompi_osc_portals4_accumulate(const void *origin_addr, int ompi_osc_portals4_get_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) @@ -3194,7 +3194,7 @@ ompi_osc_portals4_get_accumulate(const void *origin_addr, ptrdiff_t length, origin_lb, target_lb, result_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "get_accumulate: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", + "get_accumulate: 0x%lx, %zu, %s, 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, (unsigned long) result_addr, result_count, result_dt->name, diff --git a/ompi/mca/osc/portals4/osc_portals4_component.c b/ompi/mca/osc/portals4/osc_portals4_component.c index 1509ea729e6..1e0edbb1f2e 100644 --- a/ompi/mca/osc/portals4/osc_portals4_component.c +++ b/ompi/mca/osc/portals4/osc_portals4_component.c @@ -38,10 +38,10 @@ static int component_open(void); static int component_register(void); static int component_init(bool enable_progress_threads, bool enable_mpi_threads); static int component_finalize(void); -static int component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor); -static int component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model); @@ -49,7 +49,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in ompi_osc_portals4_component_t mca_osc_portals4_component = { { /* ompi_osc_base_component_t */ .osc_version = { - OMPI_OSC_BASE_VERSION_3_0_0, + OMPI_OSC_BASE_VERSION_4_0_0, .mca_component_name = "portals4", MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION), @@ -362,7 +362,7 @@ component_finalize(void) static int -component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor) { @@ -383,7 +383,7 @@ component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, static int -component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model) { @@ -461,9 +461,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit module->disp_units = NULL; } else { module->disp_unit = -1; - module->disp_units = malloc(sizeof(int) * ompi_comm_size(module->comm)); - ret = module->comm->c_coll->coll_allgather(&disp_unit, 1, MPI_INT, - module->disp_units, 1, MPI_INT, + module->disp_units = malloc(sizeof(ptrdiff_t) * ompi_comm_size(module->comm)); + ret = module->comm->c_coll->coll_allgather(&disp_unit, sizeof(ptrdiff_t), MPI_BYTE, + module->disp_units, sizeof(ptrdiff_t), MPI_BYTE, module->comm, module->comm->c_coll->coll_allgather_module); if (OMPI_SUCCESS != ret) goto error; diff --git a/ompi/mca/osc/rdma/osc_rdma.h b/ompi/mca/osc/rdma/osc_rdma.h index 2a91fb69264..b18d2d7c4d0 100644 --- a/ompi/mca/osc/rdma/osc_rdma.h +++ b/ompi/mca/osc/rdma/osc_rdma.h @@ -168,7 +168,7 @@ struct ompi_osc_rdma_module_t { size_t size; /** Local displacement unit. */ - int disp_unit; + ptrdiff_t disp_unit; /** maximum count for network AMO usage */ unsigned long network_amo_max_count; @@ -402,7 +402,7 @@ static inline int _ompi_osc_rdma_register (ompi_osc_rdma_module_t *module, struc { if (module->use_memory_registration) { assert(module->use_accelerated_btl); - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "registering segment with btl. range: %p - %p (%lu bytes)", + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "registering segment with btl. range: %p - %p (%zu bytes)", ptr, (void*)((char *) ptr + size), size); *handle = module->accelerated_btl->btl_register_mem(module->accelerated_btl, endpoint, ptr, size, flags); diff --git a/ompi/mca/osc/rdma/osc_rdma_accumulate.c b/ompi/mca/osc/rdma/osc_rdma_accumulate.c index 3eae592365a..14f4d90d74e 100644 --- a/ompi/mca/osc/rdma/osc_rdma_accumulate.c +++ b/ompi/mca/osc/rdma/osc_rdma_accumulate.c @@ -64,10 +64,10 @@ struct ompi_osc_rdma_event_t { typedef struct ompi_osc_rdma_event_t ompi_osc_rdma_event_t; -static int ompi_osc_rdma_gacc_local (const void *source_buffer, int source_count, ompi_datatype_t *source_datatype, - void *result_buffer, int result_count, ompi_datatype_t *result_datatype, +static int ompi_osc_rdma_gacc_local (const void *source_buffer, size_t source_count, ompi_datatype_t *source_datatype, + void *result_buffer, size_t result_count, ompi_datatype_t *result_datatype, ompi_osc_rdma_peer_t *peer, uint64_t target_address, - mca_btl_base_registration_handle_t *target_handle, int target_count, + mca_btl_base_registration_handle_t *target_handle, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_osc_rdma_module_t *module, ompi_osc_rdma_request_t *request, bool lock_acquired) { @@ -358,9 +358,9 @@ static int ompi_osc_rdma_acc_single_atomic (ompi_osc_rdma_sync_t *sync, const vo } static inline int ompi_osc_rdma_gacc_amo (ompi_osc_rdma_module_t *module, ompi_osc_rdma_sync_t *sync, const void *source, void *result, - int result_count, ompi_datatype_t *result_datatype, opal_convertor_t *result_convertor, + size_t result_count, ompi_datatype_t *result_datatype, opal_convertor_t *result_convertor, ompi_osc_rdma_peer_t *peer, uint64_t target_address, - mca_btl_base_registration_handle_t *target_handle, int count, + mca_btl_base_registration_handle_t *target_handle, size_t count, ompi_datatype_t *datatype, ompi_op_t *op, ompi_osc_rdma_request_t *request) { const bool use_amo = module->acc_use_amo; @@ -378,7 +378,7 @@ static inline int ompi_osc_rdma_gacc_amo (ompi_osc_rdma_module_t *module, ompi_o } } - for (int i = 0 ; i < count ; ) { + for (size_t i = 0 ; i < count ; ) { if (use_amo) { if (NULL == result) { ret = ompi_osc_rdma_acc_single_atomic (sync, source, datatype, dt_size, peer, target_address, target_handle, op, request); @@ -426,11 +426,11 @@ static inline int ompi_osc_rdma_gacc_amo (ompi_osc_rdma_module_t *module, ompi_o return OMPI_SUCCESS; } -static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const void *source, int source_count, - ompi_datatype_t *source_datatype, void *result, int result_count, +static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const void *source, size_t source_count, + ompi_datatype_t *source_datatype, void *result, size_t result_count, ompi_datatype_t *result_datatype, opal_convertor_t *result_convertor, ompi_osc_rdma_peer_t *peer, uint64_t target_address, - mca_btl_base_registration_handle_t *target_handle, int target_count, + mca_btl_base_registration_handle_t *target_handle, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_osc_rdma_request_t *request) { ompi_osc_rdma_module_t *module = sync->module; @@ -529,10 +529,10 @@ static void ompi_osc_rdma_gacc_master_cleanup (ompi_osc_rdma_request_t *request) ompi_osc_rdma_peer_accumulate_cleanup (request->module, request->peer, !ompi_osc_rdma_peer_is_exclusive (request->peer)); } -static inline int ompi_osc_rdma_gacc_master (ompi_osc_rdma_sync_t *sync, const void *source_addr, int source_count, - ompi_datatype_t *source_datatype, void *result_addr, int result_count, +static inline int ompi_osc_rdma_gacc_master (ompi_osc_rdma_sync_t *sync, const void *source_addr, size_t source_count, + ompi_datatype_t *source_datatype, void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, ompi_osc_rdma_peer_t *peer, uint64_t target_address, - mca_btl_base_registration_handle_t *target_handle, int target_count, + mca_btl_base_registration_handle_t *target_handle, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_osc_rdma_request_t *request) { ompi_osc_rdma_module_t *module = sync->module; @@ -1034,10 +1034,10 @@ int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare static inline -int ompi_osc_rdma_rget_accumulate_internal (ompi_win_t *win, const void *origin_addr, int origin_count, - ompi_datatype_t *origin_datatype, void *result_addr, int result_count, +int ompi_osc_rdma_rget_accumulate_internal (ompi_win_t *win, const void *origin_addr, size_t origin_count, + ompi_datatype_t *origin_datatype, void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, int target_rank, MPI_Aint target_disp, - int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, + size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_request_t **request_out) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -1119,12 +1119,12 @@ int ompi_osc_rdma_rget_accumulate_internal (ompi_win_t *win, const void *origin_ return ret; } -int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, ompi_datatype_t *result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype, +int ompi_osc_rdma_get_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, + int target_rank, MPI_Aint target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win) { - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "get_acc: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, 0x%lx, %d, %s, %s, %s", + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "get_acc: 0x%lx, %zu, %s, 0x%lx, %zu, %s, %d, 0x%lx, %zu, %s, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, (unsigned long) result_addr, result_count, result_datatype->name, target_rank, (unsigned long) target_disp, target_count, target_datatype->name, op->o_name, @@ -1137,12 +1137,12 @@ int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, omp } -int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, ompi_datatype_t *result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype, +int ompi_osc_rdma_rget_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, + int target_rank, MPI_Aint target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request) { - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rget_acc: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, 0x%lx, %d, %s, %s, %s", + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rget_acc: 0x%lx, %zu, %s, 0x%lx, %zu, %s, %d, 0x%lx, %zu, %s, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, (unsigned long) result_addr, result_count, result_datatype->name, target_rank, (unsigned long) target_disp, target_count, target_datatype->name, op->o_name, @@ -1153,11 +1153,11 @@ int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, om target_count, target_datatype, op, request); } -int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, +int ompi_osc_rdma_raccumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, int target_rank, + ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request) { - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "racc: 0x%lx, %d, %s, %d, 0x%lx, %d, %s, %s, %s", + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "racc: 0x%lx, %zu, %s, %d, 0x%lx, %zu, %s, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, target_rank, (unsigned long) target_disp, target_count, target_datatype->name, op->o_name, win->w_name); @@ -1166,11 +1166,11 @@ int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_d op, request); } -int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, +int ompi_osc_rdma_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, int target_rank, + ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win) { - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "acc: 0x%lx, %d, %s, %d, 0x%lx, %d, %s, %s, %s", + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "acc: 0x%lx, %zu, %s, %d, 0x%lx, %zu, %s, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, target_rank, (unsigned long) target_disp, target_count, target_datatype->name, op->o_name, win->w_name); diff --git a/ompi/mca/osc/rdma/osc_rdma_accumulate.h b/ompi/mca/osc/rdma/osc_rdma_accumulate.h index e1d4eb798c1..8060f1e5590 100644 --- a/ompi/mca/osc/rdma/osc_rdma_accumulate.h +++ b/ompi/mca/osc/rdma/osc_rdma_accumulate.h @@ -20,25 +20,25 @@ int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare ompi_datatype_t *dt, int target_rank, ptrdiff_t target_disp, ompi_win_t *win); -int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, +int ompi_osc_rdma_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, int target_rank, + ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win); int ompi_osc_rdma_fetch_and_op (const void *origin_addr, void *result_addr, ompi_datatype_t *dt, int target_rank, ptrdiff_t target_disp, ompi_op_t *op, ompi_win_t *win); -int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, ompi_datatype_t *result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype, +int ompi_osc_rdma_get_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, + int target_rank, MPI_Aint target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win); -int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, +int ompi_osc_rdma_raccumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, int target_rank, + ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request); -int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, ompi_datatype_t *result_datatype, - int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype, +int ompi_osc_rdma_rget_accumulate (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + void *result_addr, size_t result_count, ompi_datatype_t *result_datatype, + int target_rank, MPI_Aint target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request); diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.c b/ompi/mca/osc/rdma/osc_rdma_comm.c index 4a0d787a878..9b519e36eaf 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -188,9 +188,9 @@ typedef int (*ompi_osc_rdma_fn_t) (ompi_osc_rdma_sync_t *sync, ompi_osc_rdma_pee * This function does the work of breaking a non-contiguous rdma transfer into contiguous components. It will * continue to submit rdma transfers until the entire region is transferred or a fatal error occurs. */ -static int ompi_osc_rdma_master_noncontig (ompi_osc_rdma_sync_t *sync, void *local_address, int local_count, ompi_datatype_t *local_datatype, +static int ompi_osc_rdma_master_noncontig (ompi_osc_rdma_sync_t *sync, void *local_address, size_t local_count, ompi_datatype_t *local_datatype, ompi_osc_rdma_peer_t *peer, uint64_t remote_address, - mca_btl_base_registration_handle_t *remote_handle, int remote_count, + mca_btl_base_registration_handle_t *remote_handle, size_t remote_count, ompi_datatype_t *remote_datatype, ompi_osc_rdma_request_t *request, const size_t max_rdma_len, const ompi_osc_rdma_fn_t rdma_fn, const bool alloc_reqs) { @@ -323,10 +323,10 @@ static int ompi_osc_rdma_master_noncontig (ompi_osc_rdma_sync_t *sync, void *loc return OMPI_SUCCESS; } -static inline int ompi_osc_rdma_master (ompi_osc_rdma_sync_t *sync, void *local_address, int local_count, +static inline int ompi_osc_rdma_master (ompi_osc_rdma_sync_t *sync, void *local_address, size_t local_count, ompi_datatype_t *local_datatype, ompi_osc_rdma_peer_t *peer, uint64_t remote_address, mca_btl_base_registration_handle_t *remote_handle, - int remote_count, ompi_datatype_t *remote_datatype, + size_t remote_count, ompi_datatype_t *remote_datatype, ompi_osc_rdma_request_t *request, const size_t max_rdma_len, const ompi_osc_rdma_fn_t rdma_fn, const bool alloc_reqs) { @@ -373,8 +373,8 @@ static inline int ompi_osc_rdma_master (ompi_osc_rdma_sync_t *sync, void *local_ max_rdma_len, rdma_fn, alloc_reqs); } -static int ompi_osc_rdma_copy_local (const void *source, int source_count, ompi_datatype_t *source_datatype, - void *target, int target_count, ompi_datatype_t *target_datatype, +static int ompi_osc_rdma_copy_local (const void *source, size_t source_count, ompi_datatype_t *source_datatype, + void *target, size_t target_count, ompi_datatype_t *target_datatype, ompi_osc_rdma_request_t *request) { int ret; @@ -796,8 +796,8 @@ static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const voi module->put_limit, ompi_osc_rdma_put_contig, false); } -static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - ompi_osc_rdma_peer_t *peer, ptrdiff_t source_disp, int source_count, +static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + ompi_osc_rdma_peer_t *peer, ptrdiff_t source_disp, size_t source_count, ompi_datatype_t *source_datatype, ompi_osc_rdma_request_t *request) { ompi_osc_rdma_module_t *module = sync->module; @@ -835,15 +835,15 @@ static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *ori source_handle, source_count, source_datatype, request, module->get_limit, ompi_osc_rdma_get_contig, true); } -int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int target_rank, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_put (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + int target_rank, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); ompi_osc_rdma_peer_t *peer; ompi_osc_rdma_sync_t *sync; - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "put: 0x%lx, %d, %s, %d, %d, %d, %s, %s", (unsigned long) origin_addr, + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "put: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, target_rank, (int) target_disp, target_count, target_datatype->name, win->w_name); @@ -856,8 +856,8 @@ int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_ target_count, target_datatype, NULL); } -int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int target_rank, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_rput (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + int target_rank, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_datatype, ompi_win_t *win, ompi_request_t **request) { @@ -867,7 +867,7 @@ int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype ompi_osc_rdma_sync_t *sync; int ret; - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rput: 0x%lx, %d, %s, %d, %d, %d, %s, %s", (unsigned long) origin_addr, origin_count, + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rput: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, target_rank, (int) target_disp, target_count, target_datatype->name, win->w_name); sync = ompi_osc_rdma_module_sync_lookup (module, target_rank, &peer); @@ -891,15 +891,15 @@ int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype return OMPI_SUCCESS; } -int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int source_rank, ptrdiff_t source_disp, int source_count, +int ompi_osc_rdma_get (void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + int source_rank, ptrdiff_t source_disp, size_t source_count, ompi_datatype_t *source_datatype, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); ompi_osc_rdma_peer_t *peer; ompi_osc_rdma_sync_t *sync; - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "get: 0x%lx, %d, %s, %d, %d, %d, %s, %s", (unsigned long) origin_addr, + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "get: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, source_rank, (int) source_disp, source_count, source_datatype->name, win->w_name); @@ -912,8 +912,8 @@ int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *ori source_disp, source_count, source_datatype, NULL); } -int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int source_rank, ptrdiff_t source_disp, int source_count, +int ompi_osc_rdma_rget (void *origin_addr, size_t origin_count, ompi_datatype_t *origin_datatype, + int source_rank, ptrdiff_t source_disp, size_t source_count, ompi_datatype_t *source_datatype, ompi_win_t *win, ompi_request_t **request) { @@ -923,7 +923,7 @@ int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *or ompi_osc_rdma_sync_t *sync; int ret; - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rget: 0x%lx, %d, %s, %d, %d, %d, %s, %s", (unsigned long) origin_addr, + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "rget: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s", (unsigned long) origin_addr, origin_count, origin_datatype->name, source_rank, (int) source_disp, source_count, source_datatype->name, win->w_name); diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.h b/ompi/mca/osc/rdma/osc_rdma_comm.h index 82c1e873263..153633846a0 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.h +++ b/ompi/mca/osc/rdma/osc_rdma_comm.h @@ -59,7 +59,7 @@ static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, o *remote_handle = (mca_btl_base_registration_handle_t *) region->btl_handle_data; } else { ompi_osc_rdma_peer_extended_t *ex_peer = (ompi_osc_rdma_peer_extended_t *) peer; - int disp_unit = (module->same_disp_unit) ? module->disp_unit : ex_peer->disp_unit; + ptrdiff_t disp_unit = (module->same_disp_unit) ? module->disp_unit : ex_peer->disp_unit; size_t size = (module->same_size) ? module->size : (size_t) ex_peer->size; *remote_address = ex_peer->super.base + disp_unit * target_disp; @@ -81,21 +81,21 @@ static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, o /* prototypes for implementations of MPI RMA window functions. these will be called from the * mpi interface (ompi/mpi/c) */ -int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_put (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_dt, + int target, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_dt, ompi_win_t *win); -int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_get (void *origin_addr, size_t origin_count, ompi_datatype_t *origin_dt, + int target, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_dt, ompi_win_t *win); -int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_rput (const void *origin_addr, size_t origin_count, ompi_datatype_t *origin_dt, + int target, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_dt, ompi_win_t *win, ompi_request_t **request); -int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, +int ompi_osc_rdma_rget (void *origin_addr, size_t origin_count, ompi_datatype_t *origin_dt, + int target, ptrdiff_t target_disp, size_t target_count, ompi_datatype_t *target_dt, ompi_win_t *win, ompi_request_t **request); diff --git a/ompi/mca/osc/rdma/osc_rdma_component.c b/ompi/mca/osc/rdma/osc_rdma_component.c index 000475276cf..01ede53593e 100644 --- a/ompi/mca/osc/rdma/osc_rdma_component.c +++ b/ompi/mca/osc/rdma/osc_rdma_component.c @@ -72,10 +72,10 @@ static int ompi_osc_rdma_component_register (void); static int ompi_osc_rdma_component_init (bool enable_progress_threads, bool enable_mpi_threads); static int ompi_osc_rdma_component_finalize (void); -static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor); -static int ompi_osc_rdma_component_select (struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int ompi_osc_rdma_component_select (struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model); static int ompi_osc_rdma_query_accelerated_btls (ompi_communicator_t *comm, ompi_osc_rdma_module_t *module); @@ -94,7 +94,7 @@ static const mca_base_var_enum_value_t ompi_osc_rdma_locking_modes[] = { ompi_osc_rdma_component_t mca_osc_rdma_component = { .super = { .osc_version = { - OMPI_OSC_BASE_VERSION_3_0_0, + OMPI_OSC_BASE_VERSION_4_0_0, .mca_component_name = "rdma", MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION), @@ -368,7 +368,7 @@ int ompi_osc_rdma_component_finalize (void) } -static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor) { @@ -1315,7 +1315,7 @@ static int ompi_osc_rdma_create_groups (ompi_osc_rdma_module_t *module) * This function checks if all ranks have the same displacement unit or size and sets the appropriate * flags on the module. */ -static int ompi_osc_rdma_check_parameters (ompi_osc_rdma_module_t *module, int disp_unit, size_t size) +static int ompi_osc_rdma_check_parameters (ompi_osc_rdma_module_t *module, ptrdiff_t disp_unit, size_t size) { long values[4]; int ret; @@ -1351,7 +1351,7 @@ static int ompi_osc_rdma_check_parameters (ompi_osc_rdma_module_t *module, int d } -static int ompi_osc_rdma_component_select (struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int ompi_osc_rdma_component_select (struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model) { diff --git a/ompi/mca/osc/rdma/osc_rdma_peer.h b/ompi/mca/osc/rdma/osc_rdma_peer.h index ef8f8e0605c..cea680a44d3 100644 --- a/ompi/mca/osc/rdma/osc_rdma_peer.h +++ b/ompi/mca/osc/rdma/osc_rdma_peer.h @@ -101,7 +101,7 @@ struct ompi_osc_rdma_peer_extended_t { osc_rdma_size_t size; /** displacement unit */ - int disp_unit; + ptrdiff_t disp_unit; }; typedef struct ompi_osc_rdma_peer_extended_t ompi_osc_rdma_peer_extended_t; diff --git a/ompi/mca/osc/sm/osc_sm.h b/ompi/mca/osc/sm/osc_sm.h index b97329bfc63..363d3429a63 100644 --- a/ompi/mca/osc/sm/osc_sm.h +++ b/ompi/mca/osc/sm/osc_sm.h @@ -78,7 +78,7 @@ struct ompi_osc_sm_module_t { size_t *sizes; void **bases; - int *disp_units; + ptrdiff_t *disp_units; ompi_group_t *start_group; ompi_group_t *post_group; @@ -98,7 +98,7 @@ struct ompi_osc_sm_module_t { }; typedef struct ompi_osc_sm_module_t ompi_osc_sm_module_t; -int ompi_osc_sm_shared_query(struct ompi_win_t *win, int rank, size_t *size, int *disp_unit, void *baseptr); +int ompi_osc_sm_shared_query(struct ompi_win_t *win, int rank, size_t *size, ptrdiff_t *disp_unit, void *baseptr); int ompi_osc_sm_attach(struct ompi_win_t *win, void *base, size_t len); int ompi_osc_sm_detach(struct ompi_win_t *win, const void *base); @@ -106,29 +106,29 @@ int ompi_osc_sm_detach(struct ompi_win_t *win, const void *base); int ompi_osc_sm_free(struct ompi_win_t *win); int ompi_osc_sm_put(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); int ompi_osc_sm_get(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); int ompi_osc_sm_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win); @@ -150,58 +150,58 @@ int ompi_osc_sm_fetch_and_op(const void *origin_addr, struct ompi_win_t *win); int ompi_osc_sm_get_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, MPI_Aint target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win); int ompi_osc_sm_rput(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_sm_rget(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_sm_raccumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request); int ompi_osc_sm_rget_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_datatype, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, MPI_Aint target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win, diff --git a/ompi/mca/osc/sm/osc_sm_comm.c b/ompi/mca/osc/sm/osc_sm_comm.c index b6094dd16eb..bbd5873bf96 100644 --- a/ompi/mca/osc/sm/osc_sm_comm.c +++ b/ompi/mca/osc/sm/osc_sm_comm.c @@ -22,11 +22,11 @@ int ompi_osc_sm_rput(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **ompi_req) @@ -37,7 +37,7 @@ ompi_osc_sm_rput(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rput: 0x%lx, %d, %s, %d, %d, %d, %s, 0x%lx", + "rput: 0x%lx, %zu, %s, %d, %d, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -62,11 +62,11 @@ ompi_osc_sm_rput(const void *origin_addr, int ompi_osc_sm_rget(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **ompi_req) @@ -77,7 +77,7 @@ ompi_osc_sm_rget(void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rget: 0x%lx, %d, %s, %d, %d, %d, %s, 0x%lx", + "rget: 0x%lx, %zu, %s, %d, %d, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -102,11 +102,11 @@ ompi_osc_sm_rget(void *origin_addr, int ompi_osc_sm_raccumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, @@ -118,7 +118,7 @@ ompi_osc_sm_raccumulate(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "raccumulate: 0x%lx, %d, %s, %d, %d, %d, %s, %s, 0x%lx", + "raccumulate: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -150,14 +150,14 @@ ompi_osc_sm_raccumulate(const void *origin_addr, int ompi_osc_sm_rget_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_dt, int target, MPI_Aint target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, @@ -169,7 +169,7 @@ ompi_osc_sm_rget_accumulate(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "rget_accumulate: 0x%lx, %d, %s, %d, %d, %d, %s, %s, 0x%lx", + "rget_accumulate: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -207,11 +207,11 @@ ompi_osc_sm_rget_accumulate(const void *origin_addr, int ompi_osc_sm_put(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { @@ -221,7 +221,7 @@ ompi_osc_sm_put(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "put: 0x%lx, %d, %s, %d, %d, %d, %s, 0x%lx", + "put: 0x%lx, %zu, %s, %d, %d, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -238,11 +238,11 @@ ompi_osc_sm_put(const void *origin_addr, int ompi_osc_sm_get(void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { @@ -252,7 +252,7 @@ ompi_osc_sm_get(void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "get: 0x%lx, %d, %s, %d, %d, %d, %s, 0x%lx", + "get: 0x%lx, %zu, %s, %d, %d, %zu, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -269,11 +269,11 @@ ompi_osc_sm_get(void *origin_addr, int ompi_osc_sm_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) @@ -284,7 +284,7 @@ ompi_osc_sm_accumulate(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "accumulate: 0x%lx, %d, %s, %d, %d, %d, %s, %s, 0x%lx", + "accumulate: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, @@ -310,14 +310,14 @@ ompi_osc_sm_accumulate(const void *origin_addr, int ompi_osc_sm_get_accumulate(const void *origin_addr, - int origin_count, + size_t origin_count, struct ompi_datatype_t *origin_dt, void *result_addr, - int result_count, + size_t result_count, struct ompi_datatype_t *result_dt, int target, MPI_Aint target_disp, - int target_count, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) @@ -328,7 +328,7 @@ ompi_osc_sm_get_accumulate(const void *origin_addr, void *remote_address; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, - "get_accumulate: 0x%lx, %d, %s, %d, %d, %d, %s, %s, 0x%lx", + "get_accumulate: 0x%lx, %zu, %s, %d, %d, %zu, %s, %s, 0x%lx", (unsigned long) origin_addr, origin_count, origin_dt->name, target, (int) target_disp, target_count, target_dt->name, diff --git a/ompi/mca/osc/sm/osc_sm_component.c b/ompi/mca/osc/sm/osc_sm_component.c index 1c52eb17bb8..ae87b960a9d 100644 --- a/ompi/mca/osc/sm/osc_sm_component.c +++ b/ompi/mca/osc/sm/osc_sm_component.c @@ -38,18 +38,18 @@ static int component_open(void); static int component_init(bool enable_progress_threads, bool enable_mpi_threads); static int component_finalize(void); -static int component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor); static int component_register (void); -static int component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model); ompi_osc_sm_component_t mca_osc_sm_component = { { /* ompi_osc_base_component_t */ .osc_version = { - OMPI_OSC_BASE_VERSION_3_0_0, + OMPI_OSC_BASE_VERSION_4_0_0, .mca_component_name = "sm", MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION), @@ -163,7 +163,7 @@ component_finalize(void) static int -component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor) { @@ -190,7 +190,7 @@ component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, static int -component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model) { @@ -394,9 +394,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit opal_atomic_lock_init(&module->my_node_state->accumulate_lock, OPAL_ATOMIC_LOCK_UNLOCKED); /* share everyone's displacement units. */ - module->disp_units = malloc(sizeof(int) * comm_size); - ret = module->comm->c_coll->coll_allgather(&disp_unit, 1, MPI_INT, - module->disp_units, 1, MPI_INT, + module->disp_units = malloc(sizeof(ptrdiff_t) * comm_size); + ret = module->comm->c_coll->coll_allgather(&disp_unit, sizeof(ptrdiff_t), MPI_BYTE, + module->disp_units, sizeof(ptrdiff_t), MPI_BYTE, module->comm, module->comm->c_coll->coll_allgather_module); if (OMPI_SUCCESS != ret) goto error; @@ -475,7 +475,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit int -ompi_osc_sm_shared_query(struct ompi_win_t *win, int rank, size_t *size, int *disp_unit, void *baseptr) +ompi_osc_sm_shared_query(struct ompi_win_t *win, int rank, size_t *size, ptrdiff_t *disp_unit, void *baseptr) { ompi_osc_sm_module_t *module = (ompi_osc_sm_module_t*) win->w_osc_module; diff --git a/ompi/mca/osc/ucx/osc_ucx.h b/ompi/mca/osc/ucx/osc_ucx.h index 609acf280ec..1c349f30592 100644 --- a/ompi/mca/osc/ucx/osc_ucx.h +++ b/ompi/mca/osc/ucx/osc_ucx.h @@ -124,10 +124,10 @@ typedef struct ompi_osc_ucx_module { uint64_t *addrs; uint64_t *state_addrs; uint64_t *comm_world_ranks; - int disp_unit; /* if disp_unit >= 0, then everyone has the same - * disp unit size; if disp_unit == -1, then we - * need to look at disp_units */ - int *disp_units; + ptrdiff_t disp_unit; /* if disp_unit >= 0, then everyone has the same + * disp unit size; if disp_unit == -1, then we + * need to look at disp_units */ + ptrdiff_t *disp_units; ompi_osc_ucx_state_t state; /* remote accessible flags */ ompi_osc_local_dynamic_win_info_t local_dynamic_win_info[OMPI_OSC_UCX_ATTACH_MAX]; @@ -183,27 +183,27 @@ typedef struct ompi_osc_ucx_lock { extern size_t ompi_osc_ucx_outstanding_ops_flush_threshold; int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size, - int *disp_unit, void * baseptr); + ptrdiff_t *disp_unit, void * baseptr); int ompi_osc_ucx_win_attach(struct ompi_win_t *win, void *base, size_t len); int ompi_osc_ucx_win_detach(struct ompi_win_t *win, const void *base); int ompi_osc_ucx_free(struct ompi_win_t *win); -int ompi_osc_ucx_put(const void *origin_addr, int origin_count, +int ompi_osc_ucx_put(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); -int ompi_osc_ucx_get(void *origin_addr, int origin_count, +int ompi_osc_ucx_get(void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); -int ompi_osc_ucx_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win); -int ompi_osc_ucx_accumulate_nb(const void *origin_addr, int origin_count, +int ompi_osc_ucx_accumulate_nb(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win); int ompi_osc_ucx_compare_and_swap(const void *origin_addr, const void *compare_addr, @@ -214,40 +214,40 @@ int ompi_osc_ucx_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win); -int ompi_osc_ucx_get_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_get_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_datatype, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win); -int ompi_osc_ucx_get_accumulate_nb(const void *origin_addr, int origin_count, +int ompi_osc_ucx_get_accumulate_nb(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_datatype, int target_rank, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_datatype, + size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win); -int ompi_osc_ucx_rput(const void *origin_addr, int origin_count, +int ompi_osc_ucx_rput(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); -int ompi_osc_ucx_rget(void *origin_addr, int origin_count, +int ompi_osc_ucx_rget(void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request); -int ompi_osc_ucx_raccumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_raccumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request); -int ompi_osc_ucx_rget_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_rget_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_datatype, - int target_rank, ptrdiff_t target_disp, int target_count, + int target_rank, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request); diff --git a/ompi/mca/osc/ucx/osc_ucx_comm.c b/ompi/mca/osc/ucx/osc_ucx_comm.c index e7de9ec110f..86f82697995 100644 --- a/ompi/mca/osc/ucx/osc_ucx_comm.c +++ b/ompi/mca/osc/ucx/osc_ucx_comm.c @@ -133,11 +133,11 @@ static inline int create_iov_list(const void *addr, int count, ompi_datatype_t * } static inline int ddt_put_get(ompi_osc_ucx_module_t *module, - const void *origin_addr, int origin_count, + const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, bool is_origin_contig, ptrdiff_t origin_lb, int target, uint64_t remote_addr, - int target_count, struct ompi_datatype_t *target_dt, + size_t target_count, struct ompi_datatype_t *target_dt, bool is_target_contig, ptrdiff_t target_lb, bool is_get) { ucp_ep_h *ep; OSC_UCX_GET_DEFAULT_EP(ep, module, target); @@ -410,8 +410,8 @@ bool use_atomic_op( uint64_t remote_addr, struct ompi_datatype_t *origin_dt, struct ompi_datatype_t *target_dt, - int origin_count, - int target_count) + size_t origin_count, + size_t target_count) { size_t origin_dt_bytes; @@ -499,8 +499,8 @@ static int do_atomic_op_intrinsic( return ret; } -int ompi_osc_ucx_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, +int ompi_osc_ucx_put(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; opal_common_ucx_wpmem_t *mem = module->mem; @@ -550,9 +550,9 @@ int ompi_osc_ucx_put(const void *origin_addr, int origin_count, struct ompi_data } } -int ompi_osc_ucx_get(void *origin_addr, int origin_count, +int ompi_osc_ucx_get(void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; opal_common_ucx_wpmem_t *mem = module->mem; @@ -683,9 +683,9 @@ static inline int ompi_osc_ucx_acc_unlock(ompi_osc_ucx_module_t *module, int tar } static -int accumulate_req(const void *origin_addr, int origin_count, +int accumulate_req(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, ompi_osc_ucx_accumulate_request_t *ucx_req) { @@ -830,9 +830,9 @@ int accumulate_req(const void *origin_addr, int origin_count, return ompi_osc_ucx_acc_unlock(module, target, lock_acquired, free_ptr); } -int ompi_osc_ucx_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) { @@ -840,11 +840,11 @@ int ompi_osc_ucx_accumulate(const void *origin_addr, int origin_count, target_disp, target_count, target_dt, op, win, NULL); } -static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count, +static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, size_t stage_count, struct ompi_datatype_t *stage_dt, int target, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, bool lock_acquired, const void - *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, bool is_put, + *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, bool is_put, int phase, int acc_type) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; ucp_ep_h *ep; @@ -935,7 +935,7 @@ static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count, } static inline int ompi_osc_ucx_check_ops_and_flush (ompi_osc_ucx_module_t *module, - int target, ptrdiff_t target_disp, int target_count, struct + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, bool lock_acquired) { ptrdiff_t target_lb, target_extent; uint64_t base_tmp, tail_tmp; @@ -1040,10 +1040,10 @@ static inline int ompi_osc_ucx_check_ops_and_flush (ompi_osc_ucx_module_t *modul /* Nonblocking variant of accumulate. reduce+put happens inside completion call back * of rget */ -static int ompi_osc_ucx_get_accumulate_nonblocking(const void *origin_addr, int origin_count, - struct ompi_datatype_t *origin_dt, void *result_addr, int result_count, +static int ompi_osc_ucx_get_accumulate_nonblocking(const void *origin_addr, size_t origin_count, + struct ompi_datatype_t *origin_dt, void *result_addr, size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, int acc_type) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; int ret = OMPI_SUCCESS; @@ -1139,9 +1139,9 @@ static int ompi_osc_ucx_get_accumulate_nonblocking(const void *origin_addr, int return ret; } -int ompi_osc_ucx_accumulate_nb(const void *origin_addr, int origin_count, +int ompi_osc_ucx_accumulate_nb(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) { @@ -1308,12 +1308,12 @@ int ompi_osc_ucx_fetch_and_op(const void *origin_addr, void *result_addr, } static -int get_accumulate_req(const void *origin_addr, int origin_count, +int get_accumulate_req(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_dt, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, ompi_osc_ucx_accumulate_request_t *ucx_req) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; @@ -1461,12 +1461,12 @@ int get_accumulate_req(const void *origin_addr, int origin_count, return ompi_osc_ucx_acc_unlock(module, target, lock_acquired, free_addr); } -int ompi_osc_ucx_get_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_get_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_dt, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) { return get_accumulate_req(origin_addr, origin_count, origin_dt, result_addr, @@ -1474,12 +1474,12 @@ int ompi_osc_ucx_get_accumulate(const void *origin_addr, int origin_count, target_count, target_dt, op, win, NULL); } -int ompi_osc_ucx_get_accumulate_nb(const void *origin_addr, int origin_count, +int ompi_osc_ucx_get_accumulate_nb(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_dt, int target, ptrdiff_t target_disp, - int target_count, struct ompi_datatype_t *target_dt, + size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win) { return ompi_osc_ucx_get_accumulate_nonblocking(origin_addr, origin_count, origin_dt, @@ -1487,9 +1487,9 @@ int ompi_osc_ucx_get_accumulate_nb(const void *origin_addr, int origin_count, target_count, target_dt, op, win, GET_ACCUMULATE); } -int ompi_osc_ucx_rput(const void *origin_addr, int origin_count, +int ompi_osc_ucx_rput(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; @@ -1541,9 +1541,9 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count, return ret; } -int ompi_osc_ucx_rget(void *origin_addr, int origin_count, +int ompi_osc_ucx_rget(void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; @@ -1595,9 +1595,9 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count, return ret; } -int ompi_osc_ucx_raccumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_raccumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_dt, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; @@ -1625,11 +1625,11 @@ int ompi_osc_ucx_raccumulate(const void *origin_addr, int origin_count, return ret; } -int ompi_osc_ucx_rget_accumulate(const void *origin_addr, int origin_count, +int ompi_osc_ucx_rget_accumulate(const void *origin_addr, size_t origin_count, struct ompi_datatype_t *origin_datatype, - void *result_addr, int result_count, + void *result_addr, size_t result_count, struct ompi_datatype_t *result_datatype, - int target, ptrdiff_t target_disp, int target_count, + int target, ptrdiff_t target_disp, size_t target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request) { diff --git a/ompi/mca/osc/ucx/osc_ucx_component.c b/ompi/mca/osc/ucx/osc_ucx_component.c index ae999b45212..2b9142e4a36 100644 --- a/ompi/mca/osc/ucx/osc_ucx_component.c +++ b/ompi/mca/osc/ucx/osc_ucx_component.c @@ -50,9 +50,9 @@ static int component_close(void); static int component_register(void); static int component_init(bool enable_progress_threads, bool enable_mpi_threads); static int component_finalize(void); -static int component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor); -static int component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model); static void ompi_osc_ucx_unregister_progress(void); @@ -60,7 +60,7 @@ static void ompi_osc_ucx_unregister_progress(void); ompi_osc_ucx_component_t mca_osc_ucx_component = { { /* ompi_osc_base_component_t */ .osc_version = { - OMPI_OSC_BASE_VERSION_3_0_0, + OMPI_OSC_BASE_VERSION_4_0_0, .mca_component_name = "ucx", MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION), @@ -360,7 +360,7 @@ static int component_finalize(void) { return OMPI_SUCCESS; } -static int component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_query(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor) { int ret; if (mca_osc_ucx_component.priority_is_set == false) { @@ -462,7 +462,7 @@ static const char* ompi_osc_ucx_set_no_lock_info(opal_infosubscriber_t *obj, con } int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size, - int *disp_unit, void *baseptr) + ptrdiff_t *disp_unit, void *baseptr) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; @@ -502,7 +502,7 @@ int ompi_osc_ucx_shared_query(struct ompi_win_t *win, int rank, size_t *size, return OMPI_SUCCESS; } -static int component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit, +static int component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t disp_unit, struct ompi_communicator_t *comm, struct opal_info_t *info, int flavor, int *model) { ompi_osc_ucx_module_t *module = NULL; @@ -648,14 +648,14 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in module->disp_unit = disp_unit; } else { /* different disp_unit sizes, allocate O(p) space to store them */ module->disp_unit = -1; - module->disp_units = calloc(comm_size, sizeof(int)); + module->disp_units = calloc(comm_size, sizeof(ptrdiff_t)); if (module->disp_units == NULL) { ret = OMPI_ERR_TEMP_OUT_OF_RESOURCE; goto error; } - ret = module->comm->c_coll->coll_allgather(&disp_unit, 1, MPI_INT, - module->disp_units, 1, MPI_INT, + ret = module->comm->c_coll->coll_allgather(&disp_unit, sizeof(ptrdiff_t), MPI_BYTE, + module->disp_units, sizeof(ptrdiff_t), MPI_BYTE, module->comm, module->comm->c_coll->coll_allgather_module); if (OMPI_SUCCESS != ret) {