Skip to content
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
2 changes: 0 additions & 2 deletions opal/mca/btl/openib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ sources = \
btl_openib_async.h \
btl_openib_xrc.c \
btl_openib_xrc.h \
btl_openib_fd.h \
btl_openib_fd.c \
btl_openib_ip.h \
btl_openib_ip.c \
btl_openib_put.c \
Expand Down
24 changes: 3 additions & 21 deletions opal/mca/btl/openib/btl_openib.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,28 +638,10 @@ static int prepare_device_for_use (mca_btl_openib_device_t *device)
OBJ_CONSTRUCT(&device->qps[qp_index].recv_free, opal_free_list_t);
}

if(mca_btl_openib_component.use_async_event_thread) {
mca_btl_openib_async_cmd_t async_command = {.a_cmd = OPENIB_ASYNC_CMD_FD_ADD,
.fd = device->ib_dev_context->async_fd,
.qp = NULL};
device->got_fatal_event = false;
device->got_port_event = false;
mca_btl_openib_async_add_device (device);

/* start the async even thread if it is not already started */
if (start_async_event_thread() != OPAL_SUCCESS)
return OPAL_ERROR;

device->got_fatal_event = false;
device->got_port_event = false;
if (write(mca_btl_openib_component.async_pipe[1],
&async_command, sizeof(mca_btl_openib_async_cmd_t))<0){
BTL_ERROR(("Failed to write to pipe [%d]",errno));
return OPAL_ERROR;
}
/* wait for ok from thread */
if (OPAL_SUCCESS !=
btl_openib_async_command_done(device->ib_dev_context->async_fd)) {
return OPAL_ERROR;
}
}
#if OPAL_ENABLE_PROGRESS_THREADS == 1
/* Prepare data for thread, but not starting it */
OBJ_CONSTRUCT(&device->thread, opal_thread_t);
Expand Down
16 changes: 13 additions & 3 deletions opal/mca/btl/openib/btl_openib.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "opal/mca/mpool/mpool.h"
#include "opal/mca/btl/base/btl_base_error.h"
#include "opal/mca/btl/base/base.h"
#include "opal/runtime/opal_progress_threads.h"

#include "connect/connect.h"

Expand Down Expand Up @@ -227,9 +228,7 @@ struct mca_btl_openib_component_t {
int apm_ports;
unsigned int buffer_alignment; /**< Preferred communication buffer alignment in Bytes (must be power of two) */
int32_t error_counter; /**< Counts number on error events that we got on all devices */
int async_pipe[2]; /**< Pipe for comunication with async event thread */
int async_comp_pipe[2]; /**< Pipe for async thread comunication with main thread */
pthread_t async_thread; /**< Async thread that will handle fatal errors */
opal_event_base_t *async_evbase; /**< Async event base */
bool use_async_event_thread; /**< Use the async event handler */
mca_btl_openib_srq_manager_t srq_manager; /**< Hash table for all BTL SRQs */
#if BTL_OPENIB_FAILOVER_ENABLED
Expand Down Expand Up @@ -410,6 +409,8 @@ typedef struct mca_btl_openib_device_t {
uint64_t mem_reg_max, mem_reg_active;
/* Device is ready for use */
bool ready_for_use;
/* Async event */
opal_event_t async_event;
} mca_btl_openib_device_t;
OBJ_CLASS_DECLARATION(mca_btl_openib_device_t);

Expand Down Expand Up @@ -907,6 +908,15 @@ static inline int qp_cq_prio(const int qp)
#define BTL_OPENIB_RDMA_QP(QP) \
((QP) == mca_btl_openib_component.rdma_qp)

/**
* Run function as part of opal_progress()
*
* @param[in] fn function to run
* @param[in] arg function data
*/
int mca_btl_openib_run_in_main (void *(*fn)(void *), void *arg);


END_C_DECLS

#endif /* MCA_BTL_IB_H */
Loading