diff --git a/ompi/mca/btl/gm/btl_gm.c b/ompi/mca/btl/gm/btl_gm.c index a7fd572896..2e605aa118 100644 --- a/ompi/mca/btl/gm/btl_gm.c +++ b/ompi/mca/btl/gm/btl_gm.c @@ -650,16 +650,30 @@ int mca_btl_gm_send( } /* post the send request */ - gm_send_with_callback( - gm_btl->port, - frag->hdr, - frag->size, - frag->segment.seg_len + sizeof(mca_btl_base_header_t), - GM_LOW_PRIORITY, - endpoint->endpoint_addr.node_id, - endpoint->endpoint_addr.port_id, - mca_btl_gm_send_callback, - frag); + if(frag->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY && + frag->size == mca_btl_gm_component.gm_eager_frag_size) { + gm_send_with_callback( + gm_btl->port, + frag->hdr, + mca_btl_gm_component.gm_eager_frag_size, + frag->segment.seg_len + sizeof(mca_btl_base_header_t), + GM_HIGH_PRIORITY, + endpoint->endpoint_addr.node_id, + endpoint->endpoint_addr.port_id, + mca_btl_gm_send_callback, + frag); + } else { + gm_send_with_callback( + gm_btl->port, + frag->hdr, + mca_btl_gm_component.gm_max_frag_size, + frag->segment.seg_len + sizeof(mca_btl_base_header_t), + GM_LOW_PRIORITY, + endpoint->endpoint_addr.node_id, + endpoint->endpoint_addr.port_id, + mca_btl_gm_send_callback, + frag); + } if(opal_list_get_size(&gm_btl->gm_repost)) { mca_btl_gm_frag_t* frag; diff --git a/ompi/mca/btl/gm/btl_gm_component.c b/ompi/mca/btl/gm/btl_gm_component.c index 5dea99e946..bce40ab60b 100644 --- a/ompi/mca/btl/gm/btl_gm_component.c +++ b/ompi/mca/btl/gm/btl_gm_component.c @@ -145,9 +145,9 @@ int mca_btl_gm_component_open(void) mca_btl_gm_module.super.btl_max_send_size = mca_btl_gm_param_register_int ("max_send_size", 64*1024); mca_btl_gm_module.super.btl_min_rdma_size = - mca_btl_gm_param_register_int("min_rdma_size", 256*1024); + mca_btl_gm_param_register_int("min_rdma_size", 128*1024); mca_btl_gm_module.super.btl_max_rdma_size = - mca_btl_gm_param_register_int("max_rdma_size", 256*1024); + mca_btl_gm_param_register_int("max_rdma_size", 128*1024); #if OMPI_MCA_BTL_GM_SUPPORT_REGISTERING && OMPI_MCA_BTL_GM_HAVE_RDMA_PUT mca_btl_gm_module.super.btl_flags = mca_btl_gm_param_register_int("flags", MCA_BTL_FLAGS_RDMA); @@ -273,8 +273,8 @@ mca_btl_gm_module_init (mca_btl_gm_module_t * btl) frag->base.des_src_cnt = 0; frag->base.des_dst = &frag->segment; frag->base.des_dst_cnt = 1; - frag->priority = GM_LOW_PRIORITY; - gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, GM_LOW_PRIORITY); + frag->priority = GM_HIGH_PRIORITY; + gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, frag->priority); } for(i=mca_btl_gm_component.gm_num_high_priority; igm_max_recv_tokens; i++) { @@ -288,7 +288,7 @@ mca_btl_gm_module_init (mca_btl_gm_module_t * btl) frag->base.des_dst = &frag->segment; frag->base.des_dst_cnt = 1; frag->priority = GM_LOW_PRIORITY; - gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, GM_LOW_PRIORITY); + gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, frag->priority); } /* enable rdma */ @@ -489,13 +489,11 @@ int mca_btl_gm_component_progress() unsigned char* buffer = (unsigned char*)gm_ntohp(event->recv.buffer); mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)(buffer - sizeof(mca_btl_gm_frag_t)); mca_btl_base_header_t* hdr; - uint32_t priority = GM_HIGH_PRIORITY; /* If there are no receive events just skip the function call */ switch(gm_ntohc(event->recv.type)) { case GM_FAST_RECV_EVENT: case GM_FAST_PEER_RECV_EVENT: - priority = GM_LOW_PRIORITY; case GM_FAST_HIGH_RECV_EVENT: case GM_FAST_HIGH_PEER_RECV_EVENT: { @@ -511,7 +509,6 @@ int mca_btl_gm_component_progress() } case GM_RECV_EVENT: case GM_PEER_RECV_EVENT: - priority = GM_LOW_PRIORITY; case GM_HIGH_RECV_EVENT: case GM_HIGH_PEER_RECV_EVENT: { diff --git a/ompi/mca/btl/gm/btl_gm_frag.h b/ompi/mca/btl/gm/btl_gm_frag.h index 9fb6f8541f..156638bf58 100644 --- a/ompi/mca/btl/gm/btl_gm_frag.h +++ b/ompi/mca/btl/gm/btl_gm_frag.h @@ -116,7 +116,7 @@ do { \ } else { \ OPAL_THREAD_LOCK(&btl->gm_lock); \ do { \ - gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, priority); \ + gm_provide_receive_buffer(btl->port, frag->hdr, frag->size, frag->priority); \ } while (NULL != (frag = (mca_btl_gm_frag_t*)opal_list_remove_first(&btl->gm_repost))); \ OPAL_THREAD_UNLOCK(&btl->gm_lock); \ } \