[mpich2-commits] r7423 - mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad

mercierg at mcs.anl.gov mercierg at mcs.anl.gov
Mon Nov 8 04:27:52 CST 2010


Author: mercierg
Date: 2010-11-08 04:27:52 -0600 (Mon, 08 Nov 2010)
New Revision: 7423

Modified:
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
Log:
Hostname is no longer needed for Newmad init. 


Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h	2010-11-06 15:34:56 UTC (rev 7422)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h	2010-11-08 10:27:52 UTC (rev 7423)
@@ -65,23 +65,17 @@
 /* Connection management*/
 int MPID_nem_newmad_send_conn_info (MPIDI_VC_t *vc);
 
-#define MPID_NEM_NMAD_MAX_SIZE (MPID_NEM_MAX_NETMOD_STRING_LEN)
+#define MPID_NEM_NMAD_MAX_SIZE 64
 typedef nm_gate_t mpid_nem_newmad_p_gate_t;
 
-typedef struct MPID_nem_newmad_vc_area_internal
-{
-    char                     hostname[MPID_NEM_NMAD_MAX_SIZE];
-    char                     url[MPID_NEM_NMAD_MAX_SIZE];
-    mpid_nem_newmad_p_gate_t p_gate;
-} MPID_nem_newmad_vc_area_internal_t;
-
 /* The current max size for the whole structure is 128 bytes */
 typedef struct
 {
-    MPID_nem_newmad_vc_area_internal_t *area;
+    char                     url[MPID_NEM_NMAD_MAX_SIZE];
+    mpid_nem_newmad_p_gate_t p_gate;
 } MPID_nem_newmad_vc_area;
 /* accessor macro to private fields in VC */
-#define VC_FIELD(vcp, field) (((MPID_nem_newmad_vc_area *)((MPIDI_CH3I_VC *)((vcp)->channel_private))->netmod_area.padding)->area->field)
+#define VC_FIELD(vcp, field) (((MPID_nem_newmad_vc_area *)((MPIDI_CH3I_VC *)((vcp)->channel_private))->netmod_area.padding)->field)
 
 /* The req provides a generic buffer in which network modules can store
    private fields This removes all dependencies from the req structure

Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c	2010-11-06 15:34:56 UTC (rev 7422)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c	2010-11-08 10:27:52 UTC (rev 7423)
@@ -6,9 +6,6 @@
 
 #include "newmad_impl.h"
 
-#define MPIDI_CH3I_HOSTNAME_KEY "hostname_id"
-#define MPIDI_CH3I_URL_KEY      "url_id"
-
 MPID_nem_netmod_funcs_t MPIDI_nem_newmad_funcs = {
     MPID_nem_newmad_init,
     MPID_nem_newmad_finalize,
@@ -44,6 +41,7 @@
     MPID_nem_newmad_iprobe /* iprobe */
 };
 
+#define MPIDI_CH3I_URL_KEY "url_id"
 
 static int         mpid_nem_newmad_myrank;
 static const char *label="mpich2";
@@ -112,7 +110,7 @@
 {
    int mpi_errno = MPI_SUCCESS ;
    int index;
-
+   
    /*
    fprintf(stdout,"Size of MPID_nem_mad_module_vc_area_internal_t : %i | size of nm_sr_request_t :%i | Size of req_area : %i\n",
          sizeof(MPID_nem_newmad_vc_area_internal_t),sizeof(nm_sr_request_t), sizeof(MPID_nem_newmad_req_area));
@@ -123,17 +121,16 @@
    MPIU_Assert( sizeof(MPID_nem_newmad_req_area) <= MPID_NEM_REQ_NETMOD_AREA_LEN);
    */
    
-   /*
-   if (sizeof(MPID_nem_newmad_vc_area_internal_t) > MPID_NEM_VC_NETMOD_AREA_LEN)
+
+   if (sizeof(MPID_nem_newmad_vc_area) > MPID_NEM_VC_NETMOD_AREA_LEN)
    {
        fprintf(stdout,"===========================================================\n");
        fprintf(stdout,"===  Error : Newmad data structure size is too long     ===\n");
        fprintf(stdout,"===  VC netmod area is %4i | Nmad struct size is %4i    ===\n", 
 	       MPID_NEM_VC_NETMOD_AREA_LEN, sizeof(MPID_nem_newmad_vc_area_internal_t));
        fprintf(stdout,"===========================================================\n");
-       MPIU_Abort();    
+       exit(0);
    }
-   */
    
    if (sizeof(MPID_nem_newmad_req_area) > MPID_NEM_REQ_NETMOD_AREA_LEN)
    {
@@ -142,7 +139,7 @@
        fprintf(stdout,"===  Req netmod area is %4i | Nmad struct size is %4i   ===\n", 
 	       MPID_NEM_REQ_NETMOD_AREA_LEN, sizeof(MPID_nem_newmad_req_area));
        fprintf(stdout,"===========================================================\n");
-       /* MPIU_Abort(); */
+       exit(0);
    }
 
    mpid_nem_newmad_myrank = pg_rank;
@@ -172,16 +169,7 @@
 {
     int mpi_errno = MPI_SUCCESS;
     int str_errno = MPIU_STR_SUCCESS;
-    char name[MPID_NEM_NMAD_MAX_SIZE];
     
-    gethostname(name,MPID_NEM_NMAD_MAX_SIZE);
-    
-    str_errno = MPIU_Str_add_binary_arg (bc_val_p, val_max_sz_p, MPIDI_CH3I_HOSTNAME_KEY, name, strlen(name));
-    if (str_errno) {
-        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
-    }
-    
     str_errno = MPIU_Str_add_binary_arg (bc_val_p, val_max_sz_p, MPIDI_CH3I_URL_KEY, local_session_url, strlen(local_session_url));
     if (str_errno) {
         MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
@@ -199,20 +187,12 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int
-MPID_nem_newmad_get_from_bc (const char *business_card, char *hostname, char *url)
+MPID_nem_newmad_get_from_bc (const char *business_card, char *url)
 {
    int mpi_errno = MPI_SUCCESS;
    int str_errno = MPIU_STR_SUCCESS;
    int len;
    
-   str_errno = MPIU_Str_get_binary_arg (business_card, MPIDI_CH3I_HOSTNAME_KEY, hostname,
-					MPID_NEM_NMAD_MAX_SIZE, &len);
-   if (str_errno != MPIU_STR_SUCCESS)
-   {	
-      /* FIXME: create a real error string for this */
-      MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_hostd");
-   }
-   
    str_errno = MPIU_Str_get_binary_arg (business_card, MPIDI_CH3I_URL_KEY, url,
 					MPID_NEM_NMAD_MAX_SIZE, &len);
    if (str_errno != MPIU_STR_SUCCESS)
@@ -263,15 +243,10 @@
    mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card,val_max_sz,vc->pg);
    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
    
-   (((MPID_nem_newmad_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->area) =
-     (MPID_nem_newmad_vc_area_internal_t *)MPIU_Malloc(sizeof(MPID_nem_newmad_vc_area_internal_t));
-   MPIU_Assert( (((MPID_nem_newmad_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->area) != NULL);
-   
    /* Very important */
-   memset(VC_FIELD(vc, hostname),0,MPID_NEM_NMAD_MAX_SIZE);
    memset(VC_FIELD(vc, url),0,MPID_NEM_NMAD_MAX_SIZE);
    
-   mpi_errno = MPID_nem_newmad_get_from_bc (business_card, VC_FIELD(vc, hostname), VC_FIELD(vc, url));
+   mpi_errno = MPID_nem_newmad_get_from_bc (business_card, VC_FIELD(vc, url));
    if (mpi_errno) MPIU_ERR_POP (mpi_errno);
 
    MPIU_Free(business_card);
@@ -280,7 +255,6 @@
    if (ret != NM_ESUCCESS) fprintf(stdout,"nm_session_connect returned ret = %d\n", ret);
 
    nm_gate_ref_set(VC_FIELD(vc, p_gate),(void*)vc);
-
    MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
    
    vc->eager_max_msg_sz = 32768;
@@ -305,8 +279,6 @@
 {
     int mpi_errno = MPI_SUCCESS;   
 
-    MPIU_Free((((MPID_nem_newmad_vc_area *)((MPIDI_CH3I_VC *)(vc)->channel_private)->netmod_area.padding)->area));
-
  fn_exit:   
        return mpi_errno;
  fn_fail: ATTRIBUTE((unused))



More information about the mpich2-commits mailing list