From d3d779f6d9f518e4667b1a49d3c3a35a6b275547 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 2 May 2016 15:28:47 -0600 Subject: [PATCH] osc/rdma: clear all_sync object when obtaining a lock This commit fixes a bad synchronization detection bug that occurs when mixing MPI_Win_fence() and MPI_Win_lock(). If no communication has occurred in the fence epoch it is safe to just clear the all_sync object (it was set up by fence). Signed-off-by: Nathan Hjelm --- ompi/mca/osc/rdma/osc_rdma_passive_target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/rdma/osc_rdma_passive_target.c b/ompi/mca/osc/rdma/osc_rdma_passive_target.c index 9eccdda5aa..f3e1a0ac85 100644 --- a/ompi/mca/osc/rdma/osc_rdma_passive_target.c +++ b/ompi/mca/osc/rdma/osc_rdma_passive_target.c @@ -8,7 +8,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights + * Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. @@ -197,6 +197,8 @@ int ompi_osc_rdma_lock_atomic (int lock_type, int target, int assert, ompi_win_t return OMPI_ERR_RMA_SYNC; } + /* clear the global sync object (in case MPI_Win_fence was called) */ + module->all_sync.type = OMPI_OSC_RDMA_SYNC_TYPE_NONE; /* create lock item */ lock = ompi_osc_rdma_sync_allocate (module);