[mpich2-commits] r6697 - in mpich2/trunk/src: mpi/debugger mpi/errhan mpid/ch3/channels/nemesis/nemesis/src util/param

goodell at mcs.anl.gov goodell at mcs.anl.gov
Thu May 20 22:34:41 CDT 2010


Author: goodell
Date: 2010-05-20 22:34:41 -0500 (Thu, 20 May 2010)
New Revision: 6697

Modified:
   mpich2/trunk/src/mpi/debugger/dbginit.c
   mpich2/trunk/src/mpi/errhan/errutil.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_dma.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c
   mpich2/trunk/src/util/param/params.yml
Log:
convert several old-style params to the new mechanism

In MPICH2, ~25 remain to be converted, including a few that depend
on support for range types.

No reviewer.

Modified: mpich2/trunk/src/mpi/debugger/dbginit.c
===================================================================
--- mpich2/trunk/src/mpi/debugger/dbginit.c	2010-05-21 03:34:37 UTC (rev 6696)
+++ mpich2/trunk/src/mpi/debugger/dbginit.c	2010-05-21 03:34:41 UTC (rev 6697)
@@ -170,8 +170,7 @@
        to access this. */
     /* Also, to avoid scaling problems, we only populate the first 64
        entries (default) */
-    maxsize = 64;
-    MPL_env2int( "MPICH_PROCTABLE_SIZE", &maxsize );
+    maxsize = MPIR_PARAM_PROCTABLE_SIZE;
     if (maxsize > size) maxsize = size;
 
     if (rank == 0) {
@@ -206,9 +205,7 @@
 	MPIR_proctable_size               = size;
 #if 0
 	/* Debugging hook */
-	val = 0;
-	MPL_env2bool( "MPICH_PROCTABLE_PRINT", &val );
-	if (val) {
+	if (MPIR_PARAM_PROCTABLE_PRINT) {
 	    for (i=0; i<maxsize; i++) {
 		printf( "PT[%d].pid = %d, .host_name = %s\n", 
 			i, MPIR_proctable[i].pid, MPIR_proctable[i].host_name );

Modified: mpich2/trunk/src/mpi/errhan/errutil.c
===================================================================
--- mpich2/trunk/src/mpi/errhan/errutil.c	2010-05-21 03:34:37 UTC (rev 6696)
+++ mpich2/trunk/src/mpi/errhan/errutil.c	2010-05-21 03:34:41 UTC (rev 6697)
@@ -1747,46 +1747,28 @@
 /* ------------------------------------------------------------------------- */
 /* Manage the error reporting stack                                          */
 /* ------------------------------------------------------------------------- */
-/* FIXME: This flag wasn't documented in the release specs, and in any
-   event shouldn't be controlled through source-code changes (i.e.,
-   make it either a configure option or a runtime option) */
-/* turn this flag on until we debug and release mpich2 */
-static int MPIR_Err_print_stack_flag = TRUE;
-static int MPIR_Err_chop_error_stack = FALSE;
-static int MPIR_Err_chop_width = 80;
 
 static void MPIR_Err_stack_init( void )
 {
-    int n, rc, mpi_errno = MPI_SUCCESS;
-    
+    int mpi_errno = MPI_SUCCESS;
+
     error_ring_mutex_create(&mpi_errno);
-    MPIR_Err_chop_error_stack = FALSE;
-    
-    rc = MPL_env2bool( "MPICH_PRINT_ERROR_STACK", 
-			  &MPIR_Err_print_stack_flag );
-    
-    rc = MPL_env2int( "MPICH_CHOP_ERROR_STACK", &n );
-    if (rc == 1) {
+
+    if (MPIR_PARAM_CHOP_ERROR_STACK < 0) {
+        MPIR_PARAM_CHOP_ERROR_STACK = 80;
 #ifdef HAVE_WINDOWS_H
-	/* If windows, set the default width to the window size */
-	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
-	if (hConsole != INVALID_HANDLE_VALUE)
-	{
-	    CONSOLE_SCREEN_BUFFER_INFO info;
-	    if (GetConsoleScreenBufferInfo(hConsole, &info))
-	    {
-		MPIR_Err_chop_width = info.dwMaximumWindowSize.X;
-	    }
-	}
+        /* If windows, set the default width to the window size */
+        HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+        if (hConsole != INVALID_HANDLE_VALUE)
+        {
+            CONSOLE_SCREEN_BUFFER_INFO info;
+            if (GetConsoleScreenBufferInfo(hConsole, &info))
+            {
+                /* override the parameter system in this case */
+                MPIR_PARAM_CHOP_ERROR_STACK = info.dwMaximumWindowSize.X;
+            }
+        }
 #endif
-	if (n > 0) {
-	    MPIR_Err_chop_error_stack = TRUE;
-	    MPIR_Err_chop_width = n;
-	}
-	else if (n == 0) {
-	    /* Use the default width */
-	    MPIR_Err_chop_error_stack = TRUE;
-	}
     }
 }
 
@@ -1952,7 +1934,7 @@
 		    maxlen--;
 		}
 		
-		if (MPIR_Err_chop_error_stack)
+		if (MPIR_PARAM_CHOP_ERROR_STACK > 0)
 		{
 		    cur_pos = ErrorRing[ring_idx].msg;
 		    len = (int)strlen(cur_pos);
@@ -1962,16 +1944,16 @@
 		    }
 		    while (len)
 		    {
-			if (len >= MPIR_Err_chop_width - max_location_len)
+			if (len >= MPIR_PARAM_CHOP_ERROR_STACK - max_location_len)
 			{
 			    if (len > maxlen)
 				break;
 			    /* FIXME: Don't use Snprint to append a string ! */
-			    MPIU_Snprintf(str, MPIR_Err_chop_width - 1 - max_location_len, "%s", cur_pos);
-			    str[MPIR_Err_chop_width - 1 - max_location_len] = '\n';
-			    cur_pos += MPIR_Err_chop_width - 1 - max_location_len;
-			    str += MPIR_Err_chop_width - max_location_len;
-			    maxlen -= MPIR_Err_chop_width - max_location_len;
+			    MPIU_Snprintf(str, MPIR_PARAM_CHOP_ERROR_STACK - 1 - max_location_len, "%s", cur_pos);
+			    str[MPIR_PARAM_CHOP_ERROR_STACK - 1 - max_location_len] = '\n';
+			    cur_pos += MPIR_PARAM_CHOP_ERROR_STACK - 1 - max_location_len;
+			    str += MPIR_PARAM_CHOP_ERROR_STACK - max_location_len;
+			    maxlen -= MPIR_PARAM_CHOP_ERROR_STACK - max_location_len;
 			    if (maxlen < max_location_len)
 				break;
 			    for (i=0; i<max_location_len; i++)
@@ -2076,7 +2058,7 @@
 {
     int len;
 
-    if (MPIR_Err_print_stack_flag) {
+    if (MPIR_PARAM_PRINT_ERROR_STACK) {
 	MPIU_Strncpy(msg, ", error stack:\n", num_remaining);
 	msg[num_remaining - 1] = '\0';
 	len = (int)strlen(msg);

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_dma.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_dma.c	2010-05-21 03:34:37 UTC (rev 6696)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_dma.c	2010-05-21 03:34:41 UTC (rev 6697)
@@ -20,8 +20,6 @@
  * simpler. */
 #define MPICH_NEW_KNEM_ABI_VERSION (0x0000000c)
 
-static size_t dma_threshold = 2048*1024;
-
 /* These are for maintaining a linked-list of outstanding requests on which we
    can make progress. */
 struct lmt_dma_node {
@@ -62,10 +60,6 @@
     int tmp_threshold = -1;
     struct knem_cmd_info info;
 
-    ret = MPL_env2int("MPICH_NEM_LMT_DMA_THRESHOLD", &tmp_threshold);
-    if (ret == 1)
-        dma_threshold = tmp_threshold;
-
     knem_fd = open(KNEM_DEVICE_FILENAME, O_RDWR);
     MPIU_ERR_CHKANDJUMP2(knem_fd < 0, mpi_errno, MPI_ERR_OTHER, "**shm_open",
                          "**shm_open %s %d", KNEM_DEVICE_FILENAME, errno);
@@ -334,8 +328,7 @@
     MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype,
                             dt_contig, data_sz, dt_ptr, dt_true_lb);
 
-    /* this is where Stephanie might want to look at VC's local rank and shared cache size */
-    nodma = !knem_has_dma || data_sz < dma_threshold;
+    nodma = !knem_has_dma || data_sz < MPIR_PARAM_NEM_LMT_DMA_THRESHOLD;
 
     if (dt_contig) {
         /* handle the iov creation ourselves */

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c	2010-05-21 03:34:37 UTC (rev 6696)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_network.c	2010-05-21 03:34:41 UTC (rev 6697)
@@ -22,13 +22,12 @@
 int MPID_nem_choose_netmod(void)
 {
     int mpi_errno = MPI_SUCCESS;
-    const char *val;
     int i;
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_CHOOSE_NETMOD);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_CHOOSE_NETMOD);
 
-    if (! MPL_env2str("MPICH_NEMESIS_NETMOD", &val))
+    if (strcmp(MPIR_PARAM_NEMESIS_NETMOD, "") == 0)
     {
         /* netmod not specified, using the default */
         MPID_nem_netmod_func = MPID_nem_netmod_funcs[0];
@@ -38,7 +37,7 @@
 
     for (i = 0; i < MPID_nem_num_netmods; ++i)
     {
-        if (!MPIU_Strncasecmp(val, MPID_nem_netmod_strings[i], MPID_NEM_MAX_NETMOD_STRING_LEN))
+        if (!MPIU_Strncasecmp(MPIR_PARAM_NEMESIS_NETMOD, MPID_nem_netmod_strings[i], MPID_NEM_MAX_NETMOD_STRING_LEN))
         {
             MPID_nem_netmod_func = MPID_nem_netmod_funcs[i];
             MPID_nem_netmod_id = i;
@@ -46,8 +45,8 @@
         }
     }
 
-    MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_netmod", "**invalid_netmod %s", val);
- 
+    MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**invalid_netmod", "**invalid_netmod %s", MPIR_PARAM_NEMESIS_NETMOD);
+
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_CHOOSE_NETMOD);
     return mpi_errno;

Modified: mpich2/trunk/src/util/param/params.yml
===================================================================
--- mpich2/trunk/src/util/param/params.yml	2010-05-21 03:34:37 UTC (rev 6696)
+++ mpich2/trunk/src/util/param/params.yml	2010-05-21 03:34:41 UTC (rev 6697)
@@ -16,10 +16,20 @@
 categories:
     - name        : collective
       description : parameters that control collective communication behavior
+    - name        : pt2pt
+      description : parameters that control point-to-point communication behavior
     - name        : intranode
       description : intranode communication parameters
     - name        : developer
       description : useful for developers working on MPICH2 itself
+    - name        : error_handling
+      description : parameters that control error handling behavior (stack traces, aborts, etc)
+    - name        : debugger
+      description : parameters relevant to the "MPIR" debugger interface
+    - name        : threads
+      description : multi-threading parameters
+    - name        : nemesis
+      description : "parameters that control behavior of the ch3:nemesis channel"
 
 parameters:
     ##############################################################
@@ -79,4 +89,51 @@
       description : >-
         If true, list any memory that was allocated by MPICH2 and that
         remains allocated when MPI_Finalize completes.
+
+    - category    : debugger
+      name        : PROCTABLE_SIZE
+      type        : int
+      default     : 64
+      description : >-
+        Size of the "MPIR" debugger interface proctable (process table).
+
+    - category    : debugger
+      name        : PROCTABLE_PRINT
+      type        : boolean
+      default     : true
+      description : >-
+        If true, dump the proctable entries at MPIR_WaitForDebugger-time.
+        (currently compile-time disabled by "#if 0")
+
+    - category    : error_handling
+      name        : PRINT_ERROR_STACK
+      type        : boolean
+      default     : true
+      description : >-
+        If true, print an error stack trace at error handling time.
+
+    - category    : error_handling
+      name        : CHOP_ERROR_STACK
+      type        : int
+      default     : 0
+      description : >-
+        If >0, truncate error stack output lines this many characters
+        wide.  If 0, do not truncate, and if <0 use a sensible default.
+
+    - category    : intranode
+      name        : NEM_LMT_DMA_THRESHOLD
+      type        : int
+      # 2048*1024 == 2MiB
+      default     : 2097152
+      description : >-
+        Messages larger than this size will use the "dma" (knem)
+        intranode LMT implementation, if it is enabled and available.
+
+    - category    : nemesis
+      name        : NEMESIS_NETMOD
+      type        : string
+      default     : ""
+      description : >-
+        If non-empty, this parameter specifies which network module
+        should be used for communication.
 ...



More information about the mpich2-commits mailing list