diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt.h b/ompi/mca/osc/pt2pt/osc_pt2pt.h index 51b14b7057..1f3c204502 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt.h @@ -150,6 +150,7 @@ struct ompi_osc_pt2pt_module_t { /** cyclic counter for a unique tage for long messages. */ unsigned int tag_counter; + unsigned int rtag_counter; /* Number of outgoing fragments that have completed since the begining of time */ @@ -659,11 +660,22 @@ static inline int get_tag(ompi_osc_pt2pt_module_t *module) completion). */ int tmp = module->tag_counter + !!(module->passive_target_access_epoch); - module->tag_counter = (module->tag_counter + 2) & OSC_PT2PT_FRAG_MASK; + module->tag_counter = (module->tag_counter + 4) & OSC_PT2PT_FRAG_MASK; return tmp; } +static inline int get_rtag(ompi_osc_pt2pt_module_t *module) +{ + /* the LSB of the tag is used be the receiver to determine if the + message is a passive or active target (ie, where to mark + completion). */ + int tmp = module->rtag_counter + !!(module->passive_target_access_epoch); + + module->rtag_counter = (module->rtag_counter + 4) & OSC_PT2PT_FRAG_MASK; + + return tmp; +} /** * ompi_osc_pt2pt_accumulate_lock: * diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c index 5bb3a070cf..b22f7837bf 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c @@ -475,7 +475,7 @@ ompi_osc_pt2pt_accumulate_w_req (const void *origin_addr, int origin_count, } is_long_msg = true; - tag = get_tag (module); + tag = get_rtag (module); } /* flush will be called at the end of this function. make sure all post messages have diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c index 6a8f53ebc8..41bbe187b5 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c @@ -290,6 +290,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit /* fill in the function pointer part */ memcpy(module, &ompi_osc_pt2pt_module_template, sizeof(ompi_osc_base_module_t)); + module->rtag_counter = 2; /* initialize the objects, so that always free in cleanup */ OBJ_CONSTRUCT(&module->lock, opal_mutex_t);