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

mercierg at mcs.anl.gov mercierg at mcs.anl.gov
Fri Feb 11 07:32:01 CST 2011


Author: mercierg
Date: 2011-02-11 07:32:01 -0600 (Fri, 11 Feb 2011)
New Revision: 7934

Modified:
   mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c
Log:
Fix for any source


Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c	2011-02-10 22:37:45 UTC (rev 7933)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_probe.c	2011-02-11 13:32:01 UTC (rev 7934)
@@ -18,6 +18,8 @@
     nm_tag_t  match_mask = NEM_NMAD_MATCH_FULL_MASK;
     nm_gate_t out_gate;
     nm_gate_t in_gate;
+    int out_tag;
+    int size;   
     int mpi_errno = MPI_SUCCESS;
     int ret;
 
@@ -45,14 +47,32 @@
     }
 
     do {
-	ret = nm_sr_probe(mpid_nem_newmad_session,in_gate,&out_gate,match_info,match_mask);
+	ret = nm_sr_probe(mpid_nem_newmad_session,in_gate,&out_gate,
+			  match_info,match_mask,&out_tag,&size);
     }
     while (ret != NM_ESUCCESS);
 
-    status->MPI_SOURCE = source;
-    status->MPI_TAG = tag;
-    status->count = 0; /* FIXME */
-
+   if (source != MPI_ANY_SOURCE)
+     status->MPI_SOURCE = source;
+   else 
+     {	
+	MPIDI_VC_t *vc;
+	int         index;
+	vc = (MPIDI_VC_t *)nm_gate_ref_get(out_gate);
+	for(index = 0 ; index < comm->local_size ; index ++)
+	  if (vc == comm->vcr[index])
+	    break;
+	status->MPI_SOURCE = index;
+     }
+   
+   if (tag != MPI_ANY_TAG)
+     status->MPI_TAG = tag;
+   else
+     status->MPI_TAG = out_tag;
+   
+   status->count = size;
+   *flag = TRUE;
+   
  fn_exit:
     return mpi_errno;
  fn_fail:  ATTRIBUTE((unused))
@@ -71,6 +91,8 @@
     nm_tag_t  match_mask = NEM_NMAD_MATCH_FULL_MASK;
     nm_gate_t out_gate;
     nm_gate_t in_gate;
+    int size;
+    int out_tag;
     int mpi_errno = MPI_SUCCESS;
     int ret;
 
@@ -97,21 +119,33 @@
        NEM_NMAD_SET_ANYTAG(match_mask);
     }
 
-    ret = nm_sr_probe(mpid_nem_newmad_session,in_gate,&out_gate,match_info,match_mask);
+    ret = nm_sr_probe(mpid_nem_newmad_session,in_gate,&out_gate,
+		      match_info,match_mask,&out_tag,&size);
     if (ret == NM_ESUCCESS)
     {   
-	/*
-	size_t size;
-	nm_sr_get_size(mpid_nem_newmad_session, p_out_req, &size);
-	*/
-
-	status->MPI_SOURCE = source;
-	status->MPI_TAG = tag;
-	status->count = 0; /* FIXME */
-	*flag = TRUE;	
+       if (source != MPI_ANY_SOURCE)
+	 status->MPI_SOURCE = source;
+       else 
+	 {	    
+	    MPIDI_VC_t *vc;
+	    int         index;
+	    vc = (MPIDI_VC_t *)nm_gate_ref_get(out_gate);
+	    for(index = 0 ; index < comm->local_size ; index ++)
+	      if (vc == comm->vcr[index])
+		break;
+	    status->MPI_SOURCE = index;
+	 }
+       
+       if (tag != MPI_ANY_TAG)
+	 status->MPI_TAG = tag;
+       else
+	 status->MPI_TAG = out_tag;
+       
+       status->count = size;
+       *flag = TRUE;
     }
     else
-	*flag = FALSE;
+     *flag = FALSE;
  
  fn_exit:
     return mpi_errno;



More information about the mpich2-commits mailing list