[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b1-27-ga5686ec

Service Account noreply at mpich.org
Thu Apr 2 11:08:19 CDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  a5686ec3c42f0357119cab7f21df46389c7acec8 (commit)
      from  94e8a8058e775a224367d2eeffcd73c905d7e071 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/a5686ec3c42f0357119cab7f21df46389c7acec8

commit a5686ec3c42f0357119cab7f21df46389c7acec8
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Thu Mar 26 14:15:07 2015 -0500

    Revert "When decrementing a ref-count to 0, do not bother with atomics."
    
    This reverts commit 7a36603163cd917fe89a39cad668e5a7b6f917cb.
    
    At one point (circa MPICH2-1.5) this clever optimization behaved as
    expected. Once ported forward to more recent MPICH, segfaults on trivial
    MPI applications.
    
    Closes: #2217
    Reopens: #1835
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/include/mpihandlemem.h b/src/include/mpihandlemem.h
index 1ab6752..1847031 100644
--- a/src/include/mpihandlemem.h
+++ b/src/include/mpihandlemem.h
@@ -300,25 +300,10 @@ typedef OPA_int_t MPIU_Handle_ref_count;
         MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, "incr"); \
         MPIU_HANDLE_CHECK_REFCOUNT(objptr_,"incr");       \
     } while (0)
-
-/* Special optimization: when the reference count touches one, we are
- * about to free the object.  In this case, it is illegal for another
- * thread to either increment the reference (i.e., create a new object
- * that depends on this object) or decrement the references (i.e.,
- * free the object simultaneously).  We, however, have to ensure that
- * our load is atomic.  OPA does this for us, while optimizing it to a
- * simple load for cases where the architecture already provides us
- * with load atomicity and no need for load memory barriers. */
 #define MPIU_Object_release_ref_always(objptr_,inuse_ptr)               \
     do {                                                                \
-        if (likely(OPA_load_int((objptr_)->ref_count.v) == 1)) {        \
-            (objptr_)->ref_count.v = 0;                                 \
-            *(inuse_ptr) = 0;                                           \
-        }                                                               \
-        else {                                                          \
-            int got_zero_ = OPA_decr_and_test_int(&((objptr_)->ref_count)); \
-            *(inuse_ptr) = got_zero_ ? 0 : 1;                           \
-        }                                                               \
+        int got_zero_ = OPA_decr_and_test_int(&((objptr_)->ref_count)); \
+        *(inuse_ptr) = got_zero_ ? 0 : 1;                               \
         MPIU_HANDLE_LOG_REFCOUNT_CHANGE(objptr_, "decr");               \
         MPIU_HANDLE_CHECK_REFCOUNT(objptr_,"decr");                     \
     } while (0)

-----------------------------------------------------------------------

Summary of changes:
 src/include/mpihandlemem.h |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list