[mpich2-commits] r8030 - mpich2/trunk/src/mpi/pt2pt

buntinas at mcs.anl.gov buntinas at mcs.anl.gov
Wed Feb 23 14:38:55 CST 2011


Author: buntinas
Date: 2011-02-23 14:38:55 -0600 (Wed, 23 Feb 2011)
New Revision: 8030

Modified:
   mpich2/trunk/src/mpi/pt2pt/wait.c
Log:
save copy of request's communicator pointer because req gets freed in Wait_impl

Modified: mpich2/trunk/src/mpi/pt2pt/wait.c
===================================================================
--- mpich2/trunk/src/mpi/pt2pt/wait.c	2011-02-23 20:19:06 UTC (rev 8029)
+++ mpich2/trunk/src/mpi/pt2pt/wait.c	2011-02-23 20:38:55 UTC (rev 8030)
@@ -114,6 +114,7 @@
 {
     MPID_Request * request_ptr = NULL;
     int mpi_errno = MPI_SUCCESS;
+    MPID_Comm * comm_ptr = NULL;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_WAIT);
 
     MPIR_ERRTEST_INITIALIZED_ORDIE();
@@ -161,7 +162,10 @@
 #   endif /* HAVE_ERROR_CHECKING */
 
     /* ... body of routine ... */
-    
+
+    /* save copy of comm because request will be freed */
+    if (request_ptr)
+        comm_ptr = request_ptr->comm;
     mpi_errno = MPIR_Wait_impl(request, status);
     if (mpi_errno) goto fn_fail;
 
@@ -180,7 +184,7 @@
 				     "**mpi_wait", "**mpi_wait %p %p", 
 				     request, status);
 #endif
-    mpi_errno = MPIR_Err_return_comm((request_ptr != NULL) ? request_ptr->comm : NULL, FCNAME, mpi_errno);
+    mpi_errno = MPIR_Err_return_comm(comm_ptr, FCNAME, mpi_errno);
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }



More information about the mpich2-commits mailing list