Skip to content

Commit dd4d49c

Browse files
committed
Merge pull request #1278 from ggouaillardet/poc/osc_pt2pt
osc/pt2pt: use two distinct "namespaces" for tags
2 parents 955fe85 + 06ecdb6 commit dd4d49c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ struct ompi_osc_pt2pt_module_t {
150150

151151
/** cyclic counter for a unique tage for long messages. */
152152
unsigned int tag_counter;
153+
unsigned int rtag_counter;
153154

154155
/* Number of outgoing fragments that have completed since the
155156
begining of time */
@@ -659,11 +660,22 @@ static inline int get_tag(ompi_osc_pt2pt_module_t *module)
659660
completion). */
660661
int tmp = module->tag_counter + !!(module->passive_target_access_epoch);
661662

662-
module->tag_counter = (module->tag_counter + 2) & OSC_PT2PT_FRAG_MASK;
663+
module->tag_counter = (module->tag_counter + 4) & OSC_PT2PT_FRAG_MASK;
663664

664665
return tmp;
665666
}
666667

668+
static inline int get_rtag(ompi_osc_pt2pt_module_t *module)
669+
{
670+
/* the LSB of the tag is used be the receiver to determine if the
671+
message is a passive or active target (ie, where to mark
672+
completion). */
673+
int tmp = module->rtag_counter + !!(module->passive_target_access_epoch);
674+
675+
module->rtag_counter = (module->rtag_counter + 4) & OSC_PT2PT_FRAG_MASK;
676+
677+
return tmp;
678+
}
667679
/**
668680
* ompi_osc_pt2pt_accumulate_lock:
669681
*

ompi/mca/osc/pt2pt/osc_pt2pt_comm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ ompi_osc_pt2pt_accumulate_w_req (const void *origin_addr, int origin_count,
475475
}
476476

477477
is_long_msg = true;
478-
tag = get_tag (module);
478+
tag = get_rtag (module);
479479
}
480480

481481
/* flush will be called at the end of this function. make sure all post messages have

ompi/mca/osc/pt2pt/osc_pt2pt_component.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
290290
/* fill in the function pointer part */
291291
memcpy(module, &ompi_osc_pt2pt_module_template,
292292
sizeof(ompi_osc_base_module_t));
293+
module->rtag_counter = 2;
293294

294295
/* initialize the objects, so that always free in cleanup */
295296
OBJ_CONSTRUCT(&module->lock, opal_mutex_t);

0 commit comments

Comments
 (0)