Simplify mdrun tMPI thread spawning
commitaa81006ac32c29c10fd8bd3ef8669bd8338d7802
authorBerk Hess <hess@kth.se>
Thu, 22 Feb 2018 12:40:45 +0000 (22 13:40 +0100)
committerBerk Hess <hess@kth.se>
Thu, 22 Feb 2018 21:50:22 +0000 (22 22:50 +0100)
tree9dda6caefc1b4ef6cbbf9fe29cf2fb53e8d723ee
parent09828eddcf3a6281c50bdf42be59ef9f72e3d04b
Simplify mdrun tMPI thread spawning

During spawning of the tMPI threads in mdrunner, the mdrunner object
and filename pointer were copied twice. Now they are only copied once
and a const object/pointer is passed around.

Also made thread-MPI take a const argument to enable this and to
ensure correctness, as thread-MPI makes a copy of the argument pointer
for every thread which could cause problems without const.

Added an explicit MPI_Barrier after spawning, with documentation,
in preparation of removing the implicit barrier in MPI_Comm_split
in reinitialize_commrec_for_this_thread().

Change-Id: I31af8a8ff72aec28366c4aa20b357ed96bf95087
src/external/thread_mpi/include/thread_mpi/tmpi.h
src/external/thread_mpi/src/impl.h
src/external/thread_mpi/src/tmpi_init.cpp
src/programs/mdrun/runner.cpp
src/programs/mdrun/runner.h
src/testutils/mpitest.cpp