diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c index 66ca9bb9d5..97fed19d73 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c @@ -61,6 +61,11 @@ ompi_osc_pt2pt_module_accumulate(void *origin_addr, int origin_count, return MPI_ERR_UNSUPPORTED_OPERATION; } + /* shortcut 0 count case */ + if (0 == origin_count || 0 == target_count) { + return OMPI_SUCCESS; + } + /* create sendreq */ ret = ompi_osc_pt2pt_sendreq_alloc_init(OMPI_OSC_PT2PT_ACC, origin_addr, @@ -102,6 +107,11 @@ ompi_osc_pt2pt_module_get(void *origin_addr, OMPI_WIN_EXPOSE_EPOCH); } + /* shortcut 0 count case */ + if (0 == origin_count || 0 == target_count) { + return OMPI_SUCCESS; + } + /* create sendreq */ ret = ompi_osc_pt2pt_sendreq_alloc_init(OMPI_OSC_PT2PT_GET, origin_addr, @@ -137,6 +147,11 @@ ompi_osc_pt2pt_module_put(void *origin_addr, int origin_count, OMPI_WIN_EXPOSE_EPOCH); } + /* shortcut 0 count case */ + if (0 == origin_count || 0 == target_count) { + return OMPI_SUCCESS; + } + /* create sendreq */ ret = ompi_osc_pt2pt_sendreq_alloc_init(OMPI_OSC_PT2PT_PUT, origin_addr, diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_sendreq.c b/ompi/mca/osc/pt2pt/osc_pt2pt_sendreq.c index f4bc7d3fb2..8a621adc6a 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_sendreq.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_sendreq.c @@ -33,11 +33,6 @@ ompi_osc_pt2pt_sendreq_alloc_init(ompi_osc_pt2pt_req_type_t req_type, { int ret; - /* shortcut 0 count case */ - if (0 == origin_count || 0 == target_count) { - return OMPI_SUCCESS; - } - /* allocate a sendreq */ ret = ompi_osc_pt2pt_sendreq_alloc(module, target, sendreq);