From 41c886399bb621b99743a320bf6a9a3aadff1e27 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Mon, 26 Jun 2006 20:00:18 +0000 Subject: [PATCH] Don't let the user to specify flags which does not make sense. If the PUT flag is specified check that the put function is available for the BTL. Same safe check for the GET function. At the end make sure that at least on communication protocol is specified, otherwise force the send flag. This commit was SVN r10507. --- ompi/mca/bml/r2/bml_r2.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ompi/mca/bml/r2/bml_r2.c b/ompi/mca/bml/r2/bml_r2.c index 8a7dc6a7ac..ea1194f3ad 100644 --- a/ompi/mca/bml/r2/bml_r2.c +++ b/ompi/mca/bml/r2/bml_r2.c @@ -300,10 +300,30 @@ int mca_bml_r2_add_procs( bml_btl->btl_prepare_src = btl->btl_prepare_src; bml_btl->btl_prepare_dst = btl->btl_prepare_dst; bml_btl->btl_send = btl->btl_send; - bml_btl->btl_put = btl->btl_put; - bml_btl->btl_get = btl->btl_get; bml_btl->btl_flags = btl->btl_flags; + bml_btl->btl_put = btl->btl_put; + if( (bml_btl->btl_flags & MCA_BTL_FLAGS_PUT) && (NULL == bml_btl->btl_put) ) { + opal_output(0, "mca_bml_r2_add_procs: The PUT flag is specified for" + " the %s BTL without any PUT function attached. Disard the flag !", + bml_btl->btl->btl_component->btl_version.mca_component_name); + bml_btl->btl_flags ^= MCA_BTL_FLAGS_PUT; + } + bml_btl->btl_get = btl->btl_get; + if( (bml_btl->btl_flags & MCA_BTL_FLAGS_GET) && (NULL == bml_btl->btl_get) ) { + opal_output(0, "mca_bml_r2_add_procs: The GET flag is specified for" + " the %s BTL without any GET function attached. Disard the flag !", + bml_btl->btl->btl_component->btl_version.mca_component_name); + bml_btl->btl_flags ^= MCA_BTL_FLAGS_GET; + } bml_btl->btl_mpool = btl->btl_mpool; + if( (bml_btl->btl_flags & (MCA_BTL_FLAGS_PUT | MCA_BTL_FLAGS_GET | MCA_BTL_FLAGS_SEND)) == 0 ) { + /** + * If no protocol specified, we have 2 choices: we ignore the BTL + * as we don't know which protocl to use, or we suppose that all + * BTLs support the send protocol. + */ + bml_btl->btl_flags |= MCA_BTL_FLAGS_SEND; + } } } if(btl_inuse > 0 && NULL != btl->btl_component->btl_progress) {