1
1

A checkpoint before I really do some cleanup.. nothing pretty here.

Playing around with OPAL_LIKELY/UNLIKELY, no real gains yet.

Reworked progress() to process many WC's at a time, as well
as immediately repost groups of receive buffers.

This commit was SVN r10481.
Этот коммит содержится в:
Andrew Friedley 2006-06-22 18:06:55 +00:00
родитель 76926756d0
Коммит 8392ed4cac
5 изменённых файлов: 146 добавлений и 185 удалений

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

@ -21,6 +21,7 @@
#include "ompi_config.h"
#include <string.h>
#include <inttypes.h>
#include "opal/prefetch.h"
#include "opal/util/output.h"
#include "opal/util/if.h"
#include "ompi/mca/pml/pml.h"
@ -186,7 +187,7 @@ mca_btl_base_descriptor_t* mca_btl_ud_alloc(
mca_btl_ud_frag_t* frag;
int rc;
if(size <= mca_btl_ud_component.eager_limit){
if(size <= mca_btl_ud_component.eager_limit) {
MCA_BTL_IB_FRAG_ALLOC_EAGER(btl, frag, rc);
frag->segment.seg_len = size;
} else if(size <= mca_btl_ud_component.max_send_size) {
@ -196,6 +197,11 @@ mca_btl_base_descriptor_t* mca_btl_ud_alloc(
return NULL;
}
/* TODO - how much of this is needed? */
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
return (mca_btl_base_descriptor_t*)frag;
}
@ -214,10 +220,8 @@ int mca_btl_ud_free(struct mca_btl_base_module_t* btl,
if(frag->size == 0) {
btl->btl_mpool->mpool_release(btl->btl_mpool,
(mca_mpool_base_registration_t*)
frag->ud_reg);
(mca_mpool_base_registration_t*)frag->ud_reg);
MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag);
}
else if(frag->size == mca_btl_ud_component.max_send_size){
MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag);
@ -275,10 +279,8 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
ud_btl = (mca_btl_ud_module_t*) btl;
ud_reg = (mca_mpool_openib_registration_t*) registration;
if(NULL != ud_reg && 0 == ompi_convertor_need_buffers(convertor)){
size_t reg_len;
/* the memory is already pinned and we have contiguous user data */
if(OPAL_UNLIKELY(NULL != ud_reg && 0 == ompi_convertor_need_buffers(convertor))) {
/* the memory is already pinned and we have contiguous user data */
MCA_BTL_IB_FRAG_ALLOC_FRAG(btl, frag, rc);
if(NULL == frag){
@ -288,17 +290,15 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
iov.iov_len = max_data;
iov.iov_base = NULL;
ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data, &free_after);
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
reg_len = (unsigned char*)ud_reg->base_reg.bound - (unsigned char*)iov.iov_base + 1;
frag->sg_entry.length = max_data;
/*frag->sg_entry.length = max_data;*/
frag->sg_entry.lkey = ud_reg->mr->lkey;
frag->sg_entry.addr = (unsigned long) iov.iov_base;
frag->sg_entry.addr = (unsigned long)iov.iov_base;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
@ -306,44 +306,40 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->ud_reg = ud_reg;
btl->btl_mpool->mpool_retain(btl->btl_mpool, (mca_mpool_base_registration_t*) ud_reg);
btl->btl_mpool->mpool_retain(btl->btl_mpool, registration);
return &frag->base;
} else if( max_data > btl->btl_max_send_size &&
ompi_convertor_need_buffers(convertor) == 0 &&
reserve == 0) {
/* The user buffer is contigous and we are asked to send more than the max send size. */
} else if(OPAL_UNLIKELY(max_data > btl->btl_max_send_size &&
ompi_convertor_need_buffers(convertor) == 0 && reserve == 0)) {
/* The user buffer is contigous and we are asked to send more than
the max send size. */
MCA_BTL_IB_FRAG_ALLOC_FRAG(btl, frag, rc);
if(NULL == frag){
if(NULL == frag) {
return NULL;
}
iov.iov_len = max_data;
iov.iov_base = NULL;
ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data, &free_after);
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
frag->base.des_flags = 0;
rc = btl->btl_mpool->mpool_register(btl->btl_mpool,
iov.iov_base,
max_data,
0,
(mca_mpool_base_registration_t**) &ud_reg);
rc = btl->btl_mpool->mpool_register(btl->btl_mpool, iov.iov_base,
max_data, 0, (mca_mpool_base_registration_t**) &ud_reg);
if(OMPI_SUCCESS != rc || NULL == ud_reg) {
BTL_ERROR(("mpool_register(%p,%lu) failed", iov.iov_base, max_data));
BTL_ERROR(("mpool_register(%p,%lu) failed",
iov.iov_base, max_data));
MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag);
return NULL;
}
frag->sg_entry.length = max_data;
/*frag->sg_entry.length = max_data;*/
frag->sg_entry.lkey = ud_reg->mr->lkey;
frag->sg_entry.addr = (unsigned long) iov.iov_base;
frag->base.des_src = &frag->segment;
@ -351,54 +347,56 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->ud_reg = ud_reg;
return &frag->base;
} else
if (max_data+reserve <= btl->btl_eager_limit) {
if (max_data + reserve <= btl->btl_eager_limit) {
/* the data is small enough to fit in the eager frag and
either we received no prepinned memory or leave pinned is
not set
*/
not set */
MCA_BTL_IB_FRAG_ALLOC_EAGER(btl, frag, rc);
if(NULL == frag) {
if(OPAL_UNLIKELY(NULL == frag)) {
return NULL;
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*)frag->segment.seg_addr.pval + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
*size = max_data;
if( rc < 0 ) {
rc = ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data, &free_after);
if(OPAL_UNLIKELY(rc < 0)) {
MCA_BTL_IB_FRAG_RETURN_EAGER(btl, frag);
return NULL;
}
frag->segment.seg_len = max_data + reserve;
frag->sg_entry.length = max_data + reserve + sizeof(mca_btl_ud_header_t);
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
*size = max_data;
return &frag->base;
} else {
MCA_BTL_IB_FRAG_ALLOC_MAX(btl, frag, rc);
if(NULL == frag) {
if(OPAL_UNLIKELY(NULL == frag)) {
return NULL;
}
if(max_data + reserve > btl->btl_max_send_size){
if(OPAL_UNLIKELY(max_data + reserve > btl->btl_max_send_size)) {
max_data = btl->btl_max_send_size - reserve;
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*)frag->segment.seg_addr.pval + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
*size = max_data;
if( rc < 0 ) {
rc = ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data, &free_after);
if(OPAL_UNLIKELY(rc < 0)) {
MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag);
return NULL;
}
@ -409,6 +407,7 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags=0;
*size = max_data;
return &frag->base;
}
@ -418,9 +417,6 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
int mca_btl_ud_finalize(struct mca_btl_base_module_t* btl)
{
mca_btl_ud_module_t* ud_btl;
ud_btl = (mca_btl_ud_module_t*) btl;
return OMPI_SUCCESS;
}
@ -438,6 +434,7 @@ int mca_btl_ud_send(
int rc;
mca_btl_ud_frag_t* frag = (mca_btl_ud_frag_t*)descriptor;
OPAL_PREFETCH(frag, 1, 1);
MCA_BTL_UD_START_TIME(post_send);
frag->endpoint = endpoint;
frag->hdr->tag = tag;

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

@ -21,6 +21,7 @@
#include "ompi_config.h"
#include "ompi/constants.h"
#include "opal/prefetch.h"
#include "opal/event/event.h"
#include "opal/util/if.h"
#include "opal/util/argv.h"
@ -261,7 +262,7 @@ mca_btl_base_module_t** mca_btl_ud_component_init(int *num_btl_modules,
{
struct ibv_device **ib_devs;
struct ibv_device* ib_dev;
int32_t num_devs;
int32_t num_devs, rc;
mca_btl_base_module_t** btls;
uint32_t i,j, length;
struct mca_mpool_base_resources_t mpool_resources;
@ -502,13 +503,14 @@ mca_btl_base_module_t** mca_btl_ud_component_init(int *num_btl_modules,
/* Post receive descriptors */
do {
int32_t i;
int rc;
struct ibv_recv_wr* bad_wr;
for(i = 0; i < ud_btl->rd_num; i++) {
for(j = 0; j < (uint32_t)ud_btl->rd_num; j++) {
mca_btl_ud_frag_t* frag;
OMPI_FREE_LIST_WAIT(&ud_btl->recv_free_eager, frag, rc);
ompi_free_list_item_t* item;
OMPI_FREE_LIST_WAIT(&ud_btl->recv_free_eager, item, rc);
frag = (mca_btl_ud_frag_t*)item;
frag->sg_entry.length = frag->size +
sizeof(mca_btl_ud_header_t) +
sizeof(mca_btl_ud_ib_header_t);
@ -519,7 +521,9 @@ mca_btl_base_module_t** mca_btl_ud_component_init(int *num_btl_modules,
return NULL;
}
OMPI_FREE_LIST_WAIT(&ud_btl->recv_free_max, frag, rc);
OMPI_FREE_LIST_WAIT(&ud_btl->recv_free_max, item, rc);
frag = (mca_btl_ud_frag_t*)item;
frag->sg_entry.length = frag->size +
sizeof(mca_btl_ud_header_t) +
sizeof(mca_btl_ud_ib_header_t);
@ -564,203 +568,162 @@ mca_btl_base_module_t** mca_btl_ud_component_init(int *num_btl_modules,
}
static inline int mca_btl_ud_handle_incoming_hp(mca_btl_ud_module_t *,
mca_btl_ud_frag_t *, size_t);
static inline int mca_btl_ud_handle_incoming_hp(
mca_btl_ud_module_t *ud_btl,
mca_btl_ud_frag_t *frag,
size_t byte_len)
{
struct ibv_recv_wr* bad_wr;
/* advance the segment address past the header and adjust the length..*/
frag->segment.seg_addr.pval = frag->hdr + 1;
frag->segment.seg_len = byte_len -
sizeof(mca_btl_ud_header_t) - sizeof(mca_btl_ud_ib_header_t);
/* call registered callback */
ud_btl->ib_reg[frag->hdr->tag].cbfunc(&ud_btl->super,
frag->hdr->tag, &frag->base,
ud_btl->ib_reg[frag->hdr->tag].cbdata);
/* TODO - not resetting segment values here.. problem? */
if(ibv_post_recv(ud_btl->qp_hp, &frag->wr_desc.rd_desc, &bad_wr)) {
BTL_ERROR(("error posting recv, errno %s\n", strerror(errno)));
return OMPI_ERROR;
}
#if 0
OMPI_FREE_LIST_RETURN(&(ud_btl->recv_free_eager),
(opal_list_item_t*) frag);
/* repost receive descriptors */
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
if(mca_btl_ud_component.use_srq) {
OPAL_THREAD_ADD32((int32_t*) &ud_btl->srd_posted_hp, -1);
MCA_BTL_UD_POST_SRR_HIGH(ud_btl, 0);
} else {
#endif
OPAL_THREAD_ADD32((int32_t*) &ud_btl->rd_posted_hp, -1);
MCA_BTL_UD_ENDPOINT_POST_RR_HIGH(ud_btl, 0);
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
}
#endif
#endif
return OMPI_SUCCESS;
}
/*
* IB component progress.
*/
#define MCA_BTL_UD_NUM_WC 64
int mca_btl_ud_component_progress()
{
uint32_t i;
int count = 0,ne = 0, ret;
int count = 0, ne, j;
mca_btl_ud_frag_t* frag;
struct ibv_recv_wr* bad_wr;
struct ibv_recv_wr* head_wr;
mca_btl_ud_module_t* ud_btl;
mca_btl_base_recv_reg_t* reg;
struct ibv_wc wc[MCA_BTL_UD_NUM_WC];
/* Poll for completions */
for(i = 0; i < mca_btl_ud_component.ib_num_btls; i++) {
struct ibv_wc wc;
mca_btl_ud_module_t* ud_btl = &mca_btl_ud_component.ud_btls[i];
ud_btl = &mca_btl_ud_component.ud_btls[i];
ne=ibv_poll_cq(ud_btl->ib_cq_hp, 1, &wc);
if(ne < 0 ) {
ne = ibv_poll_cq(ud_btl->ib_cq_hp, MCA_BTL_UD_NUM_WC, wc);
if(OPAL_UNLIKELY(ne < 0)) {
BTL_ERROR(("error polling HP CQ with %d errno says %s\n",
ne, strerror(errno)));
return OMPI_ERROR;
}
else if(1 == ne) {
if(wc.status != IBV_WC_SUCCESS) {
head_wr = NULL;
for(j = 0; j < ne; j++) {
if(OPAL_UNLIKELY(wc[j].status != IBV_WC_SUCCESS)) {
BTL_ERROR(("error polling HP CQ with status %d for wr_id %llu opcode %d\n",
wc.status, wc.wr_id, wc.opcode));
wc[j].status, wc[j].wr_id, wc[j].opcode));
return OMPI_ERROR;
}
/* Handle work completions */
switch(wc.opcode) {
switch(wc[j].opcode) {
case IBV_WC_SEND :
frag = (mca_btl_ud_frag_t*)(unsigned long)wc.wr_id;
frag = (mca_btl_ud_frag_t*)(unsigned long)wc[j].wr_id;
#if MCA_BTL_UD_ENABLE_PROFILE
mca_btl_ud_profile.avg_full_send +=
opal_sys_timer_get_cycles() - frag->tm;
mca_btl_ud_profile.cnt_full_send++;
#endif
/* Process a completed send */
frag->base.des_cbfunc(&ud_btl->super,
frag->endpoint, &frag->base, OMPI_SUCCESS);
/* Increment send counter, post if any sends are queued */
OPAL_THREAD_ADD32(&ud_btl->sd_wqe_hp, 1);
if(!opal_list_is_empty(&ud_btl->pending_frags_hp)) {
if(OPAL_UNLIKELY(!opal_list_is_empty(&ud_btl->pending_frags_hp))) {
frag = (mca_btl_ud_frag_t*)
opal_list_remove_first(&ud_btl->pending_frags_hp);
mca_btl_ud_endpoint_post_send(ud_btl, frag->endpoint, frag);
}
count++;
break;
case IBV_WC_RECV:
/* Process a RECV */
frag = (mca_btl_ud_frag_t*)(unsigned long) wc.wr_id;
ret = mca_btl_ud_handle_incoming_hp(ud_btl, frag, wc.byte_len);
frag = (mca_btl_ud_frag_t*)(unsigned long) wc[j].wr_id;
reg = &ud_btl->ib_reg[frag->hdr->tag];
if (ret != OMPI_SUCCESS)
return ret;
count++;
frag->segment.seg_addr.pval = frag->hdr + 1;
frag->segment.seg_len = wc[j].byte_len -
sizeof(mca_btl_ud_header_t) -
sizeof(mca_btl_ud_ib_header_t);
reg->cbfunc(&ud_btl->super,
frag->hdr->tag, &frag->base, reg->cbdata);
/* Add recv to linked list for reposting */
frag->wr_desc.rd_desc.next = head_wr;
head_wr = &frag->wr_desc.rd_desc;
break;
default:
BTL_ERROR(("Unhandled work completion opcode is %d", wc.opcode));
BTL_ERROR(("Unhandled work completion opcode is %d", wc[j].opcode));
break;
}
}
ne=ibv_poll_cq(ud_btl->ib_cq_lp, 1, &wc );
if(ne < 0){
count += ne;
/* Repost any HP recv buffers all at once */
if(OPAL_LIKELY(head_wr)) {
if(OPAL_UNLIKELY(ibv_post_recv(ud_btl->qp_hp, head_wr, &bad_wr))) {
BTL_ERROR(("error posting recv, errno %s\n", strerror(errno)));
return OMPI_ERROR;
}
head_wr = NULL;
}
ne = ibv_poll_cq(ud_btl->ib_cq_lp, MCA_BTL_UD_NUM_WC, wc);
if(OPAL_UNLIKELY(ne < 0)){
BTL_ERROR(("error polling LP CQ with %d errno says %s",
ne, strerror(errno)));
return OMPI_ERROR;
}
else if(1 == ne) {
if(wc.status != IBV_WC_SUCCESS) {
for(j = 0; j < ne; j++) {
if(OPAL_UNLIKELY(wc[j].status != IBV_WC_SUCCESS)) {
BTL_ERROR(("error polling LP CQ with status %d for wr_id %llu opcode %d",
wc.status, wc.wr_id, wc.opcode));
wc[j].status, wc[j].wr_id, wc[j].opcode));
return OMPI_ERROR;
}
/* Handle n/w completions */
switch(wc.opcode) {
switch(wc[j].opcode) {
case IBV_WC_SEND:
frag = (mca_btl_ud_frag_t*) (unsigned long) wc.wr_id;
frag = (mca_btl_ud_frag_t*) (unsigned long) wc[j].wr_id;
/* Process a completed send - receiver must return tokens */
frag->base.des_cbfunc(&ud_btl->super,
frag->endpoint, &frag->base, OMPI_SUCCESS);
/* Increment send counter, post if any sends are queued */
OPAL_THREAD_ADD32(&ud_btl->sd_wqe_lp, 1);
if(!opal_list_is_empty(&ud_btl->pending_frags_lp)) {
if(OPAL_UNLIKELY(!opal_list_is_empty(&ud_btl->pending_frags_lp))) {
frag = (mca_btl_ud_frag_t*)
opal_list_remove_first(&ud_btl->pending_frags_lp);
mca_btl_ud_endpoint_post_send(ud_btl, frag->endpoint, frag);
}
count++;
break;
case IBV_WC_RECV:
/* Process a RECV */
frag = (mca_btl_ud_frag_t*) (unsigned long) wc.wr_id;
frag = (mca_btl_ud_frag_t*) (unsigned long) wc[j].wr_id;
reg = &ud_btl->ib_reg[frag->hdr->tag];
frag->segment.seg_addr.pval = frag->hdr + 1;
frag->segment.seg_len =
wc.byte_len - sizeof(mca_btl_ud_header_t) -
wc[j].byte_len - sizeof(mca_btl_ud_header_t) -
sizeof(mca_btl_ud_ib_header_t);
/* call registered callback */
ud_btl->ib_reg[frag->hdr->tag].cbfunc(&ud_btl->super,
frag->hdr->tag, &frag->base,
ud_btl->ib_reg[frag->hdr->tag].cbdata);
if(ibv_post_recv(ud_btl->qp_lp,
&frag->wr_desc.rd_desc, &bad_wr)) {
BTL_ERROR(("error posting recv, errno %s\n",
strerror(errno)));
return OMPI_ERROR;
}
#if 0
OMPI_FREE_LIST_RETURN(
&(ud_btl->recv_free_max), (opal_list_item_t*) frag);
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
if(mca_btl_ud_component.use_srq) {
/* repost receive descriptors */
OPAL_THREAD_ADD32((int32_t*) &ud_btl->srd_posted_lp, -1);
MCA_BTL_UD_POST_SRR_LOW(ud_btl, 0);
} else {
#endif
/* repost receive descriptors */
OPAL_THREAD_ADD32((int32_t*) &ud_btl->rd_posted_lp, -1);
MCA_BTL_UD_ENDPOINT_POST_RR_LOW(ud_btl, 0);
#ifdef OMPI_MCA_BTL_OPENIB_HAVE_SRQ
}
#endif
#endif
count++;
reg->cbfunc(&ud_btl->super,
frag->hdr->tag, &frag->base, reg->cbdata);
/* Add recv to linked list for reposting */
frag->wr_desc.rd_desc.next = head_wr;
head_wr = &frag->wr_desc.rd_desc;
break;
default:
BTL_ERROR(("Unhandled work completion opcode %d", wc.opcode));
BTL_ERROR(("Unhandled work completion opcode %d", wc[j].opcode));
break;
}
}
count += ne;
/* Repost any LP recv buffers all at once */
if(OPAL_LIKELY(head_wr)) {
if(OPAL_UNLIKELY(ibv_post_recv(ud_btl->qp_lp, head_wr, &bad_wr))) {
BTL_ERROR(("error posting recv, errno %s\n", strerror(errno)));
return OMPI_ERROR;
}
}
}
return count;

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

@ -22,6 +22,7 @@
#include "ompi_config.h"
#include <sys/time.h>
#include <time.h>
#include "opal/prefetch.h"
#include "ompi/types.h"
#include "ompi/mca/pml/base/pml_base_sendreq.h"
#include "orte/mca/ns/base/base.h"
@ -51,6 +52,7 @@ inline int mca_btl_ud_endpoint_post_send(mca_btl_ud_module_t* ud_btl,
{
struct ibv_qp* ib_qp;
struct ibv_send_wr* bad_wr;
int rc;
/* Have to be careful here - UD adds a 40 byte header, but it is not
included on the sending side. */
@ -58,7 +60,7 @@ inline int mca_btl_ud_endpoint_post_send(mca_btl_ud_module_t* ud_btl,
frag->wr_desc.sr_desc.send_flags = IBV_SEND_SIGNALED;
if(frag->size == ud_btl->super.btl_eager_limit) {
if(OPAL_THREAD_ADD32(&ud_btl->sd_wqe_hp, -1) < 0) {
if(OPAL_UNLIKELY(OPAL_THREAD_ADD32(&ud_btl->sd_wqe_hp, -1) < 0)) {
OPAL_THREAD_ADD32(&ud_btl->sd_wqe_hp, 1);
opal_list_append(&ud_btl->pending_frags_hp,
(opal_list_item_t*)frag);
@ -75,7 +77,7 @@ inline int mca_btl_ud_endpoint_post_send(mca_btl_ud_module_t* ud_btl,
IBV_SEND_SIGNALED|IBV_SEND_INLINE;
}
} else {
if(OPAL_THREAD_ADD32(&ud_btl->sd_wqe_lp, -1) < 0) {
if(OPAL_UNLIKELY(OPAL_THREAD_ADD32(&ud_btl->sd_wqe_lp, -1) < 0)) {
OPAL_THREAD_ADD32(&ud_btl->sd_wqe_lp, 1);
opal_list_append(&ud_btl->pending_frags_lp,
(opal_list_item_t*)frag);
@ -98,7 +100,7 @@ inline int mca_btl_ud_endpoint_post_send(mca_btl_ud_module_t* ud_btl,
#endif
MCA_BTL_UD_START_TIME(ibv_post_send);
if(ibv_post_send(ib_qp, &frag->wr_desc.sr_desc, &bad_wr)) {
if(OPAL_UNLIKELY(ibv_post_send(ib_qp, &frag->wr_desc.sr_desc, &bad_wr) != 0)) {
BTL_ERROR(("error posting send request errno says %d %s\n",
errno, strerror(errno)));
return OMPI_ERROR;
@ -427,9 +429,8 @@ int mca_btl_ud_endpoint_send(mca_btl_base_endpoint_t* endpoint,
bool call_progress = false;
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
switch(endpoint->endpoint_state) {
case MCA_BTL_IB_CONNECTED:
{
if(OPAL_LIKELY(endpoint->endpoint_state == MCA_BTL_IB_CONNECTED)) {
MCA_BTL_UD_START_TIME(endpoint_send_conn);
rc = mca_btl_ud_endpoint_post_send(
endpoint->endpoint_btl, endpoint, frag);
@ -437,6 +438,8 @@ int mca_btl_ud_endpoint_send(mca_btl_base_endpoint_t* endpoint,
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
return rc;
}
switch(endpoint->endpoint_state) {
case MCA_BTL_IB_CLOSED:
/* Send connection info over to remote endpoint */
endpoint->endpoint_state = MCA_BTL_IB_CONNECTING;

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

@ -70,7 +70,6 @@ typedef enum {
} mca_btl_ud_endpoint_state_t;
struct mca_btl_ud_rem_info_t {
uint32_t rem_qp_num_hp;
uint32_t rem_qp_num_lp;
/* Remote QP number (Low and High priority) */
@ -78,7 +77,6 @@ struct mca_btl_ud_rem_info_t {
uint16_t rem_lid;
/* Local identifier of the remote process */
uint32_t rem_psn_hp;
uint32_t rem_psn_lp;
/* Remote processes port sequence number (Low and High) */
@ -119,7 +117,7 @@ struct mca_btl_base_endpoint_t {
struct ibv_ah* rmt_ah_hp;
struct ibv_ah* rmt_ah_lp;
/* Local Address Handle (Low and High) */
/* Remote Address Handle (Low and High) */
uint16_t subnet; /**< subnet of this endpoint*/
};

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

@ -103,42 +103,42 @@ OBJ_CLASS_DECLARATION(mca_btl_ud_recv_frag_max_t);
#define MCA_BTL_IB_FRAG_ALLOC_EAGER(btl, frag, rc) \
{ \
\
opal_list_item_t *item; \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_ud_module_t*)btl)->send_free_eager, item, rc); \
frag = (mca_btl_ud_frag_t*) item; \
}
#define MCA_BTL_IB_FRAG_RETURN_EAGER(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_eager, (opal_list_item_t*)(frag)); \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_eager, (ompi_free_list_item_t*)(frag)); \
}
#define MCA_BTL_IB_FRAG_ALLOC_MAX(btl, frag, rc) \
{ \
\
opal_list_item_t *item; \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_ud_module_t*)btl)->send_free_max, item, rc); \
frag = (mca_btl_ud_frag_t*) item; \
}
#define MCA_BTL_IB_FRAG_RETURN_MAX(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_max, (opal_list_item_t*)(frag)); \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_max, (ompi_free_list_item_t*)(frag)); \
}
#define MCA_BTL_IB_FRAG_ALLOC_FRAG(btl, frag, rc) \
{ \
\
opal_list_item_t *item; \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_ud_module_t*)btl)->send_free_frag, item, rc); \
frag = (mca_btl_ud_frag_t*) item; \
}
#define MCA_BTL_IB_FRAG_RETURN_FRAG(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_frag, (opal_list_item_t*)(frag)); \
OMPI_FREE_LIST_RETURN(&((mca_btl_ud_module_t*)btl)->send_free_frag, (ompi_free_list_item_t*)(frag)); \
}