1
1

Add heterogeneous support to message coalescing.

This commit was SVN r16903.
Этот коммит содержится в:
Gleb Natapov 2007-12-09 14:10:25 +00:00
родитель b4698dc6df
Коммит 493951e09d
3 изменённых файлов: 37 добавлений и 21 удалений

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

@ -607,6 +607,8 @@ mca_btl_base_descriptor_t* mca_btl_openib_alloc(
clsc_hdr->tag = org_tag;
clsc_hdr->size = to_base_frag(sfrag)->segment.seg_len;
clsc_hdr->alloc_size = to_base_frag(sfrag)->segment.seg_len;
if(ep->nbo)
BTL_OPENIB_HEADER_COALESCED_HTON(*clsc_hdr);
sfrag->coalesced_length = sizeof(mca_btl_openib_control_header_t) +
sizeof(mca_btl_openib_header_coalesced_t);
to_com_frag(sfrag)->sg_entry.addr = (uint64_t)sfrag->hdr;
@ -1073,6 +1075,8 @@ int mca_btl_openib_send(
if(openib_frag_type(des) == MCA_BTL_OPENIB_FRAG_COALESCED) {
to_coalesced_frag(des)->hdr->tag = tag;
to_coalesced_frag(des)->hdr->size = des->des_src->seg_len;
if(ep->nbo)
BTL_OPENIB_HEADER_COALESCED_HTON(*to_coalesced_frag(des)->hdr);
frag = to_coalesced_frag(des)->send_frag;
} else {
frag = to_send_frag(des);

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

@ -257,12 +257,17 @@ static void btl_openib_control(mca_btl_base_module_t* btl,
break;
case MCA_BTL_OPENIB_CONTROL_COALESCED:
while(len > 0) {
size_t skip = (sizeof(*clsc_hdr) + clsc_hdr->alloc_size);
size_t skip;
mca_btl_base_descriptor_t tmp_des;
mca_btl_base_segment_t tmp_seg;
assert(len >= sizeof(*clsc_hdr));
if(ep->nbo)
BTL_OPENIB_HEADER_COALESCED_NTOH(*clsc_hdr);
skip = (sizeof(*clsc_hdr) + clsc_hdr->alloc_size);
tmp_des.des_dst = &tmp_seg;
tmp_des.des_dst_cnt = 1;
tmp_seg.seg_addr.pval = clsc_hdr + 1;

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

@ -59,6 +59,18 @@ typedef struct mca_btl_openib_header_coalesced_t {
uint32_t alloc_size;
} mca_btl_openib_header_coalesced_t;
#define BTL_OPENIB_HEADER_COALESCED_NTOH(h) \
do { \
(h).size = ntohl((h).size); \
(h).alloc_size = ntohl((h).alloc_size); \
} while(0)
#define BTL_OPENIB_HEADER_COALESCED_HTON(h) \
do { \
(h).size = htonl((h).size); \
(h).alloc_size = htonl((h).alloc_size); \
} while(0)
struct mca_btl_openib_footer_t {
#if OMPI_ENABLE_DEBUG
uint32_t seq;
@ -82,29 +94,24 @@ typedef struct mca_btl_openib_footer_t mca_btl_openib_footer_t;
#endif
#if OMPI_ENABLE_DEBUG
#define BTL_OPENIB_FOOTER_HTON(h) \
do { \
(h).seq = htonl((h).seq); \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define BTL_OPENIB_FOOTER_NTOH(h) \
do { \
(h).seq = ntohl((h).seq); \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define BTL_OPENIB_FOOTER_SEQ_HTON(h) ((h).seq = htonl((h).seq))
#define BTL_OPENIB_FOOTER_SEQ_NTOH(h) ((h).seq = ntohl((h).seq))
#else
#define BTL_OPENIB_FOOTER_HTON(h) \
do { \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define BTL_OPENIB_FOOTER_NTOH(h) \
do { \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define BTL_OPENIB_FOOTER_SEQ_HTON(h)
#define BTL_OPENIB_FOOTER_SEQ_NTOH(h)
#endif
#define BTL_OPENIB_FOOTER_HTON(h) \
do { \
BTL_OPENIB_FOOTER_SEQ_HTON(h); \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define BTL_OPENIB_FOOTER_NTOH(h) \
do { \
BTL_OPENIB_FOOTER_SEQ_NTOH(h); \
MCA_BTL_OPENIB_FTR_SIZE_REVERSE(h); \
} while (0)
#define MCA_BTL_OPENIB_CONTROL_CREDITS 0
#define MCA_BTL_OPENIB_CONTROL_RDMA 1