From 8bd3160432db505a82d04154832949cc9b6f130b Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Tue, 23 Sep 2014 20:25:36 +0000 Subject: [PATCH] btl/vader: fix several typos in vader update This commit was SVN r32775. --- opal/mca/btl/vader/btl_vader_endpoint.h | 2 +- opal/mca/btl/vader/btl_vader_fbox.h | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/opal/mca/btl/vader/btl_vader_endpoint.h b/opal/mca/btl/vader/btl_vader_endpoint.h index 3d5b8abcd1..763ae80055 100644 --- a/opal/mca/btl/vader/btl_vader_endpoint.h +++ b/opal/mca/btl/vader/btl_vader_endpoint.h @@ -99,7 +99,6 @@ static inline void mca_btl_vader_endpoint_setup_fbox_recv (struct mca_btl_base_e { endpoint->fbox_in.buffer = base; endpoint->fbox_in.startp = (uint32_t *) base; - endpoint->fbox_in.startp[0] = MCA_BTL_VADER_FBOX_ALIGNMENT; endpoint->fbox_in.start = MCA_BTL_VADER_FBOX_ALIGNMENT; endpoint->fbox_in.seq = 0; } @@ -110,6 +109,7 @@ static inline void mca_btl_vader_endpoint_setup_fbox_send (struct mca_btl_base_e endpoint->fbox_out.start = MCA_BTL_VADER_FBOX_ALIGNMENT; endpoint->fbox_out.end = MCA_BTL_VADER_FBOX_ALIGNMENT; endpoint->fbox_out.startp = (uint32_t *) base; + endpoint->fbox_out.startp[0] = MCA_BTL_VADER_FBOX_ALIGNMENT; endpoint->fbox_out.seq = 0; /* zero out the first header in the fast box */ diff --git a/opal/mca/btl/vader/btl_vader_fbox.h b/opal/mca/btl/vader/btl_vader_fbox.h index 1adf80ef30..9d210adac5 100644 --- a/opal/mca/btl/vader/btl_vader_fbox.h +++ b/opal/mca/btl/vader/btl_vader_fbox.h @@ -198,8 +198,8 @@ static inline bool mca_btl_vader_check_fboxes (void) /* force all prior reads to complete before continuing */ opal_atomic_rmb (); - BTL_VERBOSE(("got frag with header {.tag = %d, .size = %d} from offset %u", hdr.data.tag, - hdr.data.size, start)); + BTL_VERBOSE(("got frag from %d with header {.tag = %d, .size = %d, .seq = %u} from offset %u", + ep->peer_smp_rank, hdr.data.tag, hdr.data.size, hdr.data.seq, start)); /* the 0xff tag indicates we should skip the rest of the buffer */ if (OPAL_LIKELY((0xfe & hdr.data.tag) != 0xfe)) { @@ -250,13 +250,13 @@ static inline bool mca_btl_vader_check_fboxes (void) static inline void mca_btl_vader_try_fbox_setup (mca_btl_base_endpoint_t *ep, mca_btl_vader_hdr_t *hdr) { - if (NULL == ep->fbox_out.buffer && mca_btl_vader_component.fbox_max > mca_btl_vader_component.fbox_count && - mca_btl_vader_component.fbox_threshold <= ++ep->send_count) { + if (NULL == ep->fbox_out.buffer && mca_btl_vader_component.fbox_threshold == ++ep->send_count) { /* protect access to mca_btl_vader_component.segment_offset */ OPAL_THREAD_LOCK(&mca_btl_vader_component.lock); - if (mca_btl_vader_component.segment_size >= mca_btl_vader_component.segment_offset + mca_btl_vader_component.fbox_size) { + if (mca_btl_vader_component.segment_size >= mca_btl_vader_component.segment_offset + mca_btl_vader_component.fbox_size && + mca_btl_vader_component.fbox_max > mca_btl_vader_component.fbox_count) { /* verify the remote side will accept another fbox */ if (0 <= opal_atomic_add_32 (&ep->fifo->fbox_available, -1)) { void *fbox_base = mca_btl_vader_component.my_segment + mca_btl_vader_component.segment_offset; @@ -272,6 +272,8 @@ static inline void mca_btl_vader_try_fbox_setup (mca_btl_base_endpoint_t *ep, mc } else { opal_atomic_add_32 (&ep->fifo->fbox_available, 1); } + + opal_atomic_wmb (); } OPAL_THREAD_UNLOCK(&mca_btl_vader_component.lock);