[mpich2-commits] r5647 - in mpich2/trunk/src: include mpid/ch3/channels/nemesis/nemesis/include mpid/ch3/channels/nemesis/nemesis/netmod/gm mpid/ch3/channels/nemesis/nemesis/netmod/mx mpid/ch3/channels/nemesis/nemesis/netmod/tcp mpid/ch3/channels/nemesis/nemesis/src mpid/ch3/channels/nemesis/src mpid/ch3/src util/dbg util/wrappers

buntinas at mcs.anl.gov buntinas at mcs.anl.gov
Sat Oct 31 09:43:33 CDT 2009


Author: buntinas
Date: 2009-10-31 09:43:33 -0500 (Sat, 31 Oct 2009)
New Revision: 5647

Modified:
   mpich2/trunk/src/include/mpierrs.h
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_impl.h
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_send.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_utility.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_barrier.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_ckpt.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_vmsplice.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_comm_spawn.c
   mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_init.c
   mpich2/trunk/src/mpid/ch3/src/mpid_get_universe_size.c
   mpich2/trunk/src/mpid/ch3/src/mpid_vc.c
   mpich2/trunk/src/mpid/ch3/src/mpidi_pg.c
   mpich2/trunk/src/util/dbg/dbg_printf.c
   mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
Log:
added error macros for internal errors

Modified: mpich2/trunk/src/include/mpierrs.h
===================================================================
--- mpich2/trunk/src/include/mpierrs.h	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/include/mpierrs.h	2009-10-31 14:43:33 UTC (rev 5647)
@@ -565,6 +565,16 @@
      MPIU_ERR_CHKANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
 #define MPIU_ERR_CHKFATALANDJUMP4(cond_,err_,class_,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_) \
      MPIU_ERR_CHKFATALANDSTMT4(cond_,err_,class_,goto fn_fail,gmsg_,smsg_,arg1_,arg2_,arg3_,arg4_)
+
+#define MPIU_ERR_INTERNAL(err_, msg_)   \
+    MPIU_ERR_SETFATAL1(err_, MPI_ERR_INTERN, "**intern", "**intern %s", msg_)
+#define MPIU_ERR_INTERNALANDSTMT(err_, msg_, stmt_) \
+    MPIU_ERR_SETANDSTMT1(err_, MPI_ERR_INTERN, stmt_, "**intern", "**intern %s", msg_)
+#define MPIU_ERR_INTERNALANDJUMP(err_, msg_) \
+    MPIU_ERR_INTERNALANDSTMT(err_, msg_, goto fn_fail)
+#define MPIU_ERR_CHKINTERNAL(cond_, err_, msg_) \
+    do {if (cond_) MPIU_ERR_INTERNALANDJUMP(err_, msg_);} while(0)
+
 /* --END ERROR MACROS-- */
 
 /* 

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_impl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_impl.h	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_impl.h	2009-10-31 14:43:33 UTC (rev 5647)
@@ -225,7 +225,7 @@
             cookie_pkt->receiver_req_id = (req)->ch.lmt_req_id;
             break;
         default:
-            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unexpected request type");
+            MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
             break;
     }
 

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_send.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_send.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/gm/gm_send.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -89,12 +89,12 @@
                 if (mpi_errno) MPIU_ERR_POP (mpi_errno);
                 break;
 	    default:
-                MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**intern");
+                MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected rdma type");
 		break;
 	    }
 	    break;
 	default:
-            MPIU_ERR_SETANDJUMP (mpi_errno, MPI_ERR_OTHER, "**intern");
+            MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected operation type");
 	    break;
 	}
 	MPID_nem_gm_queue_free (send, e);

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/mx/mx_poll.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -346,7 +346,7 @@
      else
      {
          /* Error : unknown REQ type */
-         MPIU_ERR_CHKANDJUMP1(TRUE, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unknown REQ type");
+         MPIU_ERR_CHKINTERNAL(TRUE, mpi_errno, "unknown REQ type");
      }
    }
    
@@ -387,7 +387,7 @@
      else
      {
          /* Error : unknown REQ type */
-         MPIU_ERR_CHKANDJUMP1(TRUE, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unknown REQ type");
+         MPIU_ERR_CHKINTERNAL(TRUE, mpi_errno, "unknown REQ type");
      }
    }   
  fn_exit:

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_utility.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_utility.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_utility.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -46,8 +46,8 @@
     mpi_errno = MPIDI_PG_Find (pg_id, &pg);
     if (mpi_errno) MPIU_ERR_POP (mpi_errno);
 
-    MPIU_ERR_CHKANDJUMP1 (pg == NULL, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "invalid PG");
-    MPIU_ERR_CHKANDJUMP1 (pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "invalid pg_rank");
+    MPIU_ERR_CHKINTERNAL(pg == NULL, mpi_errno, "invalid PG");
+    MPIU_ERR_CHKINTERNAL(pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, "invalid pg_rank");
         
     MPIDI_PG_Get_vc_set_active (pg, pg_rank, vc);
     

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -248,7 +248,7 @@
             /* get name of shared file */
             mpi_errno = PMI2_Info_GetNodeAttr("sharedFilename", val, PMI2_MAX_VALLEN, &found, TRUE);
             if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            MPIU_ERR_CHKANDJUMP1(!found, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "nodeattr not found");
+            MPIU_ERR_CHKINTERNAL(!found, mpi_errno, "nodeattr not found");
 
             mpi_errno = MPIU_SHMW_Hnd_deserialize(memory->hnd, val, strlen(val));
             if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -506,7 +506,7 @@
 	MPID_nem_mem_region.memory.symmetrical = 0;
 	MPID_nem_asymm_base_addr = MPID_nem_mem_region.memory.base_addr;
 #ifdef MPID_NEM_SYMMETRIC_QUEUES
-        MPIU_ERR_SETFATALANDJUMP1(mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "queues are not symmetrically allocated as expected");
+        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "queues are not symmetrically allocated as expected");
 #endif
     }
     else

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_barrier.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_barrier.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_barrier.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -49,7 +49,7 @@
     if (MPID_nem_mem_region.num_local == 1)
         goto fn_exit;
 
-    MPIU_ERR_CHKANDJUMP1 (!barrier_init, mpi_errno, MPI_ERR_INTERN, "**intern", "**intern %s", "barrier not initialized");
+    MPIU_ERR_CHKINTERNAL(!barrier_init, mpi_errno, "barrier not initialized");
 
     if (OPA_fetch_and_incr_int(&MPID_nem_mem_region.barrier->val) == MPID_nem_mem_region.num_local - 1)
     {

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_ckpt.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_ckpt.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_ckpt.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -136,7 +136,7 @@
 	/* we don't send messages to ourselves, so we pretend we sent and received a marker */
 	--MPID_nem_ckpt_sending_markers;
 	ret = cli_on_marker_receive (&marker, rank);
-        MPIU_ERR_CHKANDJUMP (ret != CLI_CP_MARKED, mpi_errno, MPI_ERR_OTHER, "**intern");
+        MPIU_ERR_CHKINTERNAL(ret != CLI_CP_MARKED, mpi_errno, "expecting CLI_CP_MARKED");
 	--MPID_nem_ckpt_logging_messages;
 	log_msg[rank] = 0;
 	sent_marker[rank] = 1;
@@ -169,7 +169,7 @@
     case CLI_NOTHING:
 	break;
     default:
-        MPIU_ERR_CHKANDJUMP (ret != CLI_CP_MARKED, mpi_errno, MPI_ERR_OTHER, "**intern");
+        MPIU_ERR_CHKINTERNAL(ret != CLI_CP_MARKED, mpi_errno, "expecting CLI_CP_MARKED");
     }
 
  fn_exit:
@@ -241,7 +241,7 @@
 	/* we don't send messages to ourselves, so we pretend we sent and received a marker */
 	--MPID_nem_ckpt_sending_markers;
 	ret = cli_on_marker_receive (&marker, rank);
-        MPIU_ERR_CHKANDJUMP (ret != CLI_CP_MARKED, mpi_errno, MPI_ERR_OTHER, "**intern");
+        MPIU_ERR_CHKINTERNAL(ret != CLI_CP_MARKED, mpi_errno, "Expecting CLI_CP_MARKED");
 	--MPID_nem_ckpt_logging_messages;
 	log_msg[rank] = 0;
 	sent_marker[rank] = 1;
@@ -283,7 +283,7 @@
 	    break;
 	}
     default:
-        MPIU_ERR_CHKANDJUMP (ret != CLI_CP_MARKED, mpi_errno, MPI_ERR_OTHER, "**intern");
+        MPIU_ERR_CHKINTERNAL(ret != CLI_CP_MARKED, mpi_errno, "Expecting CLI_CP_MARKED");
 	return;
     }
 

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -370,7 +370,7 @@
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
         break;
     default:
-        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unexpected request type");
+        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
         break;
     }
 

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_vmsplice.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_vmsplice.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_vmsplice.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -325,7 +325,7 @@
                 if (mpi_errno) MPIU_ERR_POP(mpi_errno);
                 break;
             default:
-                MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unexpected request type");
+                MPIU_ERR_INTERNALANDJUMP(mpi_errno, "unexpected request type");
                 break;
         }
 

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_comm_spawn.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_comm_spawn.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_comm_spawn.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -85,18 +85,19 @@
 #define FUNCNAME MPIDI_CH3_Get_business_card
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_Get_business_card (int myRank, char *value, int length)
+int MPIDI_CH3_Get_business_card(int myRank, char *value, int length)
 {
     int mpi_errno = MPI_SUCCESS;
-    int ret;
     MPIDI_STATE_DECL(MPIDI_STATE_MPIDI_CH3_GET_BUSINESS_CARD);
 
     MPIDI_FUNC_ENTER(MPIDI_STATE_MPIDI_CH3_GET_BUSINESS_CARD);
 
-    ret = MPID_nem_get_business_card (myRank, value, length);
-    if (ret != 0)
-	mpi_errno =  MPIR_Err_create_code (MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_INTERN, "**intern", 0);
+    mpi_errno = MPID_nem_get_business_card(myRank, value, length);
+    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
+fn_exit:
     MPIDI_FUNC_EXIT(MPIDI_STATE_MPIDI_CH3_GET_BUSINESS_CARD);
     return mpi_errno;
+fn_fail:
+    goto fn_exit;
 }

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_init.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_init.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/src/ch3_init.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -192,7 +192,7 @@
     MPIDI_VC_Init (vc, NULL, 0);
 
     /* init channel portion of vc */
-    MPIU_ERR_CHKANDJUMP (!nemesis_initialized, mpi_errno, MPI_ERR_OTHER, "**intern");
+    MPIU_ERR_CHKINTERNAL(!nemesis_initialized, mpi_errno, "Nemesis not initialized");
     ((MPIDI_CH3I_VC *)vc->channel_private)->recv_active = NULL;
     MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
 

Modified: mpich2/trunk/src/mpid/ch3/src/mpid_get_universe_size.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/mpid_get_universe_size.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/src/mpid_get_universe_size.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -38,7 +38,7 @@
 	*universe_size = MPIR_UNIVERSE_SIZE_NOT_AVAILABLE;
     else {
         *universe_size = strtol(val, &endptr, 0);
-        MPIU_ERR_CHKANDJUMP(endptr - val != strlen(val), mpi_errno, MPI_ERR_OTHER, "**intern");
+        MPIU_ERR_CHKINTERNAL(endptr - val != strlen(val), mpi_errno, "can't parse universe size");
     }
 
 #else

Modified: mpich2/trunk/src/mpid/ch3/src/mpid_vc.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/mpid_vc.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/src/mpid_vc.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -452,6 +452,7 @@
 int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr, 
 			    int size, const int lpids[] )
 {
+    int mpi_errno = MPI_SUCCESS;
     MPID_Comm *commworld_ptr;
     int i;
     MPIDI_PG_iterator iter;
@@ -484,12 +485,7 @@
 	    MPIDI_PG_Get_next( &iter, &pg );
 	    do {
 		MPIDI_PG_Get_next( &iter, &pg );
-		if (!pg) {
-		    return MPIR_Err_create_code( MPI_SUCCESS, 
-				     MPIR_ERR_RECOVERABLE,
-				     "MPID_VCR_CommFromLpids", __LINE__,
-				     MPI_ERR_INTERN, "**intern", 0 );
-		}
+                MPIU_ERR_CHKINTERNAL(!pg, mpi_errno, "no pg");
 		/* FIXME: a quick check on the min/max values of the lpid
 		   for this process group could help speed this search */
 		for (j=0; j<pg->size; j++) {
@@ -512,7 +508,10 @@
 	   PG if necessary.  */
 	MPID_VCR_Dup( vc, &newcomm_ptr->vcr[i] );
     }
-    return 0;
+fn_exit:
+    return mpi_errno;
+fn_fail:
+    goto fn_exit;
 }
 
 /* The following is a temporary hook to ensure that all processes in 
@@ -811,7 +810,7 @@
 #endif
 
 
-#define parse_error() MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "parse error")
+#define parse_error() MPIU_ERR_INTERNALANDJUMP(mpi_errno, "parse error")
 /* advance _c until we find a non whitespace character */
 #define skip_space(_c) while (isspace(*(_c))) ++(_c)
 /* return true iff _c points to a character valid as an indentifier, i.e., [-_a-zA-Z0-9] */
@@ -1016,7 +1015,7 @@
     if (mpi_errno) MPIU_ERR_POP(mpi_errno);
 
     if (NULL_MAPPING == mt) goto fn_fail;
-    MPIU_ERR_CHKANDJUMP1(mt != VECTOR_MAPPING, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unsupported mapping type");
+    MPIU_ERR_CHKINTERNAL(mt != VECTOR_MAPPING, mpi_errno, "unsupported mapping type");
 
     rank = 0;
     /* for a representation like (block,N,(1,1)) this while loop causes us to
@@ -1131,8 +1130,8 @@
 
         mpi_errno = PMI2_Info_GetJobAttrIntArray("nodeIDs", node_ids, pg->size, &outlen, &found);
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP1(!found, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "nodeIDs attribute not found");
-        MPIU_ERR_CHKANDJUMP1(outlen != pg->size, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "did not receive enough nodeids");
+        MPIU_ERR_CHKINTERNAL(!found, mpi_errno, "nodeIDs attribute not found");
+        MPIU_ERR_CHKINTERNAL(outlen != pg->size, mpi_errno, "did not receive enough nodeids");
         g_num_nodes = 0;
         for (i = 0; i < pg->size; ++i) {
             pg->vct[i].node_id = node_ids[i];
@@ -1159,11 +1158,11 @@
 
         mpi_errno = PMI2_Info_GetJobAttr("process-mapping", process_mapping, sizeof(process_mapping), &found);
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP1(!found, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "process-mapping attribute not found");
+        MPIU_ERR_CHKINTERNAL(!found, mpi_errno, "process-mapping attribute not found");
         /* this code currently assumes pg is comm_world */
         mpi_errno = populate_ids_from_mapping(process_mapping, &num_nodes, pg, &did_map);
         if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-        MPIU_ERR_CHKANDJUMP1(!did_map, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "unable to populate node ids from process-mapping");
+        MPIU_ERR_CHKINTERNAL(!did_map, mpi_errno, "unable to populate node ids from process-mapping");
         g_num_nodes = num_nodes;
     }
 #endif

Modified: mpich2/trunk/src/mpid/ch3/src/mpidi_pg.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/mpidi_pg.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/mpid/ch3/src/mpidi_pg.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -906,15 +906,21 @@
     MPIU_Strncpy( buf, connInfo->connStrings[rank], bufsize );
     return MPI_SUCCESS;
 }
+
+#undef FUNCNAME
+#define FUNCNAME connToString
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
 static int connToString( char **buf_p, int *slen, MPIDI_PG_t *pg )
 {
+    int mpi_errno = MPI_SUCCESS;
     char *str = NULL, *pg_id;
     int  i, len=0;
-    
+    MPIU_CHKPMEM_DECL(1);
     MPIDI_ConnInfo *connInfo = (MPIDI_ConnInfo *)pg->connData;
 
     /* Create this from the string array */
-    str = (char *)MPIU_Malloc( connInfo->toStringLen );
+    MPIU_CHKPMEM_MALLOC(str, char *, connInfo->toStringLen, mpi_errno, "str");
 
 #if defined(MPICH_DEBUG_MEMINIT)
     memset(str, 0, connInfo->toStringLen);
@@ -934,6 +940,7 @@
 	PMI_Get_id( pg->id, 256 );
 #endif
     }
+    
     while (*pg_id) str[len++] = *pg_id++;
     str[len++] = 0;
     
@@ -951,14 +958,19 @@
     if (len > connInfo->toStringLen) {
 	*buf_p = 0;
 	*slen  = 0;
-	return MPIR_Err_create_code(MPI_SUCCESS,MPIR_ERR_FATAL,"connToString",
-			    __LINE__, MPI_ERR_INTERN, "**intern", NULL);
+        MPIU_ERR_INTERNALANDJUMP(mpi_errno, "len > connInfo->toStringLen");
     }
 
     *buf_p = str;
     *slen = len;
 
-    return MPI_SUCCESS;
+fn_exit:
+    MPIU_CHKPMEM_COMMIT();
+    return mpi_errno;
+fn_fail:
+    MPIU_CHKPMEM_REAP();
+    goto fn_exit;
+    
 }
 static int connFromString( const char *buf, MPIDI_PG_t *pg )
 {

Modified: mpich2/trunk/src/util/dbg/dbg_printf.c
===================================================================
--- mpich2/trunk/src/util/dbg/dbg_printf.c	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/util/dbg/dbg_printf.c	2009-10-31 14:43:33 UTC (rev 5647)
@@ -836,12 +836,12 @@
     int ret;
     
     ret = MPIU_Strncpy(temp_filename, filePattern, MAXPATHLEN);
-    MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "logfile path too long");
+    MPIU_ERR_CHKINTERNAL(ret, mpi_errno, "logfile path too long");
 
     MPIU_Basename(temp_filename, &basename);
 
     /* make sure there's enough room in temp_filename to store temp_pattern */
-    MPIU_ERR_CHKANDJUMP1(basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern), mpi_errno, MPI_ERR_OTHER, "**intern", "**intern %s", "logfile path too long");
+    MPIU_ERR_CHKINTERNAL(basename - temp_filename > MAXPATHLEN - sizeof(temp_pattern), mpi_errno, "logfile path too long");
 
     MPIU_Strncpy(basename, temp_pattern, sizeof(temp_pattern));
     

Modified: mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h
===================================================================
--- mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h	2009-10-31 05:14:11 UTC (rev 5646)
+++ mpich2/trunk/src/util/wrappers/mpiu_shm_wrappers.h	2009-10-31 14:43:33 UTC (rev 5647)
@@ -341,8 +341,7 @@
     int rc = -1;
 
     MPIU_Assert(MPIU_SHMW_Hnd_is_init(hnd));
-    MPIU_ERR_CHKANDJUMP1(!str_hnd, mpi_errno, MPI_ERR_OTHER, 
-        "**intern", "**intern %s", "ser hnd is null");
+    MPIU_ERR_CHKINTERNAL(!str_hnd, mpi_errno, "ser hnd is null");
     MPIU_ERR_CHKANDJUMP(str_hnd_len>=MPIU_SHMW_GHND_SZ,
         mpi_errno, MPI_ERR_OTHER, "**shmw_deserbufbig");
 
@@ -413,8 +412,7 @@
     MPIU_Assert(MPIU_SHMW_Hnd_is_init(hnd));
     MPIU_Assert(ser_hnd_ptr);
 
-    MPIU_ERR_CHKANDJUMP1(!(*ser_hnd_ptr), mpi_errno, MPI_ERR_OTHER, 
-        "**intern", "**intern %s", "ser hnd is null");
+    MPIU_ERR_CHKINTERNAL(!(*ser_hnd_ptr), mpi_errno, "ser hnd is null");
 
     MPIU_SHMW_Hnd_reset_val(hnd);
     MPIU_SHMW_Ghnd_set_by_ref(hnd, *ser_hnd_ptr);
@@ -566,8 +564,7 @@
     MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKANDJUMP1(!(*shm_addr_ptr), mpi_errno, MPI_ERR_OTHER, 
-        "**intern", "**intern %s", "shm address is null");
+    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = shmdt(*shm_addr_ptr);
     MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
@@ -715,8 +712,7 @@
     int rc = -1;
 
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKANDJUMP1(!(*shm_addr_ptr), mpi_errno, MPI_ERR_OTHER, 
-        "**intern", "**intern %s", "shm address is null");
+    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = munmap(*shm_addr_ptr, seg_sz);
     MPIU_ERR_CHKANDJUMP2((rc != 0), mpi_errno, MPI_ERR_OTHER,
@@ -835,8 +831,7 @@
     MPIU_ERR_CHKANDJUMP(!MPIU_SHMW_Hnd_is_valid(hnd),
         mpi_errno, MPI_ERR_OTHER, "**shmw_badhnd");
     MPIU_Assert(shm_addr_ptr);
-    MPIU_ERR_CHKANDJUMP1(!(*shm_addr_ptr), mpi_errno, MPI_ERR_OTHER, 
-        "**intern", "**intern %s", "shm address is null");
+    MPIU_ERR_CHKINTERNAL(!(*shm_addr_ptr), mpi_errno, "shm address is null");
 
     rc = UnmapViewOfFile(*shm_addr_ptr);
     MPIU_ERR_CHKANDJUMP2((rc == 0), mpi_errno, MPI_ERR_OTHER,



More information about the mpich2-commits mailing list