From 379a4ec5e21efbac599a98ee82b9c6ffbd23f320 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 24 May 2007 13:01:55 +0000 Subject: [PATCH] While we're editing MCA params in the oob tcp component, ditch the use of the deprecated MCA param API for registering MCA parameters and update to the current API. This commit was SVN r14747. --- orte/mca/oob/tcp/oob_tcp.c | 65 +++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/orte/mca/oob/tcp/oob_tcp.c b/orte/mca/oob/tcp/oob_tcp.c index b6d473083c..2ac041272f 100644 --- a/orte/mca/oob/tcp/oob_tcp.c +++ b/orte/mca/oob/tcp/oob_tcp.c @@ -161,32 +161,6 @@ static mca_oob_t mca_oob_tcp = { mca_oob_tcp_registry_callback }; -/* - * Utility function to register/lookup module parameters. - */ - -static inline int mca_oob_tcp_param_register_int( - const char* param_name, - int default_value) -{ - int id = mca_base_param_register_int("oob","tcp",param_name,NULL,default_value); - int param_value = default_value; - mca_base_param_lookup_int(id,¶m_value); - return param_value; -} - - -static inline char* mca_oob_tcp_param_register_str( - const char* param_name, - const char* default_value) -{ - int id = mca_base_param_register_string("oob","tcp",param_name,NULL,default_value); - char* param_value = NULL; - mca_base_param_lookup_string(id,¶m_value); - return param_value; -} - - /* * Initialize global variables used w/in this module. */ @@ -236,16 +210,35 @@ int mca_oob_tcp_component_open(void) OBJ_CONSTRUCT(&mca_oob_tcp_component.tcp_pending_connections_lock, opal_mutex_t); /* register oob module parameters */ - mca_oob_tcp_component.tcp_peer_limit = - mca_oob_tcp_param_register_int("peer_limit", -1); - mca_oob_tcp_component.tcp_peer_retries = - mca_oob_tcp_param_register_int("peer_retries", 60); - mca_oob_tcp_component.tcp_debug = - mca_oob_tcp_param_register_int("debug", 0); - mca_oob_tcp_component.tcp_sndbuf = - mca_oob_tcp_param_register_int("sndbuf", 128*1024); - mca_oob_tcp_component.tcp_rcvbuf = - mca_oob_tcp_param_register_int("rcvbuf", 128*1024); + mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base, + "peer_limit", + "Maximum number of peer connections to simultaneously maintain (-1 = infinite)", + false, false, -1, + &mca_oob_tcp_component.tcp_peer_limit); + + mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base, + "peer_retries", + "Number of times to try shutting down a connection before giving up", + false, false, 60, + &mca_oob_tcp_component.tcp_peer_retries); + + mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base, + "debug", + "Enable (1) / disable (0) debugging output for this component", + false, false, 0, + &mca_oob_tcp_component.tcp_debug); + + mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base, + "sndbuf", + "TCP socket send buffering size (in bytes)", + false, false, 128 * 1024, + &mca_oob_tcp_component.tcp_sndbuf); + + mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base, + "rcvbuf", + "TCP socket receive buffering size (in bytes)", + false, false, 128 * 1024, + &mca_oob_tcp_component.tcp_rcvbuf); mca_base_param_reg_string(&mca_oob_tcp_component.super.oob_base, "if_include",