[mpich2-commits] r6640 - mpich2/trunk/src/mpi/comm

goodell at mcs.anl.gov goodell at mcs.anl.gov
Mon May 10 21:58:35 CDT 2010


Author: goodell
Date: 2010-05-10 21:58:35 -0500 (Mon, 10 May 2010)
New Revision: 6640

Modified:
   mpich2/trunk/src/mpi/comm/commutil.c
Log:
improve context id allocation debug message and comments

No reviewer.

Modified: mpich2/trunk/src/mpi/comm/commutil.c
===================================================================
--- mpich2/trunk/src/mpi/comm/commutil.c	2010-05-11 02:58:32 UTC (rev 6639)
+++ mpich2/trunk/src/mpi/comm/commutil.c	2010-05-11 02:58:35 UTC (rev 6640)
@@ -592,8 +592,9 @@
 
     /* We lock only around access to the mask.  If another thread is
        using the mask, we take a mask of zero */
-    MPIU_DBG_MSG_FMT( COMM, VERBOSE, (MPIU_DBG_FDEST,
-         "Entering; shared state is %d:%d", mask_in_use, lowestContextId ) );
+    MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST,
+         "Entering; shared state is %d:%d, my ctx id is %d",
+         mask_in_use, lowestContextId, comm_ptr->context_id));
     /* We need a special test in this loop for the case where some process
      has exhausted its supply of context ids.  In the single threaded case, 
      this is simple, because the algorithm is deterministic (see above).  In 
@@ -695,6 +696,13 @@
 	    int hasNoId, totalHasNoId;
 	    /* We don't need to lock on this because we're just looking for
 	       zero or nonzero */
+            /* FIXME [goodell@] I don't agree with the above comment, pthreads
+             * doesn't really give us any guarantees when outside of a locked region and
+             * there isn't much of a penalty for acquiring the CS in this case.
+             * It gets even cheaper if we "rotate" this check half way around to
+             * the top of this loop where we already acquire the CS anyway.
+             * In the GLOBAL case, we actually are holding a lock here, so it
+             * doesn't trigger helgrind/DRD warnings. */
 	    hasNoId = MPIR_Locate_context_bit(context_mask) == 0;
 	    mpi_errno = NMPI_Allreduce( &hasNoId, &totalHasNoId, 1, MPI_INT, 
 			    MPI_MAX, comm_ptr->handle );



More information about the mpich2-commits mailing list