1
1
openmpi/ompi
Wei Zhang 6760d531d5 [v4.1.x] ompi : add memory barrier in PMIx registration callback
PMIx reigstration callback functions are used when regitering PMIx
event handler.

This patch adjusts two such callback functions:

    model_registration_callback()
         in ompi/interlib/interlib.c and

    ompi_errhandler_registration_callback()
         in ompi/errhandler/errhandler.c

Both of them employes the following code structure:

static void xxx_callback(int status,
			 size_t errhandler_ref,
			 void *cbdata)
{
    myreg_t *trk = (myreg_t*)cbdata;

    trk->status = status;
    interlibhandler_id = errhandler_ref;
    trk->active = false;
}

The workflow is:

1. caller will call opal_pmix.register_evhandler() with
   callback function as an argument.
2. caller will call OMPI_LAZY_WAIT_FOR_COMPLETION(trk.active)
   to wait for trk->active to became false,
3. PMIx do the registration on anther thread, then call the
   registration callback function, which will set trk->active
   to false.
4. caller check trk->status to determine whether registration
   succeeded.

The expected behavior of the registration callback functions therefore
is that trk->status be updated first, then trk->active be set to false.

However, on ARM based systems, the expected behavior is not guaranteed
because ARM uses a relaxed memory model.

To address this issue, this patch added a call to opal_atomic_wmb()
(write memory barrier) after trk->status being set, to achieve the
expected behavior.

Signed-off-by: Wei Zhang <wzam@amazon.com>
2020-12-08 01:58:05 +00:00
..
attribute ompi/attributes: revamp attribute handling. 2017-07-12 10:27:45 +09:00
class Revert "Update to sync with OMPI master and cleanup to build" 2016-11-22 15:03:20 -08:00
communicator A complete overhaul of the HAN code. 2020-10-26 21:38:00 -04:00
contrib ompitrace: MPI_Address -> MPI_Get_address 2018-05-01 15:20:02 -06:00
datatype coll/base: do not drop const qualifier 2020-11-14 10:29:32 -05:00
debuggers ompi/debuggers: stomp a compiler warning in dlopen_test.c 2018-05-30 10:08:14 -07:00
dpm ompi/dpm/dpm.c: Fix uninititalized variable 2019-12-14 12:24:57 -05:00
errhandler [v4.1.x] ompi : add memory barrier in PMIx registration callback 2020-12-08 01:58:05 +00:00
etc Revert "Update to sync with OMPI master and cleanup to build" 2016-11-22 15:03:20 -08:00
file ompi/file: rename ompi_file_t's f_mutex into f_lock 2017-12-01 16:06:22 +09:00
group A complete overhaul of the HAN code. 2020-10-26 21:38:00 -04:00
include mpi.h.in: Remove //-style comments 2020-06-15 21:52:52 -04:00
info ompi/info: plug memory leaks in ompi_mpiinfo_finalize() 2018-09-10 09:18:15 +09:00
interlib [v4.1.x] ompi : add memory barrier in PMIx registration callback 2020-12-08 01:58:05 +00:00
mca coll/base: fix compiler warnings 2020-11-25 15:09:46 -05:00
message predefined MPI object padding: set to fixed number of bytes (#3634) 2017-06-01 15:28:23 -04:00
mpi Bring ADAPT collective to 4.1 2020-09-23 11:45:45 -04:00
mpiext fortran: remove useless CPPFLAGS assignment 2020-02-04 04:26:11 -08:00
op ompi/op: fix support of non predefined datatypes with predefined operators 2019-01-30 10:29:39 +09:00
patterns scripted symbol name change (ompi_ prefix) 2017-07-11 02:13:23 -04:00
peruse mpi/finalized: revamp INITIALIZED/FINALIZED 2018-06-01 13:36:29 -07:00
proc ompi: Avoid unnecessary PMIx lookups when adding procs (step 2). 2017-03-16 07:47:27 +07:00
request A complete overhaul of the HAN code. 2020-10-26 21:38:00 -04:00
runtime symbol pollution 2020-10-07 14:07:55 -04:00
tools Merge pull request #8204 from jsquyres/pr/v4.1.x/fix-warnings 2020-11-23 17:28:44 -08:00
util timings: Fix timings when 'prefix' is used 2020-03-11 21:05:30 -07:00
win ompi/attributes: revamp attribute handling. 2017-07-12 10:27:45 +09:00
Makefile.am fortran: ensure not to use [AM_]CPPFLAGS 2020-02-04 05:15:40 -08:00