1
1

usnic: update to API change in libfabric

Этот коммит содержится в:
Jeff Squyres 2015-03-31 03:18:54 -07:00
родитель 5e47eb81bf
Коммит 26b3c48ccb

Просмотреть файл

@ -1050,6 +1050,7 @@ static int usnic_component_progress(void)
assert(channel->chan_deferred_recv == NULL); assert(channel->chan_deferred_recv == NULL);
int ret = fi_cq_read(channel->cq, &completion, 1); int ret = fi_cq_read(channel->cq, &completion, 1);
assert(0 != ret);
if (OPAL_LIKELY(1 == ret)) { if (OPAL_LIKELY(1 == ret)) {
opal_memchecker_base_mem_defined(&completion, opal_memchecker_base_mem_defined(&completion,
sizeof(completion)); sizeof(completion));
@ -1063,7 +1064,7 @@ static int usnic_component_progress(void)
count += usnic_handle_completion(module, channel, count += usnic_handle_completion(module, channel,
&completion); &completion);
} }
} else if (OPAL_LIKELY(0 == ret)) { } else if (OPAL_LIKELY(-FI_EAGAIN == ret)) {
continue; continue;
} }
else { else {
@ -1194,7 +1195,7 @@ usnic_handle_cq_error(opal_btl_usnic_module_t* module,
static int usnic_component_progress_2(void) static int usnic_component_progress_2(void)
{ {
int i, j, count = 0, num_events; int i, j, count = 0, num_events, ret;
opal_btl_usnic_module_t* module; opal_btl_usnic_module_t* module;
static struct fi_cq_entry completions[OPAL_BTL_USNIC_NUM_COMPLETIONS]; static struct fi_cq_entry completions[OPAL_BTL_USNIC_NUM_COMPLETIONS];
opal_btl_usnic_channel_t *channel; opal_btl_usnic_channel_t *channel;
@ -1218,16 +1219,20 @@ static int usnic_component_progress_2(void)
channel->chan_deferred_recv = NULL; channel->chan_deferred_recv = NULL;
} }
num_events = fi_cq_read(channel->cq, completions, ret = fi_cq_read(channel->cq, completions,
OPAL_BTL_USNIC_NUM_COMPLETIONS); OPAL_BTL_USNIC_NUM_COMPLETIONS);
opal_memchecker_base_mem_defined(&num_events, sizeof(num_events)); assert(0 != ret);
opal_memchecker_base_mem_defined(completions, opal_memchecker_base_mem_defined(&ret, sizeof(ret));
sizeof(completions[0]) * if (OPAL_UNLIKELY(ret < 0 && -FI_EAGAIN != ret)) {
num_events);
if (OPAL_UNLIKELY(num_events < 0)) {
usnic_handle_cq_error(module, channel, num_events); usnic_handle_cq_error(module, channel, num_events);
num_events = 0;
} else {
num_events = ret;
} }
opal_memchecker_base_mem_defined(completions,
sizeof(completions[0]) *
ret);
/* Handle each event */ /* Handle each event */
for (j = 0; j < num_events; j++) { for (j = 0; j < num_events; j++) {
count += usnic_handle_completion(module, channel, count += usnic_handle_completion(module, channel,