From 08747dcaf8ca12846ec96e073a19258fd2fd7bcf Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Mon, 13 Feb 2006 15:59:54 +0000 Subject: [PATCH] * Throttle the number of incoming receives so that we don't overrun our receive event queue and lose receive messages. This commit was SVN r9006. --- ompi/mca/btl/portals/btl_portals_component.c | 5 +++-- ompi/mca/btl/portals/btl_portals_recv.h | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ompi/mca/btl/portals/btl_portals_component.c b/ompi/mca/btl/portals/btl_portals_component.c index 002d2026cd..e98c99b57a 100644 --- a/ompi/mca/btl/portals/btl_portals_component.c +++ b/ompi/mca/btl/portals/btl_portals_component.c @@ -205,7 +205,7 @@ mca_btl_portals_component_open(void) &dummy); mca_btl_portals_module.super.btl_bandwidth = dummy; -#if 0 +#if 1 mca_btl_portals_module.super.btl_flags = MCA_BTL_FLAGS_RDMA | MCA_BTL_FLAGS_SEND_INPLACE; #else mca_btl_portals_module.super.btl_flags = MCA_BTL_FLAGS_RDMA; @@ -472,7 +472,8 @@ mca_btl_portals_component_progress(void) OPAL_OUTPUT_VERBOSE((90, mca_btl_portals_component.portals_output, "received send fragment %x", frag)); - if (ev.md.length - (ev.offset + ev.mlength) < ev.md.max_size) { + if (ev.md.length - (ev.offset + ev.mlength) < ev.md.max_size || + ev.md.threshold == 0) { /* the block is full. It's deactivated automagically, but we can't start it up again until everyone is done with it. The actual reactivation and all that will happen after the diff --git a/ompi/mca/btl/portals/btl_portals_recv.h b/ompi/mca/btl/portals/btl_portals_recv.h index 75f1727bc5..0b7e8161da 100644 --- a/ompi/mca/btl/portals/btl_portals_recv.h +++ b/ompi/mca/btl/portals/btl_portals_recv.h @@ -94,7 +94,10 @@ mca_btl_portals_activate_block(mca_btl_portals_recv_block_t *block) /* and the memory descriptor */ md.start = block->start; md.length = block->length; - md.threshold = PTL_MD_THRESH_INF; + /* try to throttle incoming sends so that we don't overrun the incoming + queue size */ + md.threshold = mca_btl_portals_module.portals_eq_sizes[OMPI_BTL_PORTALS_EQ] / + mca_btl_portals_module.portals_recv_mds_num; md.max_size = block->btl->super.btl_max_send_size; md.options = PTL_MD_OP_PUT | PTL_MD_MAX_SIZE; md.user_ptr = block;