From 2a59b2a68f8579840d4eaa5fce9dae94cdd49248 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Tue, 11 Dec 2007 13:10:52 +0000 Subject: [PATCH] 1. Set segments length in prepare_src() after packing because actual size may be smaller then allocated size. 2. If reserve zero don't allocate coalesced frag since it will be RDMAed, not send. The logic was other way around. This commit was SVN r16928. --- ompi/mca/btl/openib/btl_openib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ompi/mca/btl/openib/btl_openib.c b/ompi/mca/btl/openib/btl_openib.c index 798071953d..7c043f56f4 100644 --- a/ompi/mca/btl/openib/btl_openib.c +++ b/ompi/mca/btl/openib/btl_openib.c @@ -785,8 +785,9 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src( } frag = (mca_btl_openib_com_frag_t*)(reserve ? - ib_frag_alloc(openib_btl, max_data + reserve, order, flags) : - mca_btl_openib_alloc(btl, endpoint, order, max_data, flags)); + mca_btl_openib_alloc(btl, endpoint, order, max_data + reserve, + flags) : + ib_frag_alloc(openib_btl, max_data, order, flags)); if(NULL == frag) return NULL; @@ -798,6 +799,9 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src( *size = max_data; + /* not all upper layer users set this */ + to_base_frag(frag)->segment.seg_len = max_data + reserve; + return &to_base_frag(frag)->base; }