Skip to content

osc/pt2pt: use two distinct "namespaces" for tags #1278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ompi/mca/osc/pt2pt/osc_pt2pt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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:
*
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/osc/pt2pt/osc_pt2pt_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/osc/pt2pt/osc_pt2pt_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down