Make a persistent physical node communicator
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 25 Jan 2018 14:47:35 +0000 (15:47 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 14 Mar 2018 13:37:43 +0000 (14:37 +0100)
commit9a2e38a91c0621d2ecbf1bf9fd94640fa564885c
tree1552f808a0734c86fe39170e36b23a9d392c0adc
parente573f0b938b2fbbb2204fe6198224d9185d8fc62
Make a persistent physical node communicator

Rather than make and re-make this communicator multiple times for for
almost all common run configurations, build one, and keep it in a
place distinct from commrec (which has too many responsibilities
already).

Note that the master thread-MPI rank builds a fake one initially,
because MPI is not yet initialized, then coordinates to build the real
one with the newly launched threads. However that communicator is not
actually used until after the execution paths have re-joined.

Simplifies IThreadAffinityAccess while retaining the ability to test
the affinity-setting logic without requiring specific attributes of
the node. Note that some of the tests already required that a
particular MPI environment exists.

Change-Id: Ie0800b07a65f9579ddc8af8f418cd14b85671de7
28 files changed:
src/gromacs/domdec/domdec.cpp
src/gromacs/ewald/tests/testhardwarecontexts.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gmxlib/network.h
src/gromacs/hardware/detecthardware.cpp
src/gromacs/hardware/detecthardware.h
src/gromacs/mdlib/force.h
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/gmx_omp_nthreads.cpp
src/gromacs/mdlib/gmx_omp_nthreads.h
src/gromacs/mdrunutility/tests/threadaffinitytest.cpp
src/gromacs/mdrunutility/tests/threadaffinitytest.h
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/mdrunutility/threadaffinity.h
src/gromacs/mdtypes/commrec.h
src/gromacs/taskassignment/findallgputasks.cpp
src/gromacs/taskassignment/findallgputasks.h
src/gromacs/taskassignment/resourcedivision.cpp
src/gromacs/taskassignment/resourcedivision.h
src/gromacs/taskassignment/taskassignment.cpp
src/gromacs/taskassignment/taskassignment.h
src/gromacs/utility/gmxmpi.h
src/gromacs/utility/physicalnodecommunicator.cpp [new file with mode: 0644]
src/gromacs/utility/physicalnodecommunicator.h [new file with mode: 0644]
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/physicalnodecommunicator-mpi.cpp [new file with mode: 0644]
src/gromacs/utility/tests/physicalnodecommunicator.cpp [new file with mode: 0644]
src/programs/mdrun/runner.cpp