Skip to content
Closed
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
2 changes: 2 additions & 0 deletions opal/mca/btl/vader/btl_vader_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,12 @@ static int mca_btl_vader_component_progress (void)
}
}

#if OPAL_BTL_VADER_FBOX_SUPPORT
/* check for messages in fast boxes */
if (mca_btl_vader_component.num_fbox_in_endpoints) {
count = mca_btl_vader_check_fboxes ();
}
#endif

mca_btl_vader_progress_endpoints ();

Expand Down
6 changes: 2 additions & 4 deletions opal/mca/btl/vader/btl_vader_fbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* $HEADER$
*/

#if !defined(MCA_BTL_VADER_FBOX_H)
#if !defined(MCA_BTL_VADER_FBOX_H) && OPAL_BTL_VADER_FBOX_SUPPORT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor nit: OPAL_BTL_VADER_FBOX_SUPPORT won't be defined until opal_config.h was previously included. If btl_vader_fbox.h is the first file included, then that macro won't be defined.

I realize that our coding guidelines say "always include opal_config.h first!", but sometimes people don't/forget to do that.

Do you want to put an #include "opal_config.h" here at the top of btl_vader_fbox.h to cover all the bases / be defensive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll get a compiler error if you include fbox.h before opal_config.h, because we error on undefined preprocessor define behavior. So I don't think it's worth being over defensive here.

#define MCA_BTL_VADER_FBOX_H

#include "btl_vader.h"
Expand Down Expand Up @@ -45,8 +45,6 @@ typedef union mca_btl_vader_fbox_hdr_t {
/** macro for checking if the high bit is set */
#define MCA_BTL_VADER_FBOX_OFFSET_HBS(v) (!!((v) & MCA_BTL_VADER_FBOX_HB_MASK))

void mca_btl_vader_poll_handle_frag (mca_btl_vader_hdr_t *hdr, mca_btl_base_endpoint_t *ep);

static inline void mca_btl_vader_fbox_set_header (mca_btl_vader_fbox_hdr_t *hdr, uint16_t tag,
uint16_t seq, uint32_t size)
{
Expand Down Expand Up @@ -279,4 +277,4 @@ static inline void mca_btl_vader_try_fbox_setup (mca_btl_base_endpoint_t *ep, mc
}
}

#endif /* !defined(MCA_BTL_VADER_FBOX_H) */
#endif /* !defined(MCA_BTL_VADER_FBOX_H) && OPAL_BTL_VADER_FBOX_SUPPORT */
2 changes: 2 additions & 0 deletions opal/mca/btl/vader/btl_vader_fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,15 @@ static inline void vader_fifo_write (vader_fifo_t *fifo, fifo_value_t value)
static inline bool vader_fifo_write_ep (mca_btl_vader_hdr_t *hdr, struct mca_btl_base_endpoint_t *ep)
{
fifo_value_t rhdr = virtual2relative ((char *) hdr);
#if OPAL_BTL_VADER_FBOX_SUPPORT
if (ep->fbox_out.buffer) {
/* if there is a fast box for this peer then use the fast box to send the fragment header.
* this is done to ensure fragment ordering */
opal_atomic_wmb ();
return mca_btl_vader_fbox_sendi (ep, 0xfe, &rhdr, sizeof (rhdr), NULL, 0);
}
mca_btl_vader_try_fbox_setup (ep, hdr);
#endif
hdr->next = VADER_FIFO_FREE;
vader_fifo_write (ep->fifo, rhdr);

Expand Down
2 changes: 2 additions & 0 deletions opal/mca/btl/vader/btl_vader_frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@ mca_btl_vader_rdma_frag_alloc (mca_btl_base_module_t *btl, mca_btl_base_endpoint
return frag;
}

void mca_btl_vader_poll_handle_frag (mca_btl_vader_hdr_t *hdr, mca_btl_base_endpoint_t *ep);

#endif /* MCA_BTL_VADER_SEND_FRAG_H */
1 change: 0 additions & 1 deletion opal/mca/btl/vader/btl_vader_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "btl_vader.h"
#include "btl_vader_frag.h"
#include "btl_vader_fifo.h"
#include "btl_vader_fbox.h"

/**
* Initiate a send to the peer.
Expand Down
4 changes: 4 additions & 0 deletions opal/mca/btl/vader/btl_vader_sendi.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ int mca_btl_vader_sendi (struct mca_btl_base_module_t *btl,
mca_btl_base_descriptor_t **descriptor)
{
mca_btl_vader_frag_t *frag;
#if OPAL_BTL_VADER_FBOX_SUPPORT
void *data_ptr = NULL;
#endif
size_t length;

/* don't attempt sendi if there are pending fragments on the endpoint */
Expand All @@ -58,6 +60,7 @@ int mca_btl_vader_sendi (struct mca_btl_base_module_t *btl,
return OPAL_ERR_OUT_OF_RESOURCE;
}

#if OPAL_BTL_VADER_FBOX_SUPPORT
if (payload_size) {
opal_convertor_get_current_pointer (convertor, &data_ptr);
}
Expand All @@ -66,6 +69,7 @@ int mca_btl_vader_sendi (struct mca_btl_base_module_t *btl,
mca_btl_vader_fbox_sendi (endpoint, tag, header, header_size, data_ptr, payload_size)) {
return OPAL_SUCCESS;
}
#endif

length = header_size + payload_size;

Expand Down
14 changes: 14 additions & 0 deletions opal/mca/btl/vader/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ AC_DEFUN([MCA_opal_btl_vader_CONFIG],[

OPAL_VAR_SCOPE_PUSH([btl_vader_xpmem_happy btl_vader_cma_happy btl_vader_knem_happy])

# check for fbox support
AC_ARG_ENABLE([vader-fbox-support],
[AC_HELP_STRING([--disable-vader-fbox-support],
[Disable fastbox support in vader shared memory btl (default: enabled)])])
AC_MSG_CHECKING([whether to enable fastbox support])
AS_IF([test "$enable_vader_fbox_support" != "no"],
[AC_MSG_RESULT([yes])
OPAL_BTL_VADER_FBOX_SUPPORT=1],
[AC_MSG_RESULT([no])
OPAL_BTL_VADER_FBOX_SUPPORT=0])
AC_DEFINE_UNQUOTED([OPAL_BTL_VADER_FBOX_SUPPORT],
[$OPAL_BTL_VADER_FBOX_SUPPORT],
[Enable fastbox support in vader btl])

# Check for single-copy APIs

OPAL_CHECK_XPMEM([btl_vader], [btl_vader_xpmem_happy=1], [btl_vader_xpmem_happy=0])
Expand Down