From: Teemu Murtola Date: Tue, 25 Mar 2014 04:10:31 +0000 (+0200) Subject: Move thread_mpi to src/external/ X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=8c1a0b040eee82e6277cecdd58db9211bb9f4a55;p=alexxy%2Fgromacs.git Move thread_mpi to src/external/ Now that thread-MPI headers are no longer installed, the whole thing can be easily moved to src/external/, which better resembles its status until it is decided what we really want to do with it. There, it is excluded from checks that are done for other parts of the source, as well as from Doxygen, removing the need to treat it specially in all these cases. This also removes a large number of headers from legacyheaders/ with a relatively simple change, advancing this effort. Related to #1411. Change-Id: I64d202eb61dc2c61668ad5858d551add6578cb97 --- diff --git a/.gitattributes b/.gitattributes index 1aa10d59e3..e9739ac874 100644 --- a/.gitattributes +++ b/.gitattributes @@ -35,10 +35,6 @@ scripts/make_gromos_rtp.py !filter src/contrib/* !filter src/gromacs/gmxlib/gpu_utils/memtestG80_core.* !filter src/gromacs/gmxlib/nonbonded/preprocessor/gmxpreprocess.py !filter -**/thread_mpi/** filter=uncrustify_only -src/gromacs/gmxlib/thread_mpi/CMakeLists.txt !filter -src/gromacs/legacyheaders/thread_mpi.h filter=uncrustify_only -src/gromacs/legacyheaders/tmpi.h filter=uncrustify_only src/gromacs/linearalgebra/gmx_blas/* !filter src/gromacs/linearalgebra/gmx_lapack/* !filter src/gromacs/selection/parser.cpp !filter diff --git a/CMakeLists.txt b/CMakeLists.txt index 6180d173f7..63e61763c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,9 +454,8 @@ if (GMX_X11) endif() include(ThreadMPI) -set(THREAD_MPI_LIB thread_mpi) # Enable core threading facilities -tmpi_enable_core("${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders") +tmpi_enable_core("${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include") # Enable tMPI C++ support tmpi_enable_cxx() if(GMX_THREAD_MPI) @@ -465,7 +464,6 @@ if(GMX_THREAD_MPI) set(GMX_MPI 1) set(MPI_IN_PLACE_EXISTS 1) endif() -tmpi_get_source_list(THREAD_MPI_SRC) # If atomics are manually disabled a define is needed because atomics.h doesn't depend on config.h if (TMPI_ATOMICS_DISABLED) add_definitions(-DTMPI_ATOMICS_DISABLED) @@ -550,6 +548,7 @@ endif() add_definitions( -DHAVE_CONFIG_H ) include_directories(${CMAKE_SOURCE_DIR}/src) +include_directories(${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include) # Required for config.h, maybe should only be set in src/CMakeLists.txt include_directories(${CMAKE_BINARY_DIR}/src) # Required for gmx_header_config_gen.h to be found before installation diff --git a/COPYING b/COPYING index 23867a8ee6..8d102037d7 100644 --- a/COPYING +++ b/COPYING @@ -995,8 +995,7 @@ available at http://www.gnu.org/licenses/lgpl-3.0.txt. 5. thread_mpi ============= - Files: src/gromacs/legacyheaders/thread_mpi/ - src/gromacs/gmxlib/thread_mpi/ + Files: src/external/thread_mpi/ Copyright (c) 2009-2012, Sander Pronk & Erik Lindahl. All rights reserved. diff --git a/cmake/ThreadMPI.cmake b/cmake/ThreadMPI.cmake index 7eabdd450f..d039dba5af 100644 --- a/cmake/ThreadMPI.cmake +++ b/cmake/ThreadMPI.cmake @@ -168,36 +168,36 @@ MACRO(TMPI_ENABLE) ENDMACRO(TMPI_ENABLE) -MACRO(TMPI_GET_SOURCE_LIST SRC_VARIABLE) +MACRO(TMPI_GET_SOURCE_LIST SRC_VARIABLE SRC_ROOT) set(${SRC_VARIABLE} - thread_mpi/errhandler.c - thread_mpi/tmpi_malloc.c - thread_mpi/atomic.c - thread_mpi/lock.c) + ${SRC_ROOT}/errhandler.c + ${SRC_ROOT}/tmpi_malloc.c + ${SRC_ROOT}/atomic.c + ${SRC_ROOT}/lock.c) if (THREAD_PTHREADS) - list(APPEND ${SRC_VARIABLE} thread_mpi/pthreads.c) + list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/pthreads.c) elseif (THREAD_WINDOWS) - list(APPEND ${SRC_VARIABLE} thread_mpi/winthreads.c) + list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/winthreads.c) endif () if (TMPI_CXX_LIB) - list(APPEND ${SRC_VARIABLE} thread_mpi/system_error.cpp) + list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/system_error.cpp) endif () if (TMPI_ENABLED) list(APPEND ${SRC_VARIABLE} - thread_mpi/alltoall.c thread_mpi/p2p_protocol.c - thread_mpi/barrier.c thread_mpi/p2p_send_recv.c - thread_mpi/bcast.c thread_mpi/p2p_wait.c - thread_mpi/collective.c thread_mpi/profile.c - thread_mpi/comm.c thread_mpi/reduce.c - thread_mpi/event.c thread_mpi/reduce_fast.c - thread_mpi/gather.c thread_mpi/scatter.c - thread_mpi/group.c thread_mpi/tmpi_init.c - thread_mpi/topology.c thread_mpi/list.c - thread_mpi/type.c thread_mpi/scan.c - thread_mpi/numa_malloc.c thread_mpi/once.c) + ${SRC_ROOT}/alltoall.c ${SRC_ROOT}/p2p_protocol.c + ${SRC_ROOT}/barrier.c ${SRC_ROOT}/p2p_send_recv.c + ${SRC_ROOT}/bcast.c ${SRC_ROOT}/p2p_wait.c + ${SRC_ROOT}/collective.c ${SRC_ROOT}/profile.c + ${SRC_ROOT}/comm.c ${SRC_ROOT}/reduce.c + ${SRC_ROOT}/event.c ${SRC_ROOT}/reduce_fast.c + ${SRC_ROOT}/gather.c ${SRC_ROOT}/scatter.c + ${SRC_ROOT}/group.c ${SRC_ROOT}/tmpi_init.c + ${SRC_ROOT}/topology.c ${SRC_ROOT}/list.c + ${SRC_ROOT}/type.c ${SRC_ROOT}/scan.c + ${SRC_ROOT}/numa_malloc.c ${SRC_ROOT}/once.c) endif() ENDMACRO(TMPI_GET_SOURCE_LIST) diff --git a/doxygen/Doxyfile-common.cmakein b/doxygen/Doxyfile-common.cmakein index 580039ea2e..344173026f 100644 --- a/doxygen/Doxyfile-common.cmakein +++ b/doxygen/Doxyfile-common.cmakein @@ -13,7 +13,6 @@ RECURSIVE = YES EXCLUDE = @CMAKE_SOURCE_DIR@/doxygen/examples \ @CMAKE_SOURCE_DIR@/src/contrib \ @CMAKE_SOURCE_DIR@/src/external \ - @CMAKE_SOURCE_DIR@/src/gromacs/legacyheaders/thread_mpi/atomic \ @CMAKE_SOURCE_DIR@/src/gromacs/selection/parser.cpp \ @CMAKE_SOURCE_DIR@/src/gromacs/selection/parser.h \ @CMAKE_SOURCE_DIR@/src/gromacs/selection/scanner.cpp @NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN@ @@ -34,7 +33,8 @@ ENABLED_SECTIONS = @DOXYGEN_SECTIONS@ MACRO_EXPANSION = YES # Extract documentation also for code in headers within #ifdef __cplusplus PREDEFINED = __cplusplus -# This is for thread_mpi to #ifdef some code out that should not be documented. +# This is for cases where \cond does not work, so that #ifndef can also be used. +# thread_mpi also uses this, but it is now excluded from the documentation. PREDEFINED += DOXYGEN # This makes 'static gmx_inline' functions appear better in the documentation. PREDEFINED += gmx_inline=inline diff --git a/doxygen/mainpage.md b/doxygen/mainpage.md index 217cf5f8c8..9393c835f3 100644 --- a/doxygen/mainpage.md +++ b/doxygen/mainpage.md @@ -69,11 +69,6 @@ give an overview of some of the topics that are documented: - \subpage page_simd
Documentation about the new SIMD module that makes it possible to write highly accelerated CPU code that is still portable. - - \subpage thread_mpi
- This code is used internally for threading support, and also provides a - (partial) MPI implementation that allows compiling a "thread-MPI" version of - \Gromacs that can run on a single node with most of the functionality of a - real MPI version. \endif This list will hopefully expand over time. diff --git a/src/gromacs/legacyheaders/thread_mpi.h b/src/external/thread_mpi/include/thread_mpi.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi.h rename to src/external/thread_mpi/include/thread_mpi.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic.h b/src/external/thread_mpi/include/thread_mpi/atomic.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic.h rename to src/external/thread_mpi/include/thread_mpi/atomic.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/cce.h b/src/external/thread_mpi/include/thread_mpi/atomic/cce.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/cce.h rename to src/external/thread_mpi/include/thread_mpi/atomic/cce.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/cce_intrinsics.h b/src/external/thread_mpi/include/thread_mpi/atomic/cce_intrinsics.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/cce_intrinsics.h rename to src/external/thread_mpi/include/thread_mpi/atomic/cce_intrinsics.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/cce_spinlock.h b/src/external/thread_mpi/include/thread_mpi/atomic/cce_spinlock.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/cce_spinlock.h rename to src/external/thread_mpi/include/thread_mpi/atomic/cce_spinlock.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/cycles.h b/src/external/thread_mpi/include/thread_mpi/atomic/cycles.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/cycles.h rename to src/external/thread_mpi/include/thread_mpi/atomic/cycles.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/derived.h b/src/external/thread_mpi/include/thread_mpi/atomic/derived.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/derived.h rename to src/external/thread_mpi/include/thread_mpi/atomic/derived.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/fujitsu_sparc64.h b/src/external/thread_mpi/include/thread_mpi/atomic/fujitsu_sparc64.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/fujitsu_sparc64.h rename to src/external/thread_mpi/include/thread_mpi/atomic/fujitsu_sparc64.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ia64.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc_ia64.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ia64.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc_ia64.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc_intrinsics.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc_intrinsics.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_intrinsics.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc_intrinsics.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ppc.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc_ppc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ppc.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc_ppc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc_spinlock.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc_spinlock.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_spinlock.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc_spinlock.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/gcc_x86.h b/src/external/thread_mpi/include/thread_mpi/atomic/gcc_x86.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_x86.h rename to src/external/thread_mpi/include/thread_mpi/atomic/gcc_x86.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/msvc.h b/src/external/thread_mpi/include/thread_mpi/atomic/msvc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/msvc.h rename to src/external/thread_mpi/include/thread_mpi/atomic/msvc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/suncc-sparc.h b/src/external/thread_mpi/include/thread_mpi/atomic/suncc-sparc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/suncc-sparc.h rename to src/external/thread_mpi/include/thread_mpi/atomic/suncc-sparc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/atomic/xlc_ppc.h b/src/external/thread_mpi/include/thread_mpi/atomic/xlc_ppc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/atomic/xlc_ppc.h rename to src/external/thread_mpi/include/thread_mpi/atomic/xlc_ppc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/barrier.h b/src/external/thread_mpi/include/thread_mpi/barrier.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/barrier.h rename to src/external/thread_mpi/include/thread_mpi/barrier.h diff --git a/src/gromacs/legacyheaders/thread_mpi/collective.h b/src/external/thread_mpi/include/thread_mpi/collective.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/collective.h rename to src/external/thread_mpi/include/thread_mpi/collective.h diff --git a/src/gromacs/legacyheaders/thread_mpi/event.h b/src/external/thread_mpi/include/thread_mpi/event.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/event.h rename to src/external/thread_mpi/include/thread_mpi/event.h diff --git a/src/gromacs/legacyheaders/thread_mpi/hwinfo.h b/src/external/thread_mpi/include/thread_mpi/hwinfo.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/hwinfo.h rename to src/external/thread_mpi/include/thread_mpi/hwinfo.h diff --git a/src/gromacs/legacyheaders/thread_mpi/list.h b/src/external/thread_mpi/include/thread_mpi/list.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/list.h rename to src/external/thread_mpi/include/thread_mpi/list.h diff --git a/src/gromacs/legacyheaders/thread_mpi/lock.h b/src/external/thread_mpi/include/thread_mpi/lock.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/lock.h rename to src/external/thread_mpi/include/thread_mpi/lock.h diff --git a/src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h b/src/external/thread_mpi/include/thread_mpi/mpi_bindings.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h rename to src/external/thread_mpi/include/thread_mpi/mpi_bindings.h diff --git a/src/gromacs/legacyheaders/thread_mpi/mutex.h b/src/external/thread_mpi/include/thread_mpi/mutex.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/mutex.h rename to src/external/thread_mpi/include/thread_mpi/mutex.h diff --git a/src/gromacs/legacyheaders/thread_mpi/numa_malloc.h b/src/external/thread_mpi/include/thread_mpi/numa_malloc.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/numa_malloc.h rename to src/external/thread_mpi/include/thread_mpi/numa_malloc.h diff --git a/src/gromacs/legacyheaders/thread_mpi/system_error.h b/src/external/thread_mpi/include/thread_mpi/system_error.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/system_error.h rename to src/external/thread_mpi/include/thread_mpi/system_error.h diff --git a/src/gromacs/legacyheaders/thread_mpi/threads.h b/src/external/thread_mpi/include/thread_mpi/threads.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/threads.h rename to src/external/thread_mpi/include/thread_mpi/threads.h diff --git a/src/gromacs/legacyheaders/thread_mpi/tmpi.h b/src/external/thread_mpi/include/thread_mpi/tmpi.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/tmpi.h rename to src/external/thread_mpi/include/thread_mpi/tmpi.h diff --git a/src/gromacs/legacyheaders/thread_mpi/visibility.h b/src/external/thread_mpi/include/thread_mpi/visibility.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/visibility.h rename to src/external/thread_mpi/include/thread_mpi/visibility.h diff --git a/src/gromacs/legacyheaders/thread_mpi/wait.h b/src/external/thread_mpi/include/thread_mpi/wait.h similarity index 100% rename from src/gromacs/legacyheaders/thread_mpi/wait.h rename to src/external/thread_mpi/include/thread_mpi/wait.h diff --git a/src/gromacs/legacyheaders/tmpi.h b/src/external/thread_mpi/include/tmpi.h similarity index 100% rename from src/gromacs/legacyheaders/tmpi.h rename to src/external/thread_mpi/include/tmpi.h diff --git a/src/gromacs/gmxlib/thread_mpi/alltoall.c b/src/external/thread_mpi/src/alltoall.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/alltoall.c rename to src/external/thread_mpi/src/alltoall.c diff --git a/src/gromacs/gmxlib/thread_mpi/atomic.c b/src/external/thread_mpi/src/atomic.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/atomic.c rename to src/external/thread_mpi/src/atomic.c diff --git a/src/gromacs/gmxlib/thread_mpi/barrier.c b/src/external/thread_mpi/src/barrier.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/barrier.c rename to src/external/thread_mpi/src/barrier.c diff --git a/src/gromacs/gmxlib/thread_mpi/bcast.c b/src/external/thread_mpi/src/bcast.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/bcast.c rename to src/external/thread_mpi/src/bcast.c diff --git a/src/gromacs/gmxlib/thread_mpi/collective.c b/src/external/thread_mpi/src/collective.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/collective.c rename to src/external/thread_mpi/src/collective.c diff --git a/src/gromacs/gmxlib/thread_mpi/collective.h b/src/external/thread_mpi/src/collective.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/collective.h rename to src/external/thread_mpi/src/collective.h diff --git a/src/gromacs/gmxlib/thread_mpi/comm.c b/src/external/thread_mpi/src/comm.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/comm.c rename to src/external/thread_mpi/src/comm.c diff --git a/src/gromacs/gmxlib/thread_mpi/errhandler.c b/src/external/thread_mpi/src/errhandler.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/errhandler.c rename to src/external/thread_mpi/src/errhandler.c diff --git a/src/gromacs/gmxlib/thread_mpi/event.c b/src/external/thread_mpi/src/event.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/event.c rename to src/external/thread_mpi/src/event.c diff --git a/src/gromacs/gmxlib/thread_mpi/gather.c b/src/external/thread_mpi/src/gather.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/gather.c rename to src/external/thread_mpi/src/gather.c diff --git a/src/gromacs/gmxlib/thread_mpi/group.c b/src/external/thread_mpi/src/group.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/group.c rename to src/external/thread_mpi/src/group.c diff --git a/src/gromacs/gmxlib/thread_mpi/impl.h b/src/external/thread_mpi/src/impl.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/impl.h rename to src/external/thread_mpi/src/impl.h diff --git a/src/gromacs/gmxlib/thread_mpi/list.c b/src/external/thread_mpi/src/list.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/list.c rename to src/external/thread_mpi/src/list.c diff --git a/src/gromacs/gmxlib/thread_mpi/lock.c b/src/external/thread_mpi/src/lock.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/lock.c rename to src/external/thread_mpi/src/lock.c diff --git a/src/gromacs/gmxlib/thread_mpi/numa_malloc.c b/src/external/thread_mpi/src/numa_malloc.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/numa_malloc.c rename to src/external/thread_mpi/src/numa_malloc.c diff --git a/src/gromacs/gmxlib/thread_mpi/once.c b/src/external/thread_mpi/src/once.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/once.c rename to src/external/thread_mpi/src/once.c diff --git a/src/gromacs/gmxlib/thread_mpi/p2p.h b/src/external/thread_mpi/src/p2p.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/p2p.h rename to src/external/thread_mpi/src/p2p.h diff --git a/src/gromacs/gmxlib/thread_mpi/p2p_buffer.c b/src/external/thread_mpi/src/p2p_buffer.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/p2p_buffer.c rename to src/external/thread_mpi/src/p2p_buffer.c diff --git a/src/gromacs/gmxlib/thread_mpi/p2p_protocol.c b/src/external/thread_mpi/src/p2p_protocol.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/p2p_protocol.c rename to src/external/thread_mpi/src/p2p_protocol.c diff --git a/src/gromacs/gmxlib/thread_mpi/p2p_send_recv.c b/src/external/thread_mpi/src/p2p_send_recv.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/p2p_send_recv.c rename to src/external/thread_mpi/src/p2p_send_recv.c diff --git a/src/gromacs/gmxlib/thread_mpi/p2p_wait.c b/src/external/thread_mpi/src/p2p_wait.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/p2p_wait.c rename to src/external/thread_mpi/src/p2p_wait.c diff --git a/src/gromacs/gmxlib/thread_mpi/profile.c b/src/external/thread_mpi/src/profile.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/profile.c rename to src/external/thread_mpi/src/profile.c diff --git a/src/gromacs/gmxlib/thread_mpi/profile.h b/src/external/thread_mpi/src/profile.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/profile.h rename to src/external/thread_mpi/src/profile.h diff --git a/src/gromacs/gmxlib/thread_mpi/pthreads.c b/src/external/thread_mpi/src/pthreads.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/pthreads.c rename to src/external/thread_mpi/src/pthreads.c diff --git a/src/gromacs/gmxlib/thread_mpi/pthreads.h b/src/external/thread_mpi/src/pthreads.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/pthreads.h rename to src/external/thread_mpi/src/pthreads.h diff --git a/src/gromacs/gmxlib/thread_mpi/reduce.c b/src/external/thread_mpi/src/reduce.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/reduce.c rename to src/external/thread_mpi/src/reduce.c diff --git a/src/gromacs/gmxlib/thread_mpi/reduce_fast.c b/src/external/thread_mpi/src/reduce_fast.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/reduce_fast.c rename to src/external/thread_mpi/src/reduce_fast.c diff --git a/src/gromacs/gmxlib/thread_mpi/scan.c b/src/external/thread_mpi/src/scan.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/scan.c rename to src/external/thread_mpi/src/scan.c diff --git a/src/gromacs/gmxlib/thread_mpi/scatter.c b/src/external/thread_mpi/src/scatter.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/scatter.c rename to src/external/thread_mpi/src/scatter.c diff --git a/src/gromacs/gmxlib/thread_mpi/settings.h b/src/external/thread_mpi/src/settings.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/settings.h rename to src/external/thread_mpi/src/settings.h diff --git a/src/gromacs/gmxlib/thread_mpi/system_error.cpp b/src/external/thread_mpi/src/system_error.cpp similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/system_error.cpp rename to src/external/thread_mpi/src/system_error.cpp diff --git a/src/gromacs/gmxlib/thread_mpi/tmpi_init.c b/src/external/thread_mpi/src/tmpi_init.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/tmpi_init.c rename to src/external/thread_mpi/src/tmpi_init.c diff --git a/src/gromacs/gmxlib/thread_mpi/tmpi_malloc.c b/src/external/thread_mpi/src/tmpi_malloc.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/tmpi_malloc.c rename to src/external/thread_mpi/src/tmpi_malloc.c diff --git a/src/gromacs/gmxlib/thread_mpi/tmpi_ops.h b/src/external/thread_mpi/src/tmpi_ops.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/tmpi_ops.h rename to src/external/thread_mpi/src/tmpi_ops.h diff --git a/src/gromacs/gmxlib/thread_mpi/topology.c b/src/external/thread_mpi/src/topology.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/topology.c rename to src/external/thread_mpi/src/topology.c diff --git a/src/gromacs/gmxlib/thread_mpi/type.c b/src/external/thread_mpi/src/type.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/type.c rename to src/external/thread_mpi/src/type.c diff --git a/src/gromacs/gmxlib/thread_mpi/unused.h b/src/external/thread_mpi/src/unused.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/unused.h rename to src/external/thread_mpi/src/unused.h diff --git a/src/gromacs/gmxlib/thread_mpi/winthreads.c b/src/external/thread_mpi/src/winthreads.c similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/winthreads.c rename to src/external/thread_mpi/src/winthreads.c diff --git a/src/gromacs/gmxlib/thread_mpi/winthreads.h b/src/external/thread_mpi/src/winthreads.h similarity index 100% rename from src/gromacs/gmxlib/thread_mpi/winthreads.h rename to src/external/thread_mpi/src/winthreads.h diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 6f5d146b1b..a541e1c466 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -75,6 +75,16 @@ endif() list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES}) +# This would be the standard way to include thread_mpi, but +# we want libgromacs to link the functions directly +#if(GMX_THREAD_MPI) +# add_subdirectory(thread_mpi) +#endif() +#target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB}) + +tmpi_get_source_list(THREAD_MPI_SOURCES ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/src) +list(APPEND LIBGROMACS_SOURCES ${THREAD_MPI_SOURCES}) + file(GLOB LIBGROMACS_HEADERS *.h) configure_file(version.h.cmakein version.h) gmx_install_headers("" ${LIBGROMACS_HEADERS}) diff --git a/src/gromacs/commandline/cmdlineprogramcontext.cpp b/src/gromacs/commandline/cmdlineprogramcontext.cpp index ce66daf88a..0f3ce6c383 100644 --- a/src/gromacs/commandline/cmdlineprogramcontext.cpp +++ b/src/gromacs/commandline/cmdlineprogramcontext.cpp @@ -53,7 +53,7 @@ #include -#include "gromacs/legacyheaders/thread_mpi/mutex.h" +#include "thread_mpi/mutex.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/file.h" diff --git a/src/gromacs/commandline/pargs.cpp b/src/gromacs/commandline/pargs.cpp index 5fab063d68..d78d31b195 100644 --- a/src/gromacs/commandline/pargs.cpp +++ b/src/gromacs/commandline/pargs.cpp @@ -56,12 +56,13 @@ #include #endif +#include "thread_mpi/threads.h" + #include "gromacs/legacyheaders/gmx_fatal.h" #include "gromacs/legacyheaders/macros.h" #include "gromacs/legacyheaders/network.h" #include "gromacs/legacyheaders/smalloc.h" #include "gromacs/legacyheaders/string2.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" #include "gromacs/commandline/cmdlinehelpcontext.h" #include "gromacs/commandline/cmdlinehelpwriter.h" diff --git a/src/gromacs/fileio/futil.cpp b/src/gromacs/fileio/futil.cpp index 28b5af6d29..cbfba4683f 100644 --- a/src/gromacs/fileio/futil.cpp +++ b/src/gromacs/fileio/futil.cpp @@ -65,6 +65,8 @@ #include #endif +#include "thread_mpi/threads.h" + #include "gromacs/legacyheaders/gmx_fatal.h" #include "gromacs/legacyheaders/types/commrec.h" #include "gromacs/legacyheaders/network.h" @@ -77,8 +79,6 @@ #include "gromacs/utility/programcontext.h" #include "gromacs/utility/stringutil.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" - /* we keep a linked list of all files opened through pipes (i.e. compressed or .gzipped files. This way we can distinguish between them without having to change the semantics of reading from/writing to files) diff --git a/src/gromacs/fileio/gmxfio.c b/src/gromacs/fileio/gmxfio.c index 3325a3605b..25696d1a4f 100644 --- a/src/gromacs/fileio/gmxfio.c +++ b/src/gromacs/fileio/gmxfio.c @@ -48,6 +48,8 @@ #include #endif +#include "thread_mpi/threads.h" + #include "gmx_fatal.h" #include "macros.h" #include "smalloc.h" @@ -57,8 +59,6 @@ #include "gmxfio.h" #include "md5.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" - #include "gmxfio_int.h" /* This is the new improved and thread safe version of gmxfio. */ diff --git a/src/gromacs/fileio/gmxfio_int.h b/src/gromacs/fileio/gmxfio_int.h index 9399a966b9..cedde9ae90 100644 --- a/src/gromacs/fileio/gmxfio_int.h +++ b/src/gromacs/fileio/gmxfio_int.h @@ -2,8 +2,8 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team, - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2001-2004, The GROMACS development team. + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -56,7 +56,8 @@ */ #define USE_XDR -#include "gromacs/legacyheaders/thread_mpi/lock.h" +#include "thread_mpi/lock.h" + #include "xdrf.h" /* the reader/writer functions for t_iotype */ diff --git a/src/gromacs/fileio/timecontrol.c b/src/gromacs/fileio/timecontrol.c index 1f084a1a0d..062a771665 100644 --- a/src/gromacs/fileio/timecontrol.c +++ b/src/gromacs/fileio/timecontrol.c @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,11 +40,11 @@ #include #endif +#include "thread_mpi/threads.h" + #include "gromacs/legacyheaders/types/simple.h" #include "gromacs/legacyheaders/gmx_fatal.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" - /* The source code in this file should be thread-safe. Please keep it that way. */ diff --git a/src/gromacs/gmxlib/CMakeLists.txt b/src/gromacs/gmxlib/CMakeLists.txt index ca1b51e731..204fb6a66a 100644 --- a/src/gromacs/gmxlib/CMakeLists.txt +++ b/src/gromacs/gmxlib/CMakeLists.txt @@ -40,13 +40,6 @@ add_subdirectory(nonbonded) # conditionally built, so we cannot use a GLOB_RECURSE here. file(GLOB GMXLIB_SOURCES *.c *.cpp) -# This would be the standard way to include thread_mpi, but we want libgmx -# to link the functions directly -#if(GMX_THREAD_MPI) -# add_subdirectory(thread_mpi) -#endif() -#target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB}) - # Files called xxx_test.c are test drivers with a main() function for module xxx.c, # so they should not be included in the library file(GLOB_RECURSE NOT_GMXLIB_SOURCES *_test.c *\#*) @@ -60,8 +53,4 @@ if(GMX_GPU) set(GMX_GPU_LIBRARIES ${GMX_GPU_LIBRARIES} gpu_utils cuda_tools PARENT_SCOPE) endif() -# An ugly hack to get absolute paths... -file(GLOB THREAD_MPI_SOURCES ${THREAD_MPI_SRC}) - -set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${THREAD_MPI_SOURCES} ${NONBONDED_SOURCES} - PARENT_SCOPE) +set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${NONBONDED_SOURCES} PARENT_SCOPE) diff --git a/src/gromacs/gmxlib/gmx_fatal.c b/src/gromacs/gmxlib/gmx_fatal.c index 86ea380790..c7bab505db 100644 --- a/src/gromacs/gmxlib/gmx_fatal.c +++ b/src/gromacs/gmxlib/gmx_fatal.c @@ -43,6 +43,8 @@ #include #include +#include "thread_mpi/threads.h" + #include "main.h" #include "types/commrec.h" #include "network.h" @@ -56,8 +58,6 @@ #include "gromacs/fileio/gmxfio.h" #include "gromacs/utility/gmxmpi.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" - static gmx_bool bDebug = FALSE; static char *fatal_tmp_file = NULL; static FILE *log_file = NULL; diff --git a/src/gromacs/gmxlib/nonbonded/nonbonded.c b/src/gromacs/gmxlib/nonbonded/nonbonded.c index d8dc5767b6..d85fecec8b 100644 --- a/src/gromacs/gmxlib/nonbonded/nonbonded.c +++ b/src/gromacs/gmxlib/nonbonded/nonbonded.c @@ -38,10 +38,11 @@ #include #endif -#include "gromacs/legacyheaders/thread_mpi/threads.h" - #include #include + +#include "thread_mpi/threads.h" + #include "typedefs.h" #include "txtdump.h" #include "smalloc.h" diff --git a/src/gromacs/gmxlib/smalloc.c b/src/gromacs/gmxlib/smalloc.c index cd74825483..4578ffcaa7 100644 --- a/src/gromacs/gmxlib/smalloc.c +++ b/src/gromacs/gmxlib/smalloc.c @@ -53,7 +53,7 @@ #endif #ifdef DEBUG -#include "gromacs/legacyheaders/thread_mpi/threads.h" +#include "thread_mpi/threads.h" static void log_action(int bMal, const char *what, const char *file, int line, int nelem, int size, void *ptr) diff --git a/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt b/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt deleted file mode 100644 index 62f082e779..0000000000 --- a/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ - -# Note that not all .c files are compiled directly: some of them -# are #included (some multiple times) from other source files. -set(THREAD_MPI_LIB_SOURCE - alltoall.c reduce.c scan.c - barrier.c list.c reduce_fast.c - bcast.c lock.c scatter.c - collective.c once.c tmpi_init.c - comm.c p2p_protocol.c topology.c - errhandler.c p2p_send_recv.c type.c - event.c p2p_wait.c tmpi_malloc.c - gather.c profile.c - group.c numa_malloc.c atomic.c) - - -if (THREAD_PTHREADS) - set(THREAD_MPI_LIB_SOURCE pthreads.c ${THREAD_MPI_LIB_SOURCE}) -else (THREAD_PTHREADS) - if (THREAD_WINDOWS) - set(THREAD_MPI_LIB_SOURCE winthreads.c ${THREAD_MPI_LIB_SOURCE}) - endif() -endif() - - -add_library(thread_mpi STATIC ${THREAD_MPI_LIB_SOURCE}) - -# make it link to the threads library (-lpthreads, for example) -target_link_libraries(thread_mpi ${THREAD_LIB}) - -if (TMPI_CXX_LIB) - set(THREAD_MPI_CXX_LIB_SOURCE - system_error.cpp ) - add_library(thread_mpi_cxx STATIC ${THREAD_MPI_CXX_LIB_SOURCE}) - target_link_libraries(thread_mpi_cxx thread_mpi) -endif() - -#configure_file(tmpi_config.h.cmakein tmpi_config.h) -#add_definitions(-DHAVE_TMPI_CONFIG_H) -#include_directories( . ) - -# this configure file only works here. If you include the source -# files into your project, insert the contest of the tmpi_config.h.cmakein -# into your config.h.cmakein file -configure_file(tmpi_config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/tmpi_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) -add_definitions(-DHAVE_TMPI_CONFIG_H) - -install(TARGETS thread_mpi DESTINATION lib) diff --git a/src/gromacs/gmxlib/typedefs.c b/src/gromacs/gmxlib/typedefs.c index ad7a93dca3..a550ee4789 100644 --- a/src/gromacs/gmxlib/typedefs.c +++ b/src/gromacs/gmxlib/typedefs.c @@ -39,6 +39,8 @@ #include #endif +#include "thread_mpi/threads.h" + #include "smalloc.h" #include "symtab.h" #include "vec.h" @@ -47,8 +49,6 @@ #include #include "gromacs/random/random.h" -#include "gromacs/legacyheaders/thread_mpi/threads.h" - /* The source code in this file should be thread-safe. Please keep it that way. */ diff --git a/src/gromacs/selection/nbsearch.cpp b/src/gromacs/selection/nbsearch.cpp index 268553218a..ffa113817f 100644 --- a/src/gromacs/selection/nbsearch.cpp +++ b/src/gromacs/selection/nbsearch.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -62,11 +62,12 @@ #include #include +#include "thread_mpi/mutex.h" + #include "gromacs/legacyheaders/smalloc.h" #include "gromacs/legacyheaders/typedefs.h" #include "gromacs/legacyheaders/pbc.h" #include "gromacs/legacyheaders/vec.h" -#include "gromacs/legacyheaders/thread_mpi/mutex.h" #include "gromacs/selection/position.h" #include "gromacs/utility/arrayref.h" diff --git a/src/gromacs/utility/errorcodes.cpp b/src/gromacs/utility/errorcodes.cpp index 476b22ef92..f03bf2d38b 100644 --- a/src/gromacs/utility/errorcodes.cpp +++ b/src/gromacs/utility/errorcodes.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,7 +43,7 @@ #include -#include "gromacs/legacyheaders/thread_mpi/mutex.h" +#include "thread_mpi/mutex.h" #include "errorformat.h" diff --git a/src/gromacs/utility/exceptions.cpp b/src/gromacs/utility/exceptions.cpp index f0e46f9bd1..0f0d003696 100644 --- a/src/gromacs/utility/exceptions.cpp +++ b/src/gromacs/utility/exceptions.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -54,8 +54,10 @@ #include #include +#include "thread_mpi/system_error.h" + #include "gromacs/legacyheaders/network.h" -#include "gromacs/legacyheaders/thread_mpi/system_error.h" + #include "gromacs/utility/errorcodes.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/stringutil.h" diff --git a/src/gromacs/utility/gmxmpi.h b/src/gromacs/utility/gmxmpi.h index 640d553f34..2861548555 100644 --- a/src/gromacs/utility/gmxmpi.h +++ b/src/gromacs/utility/gmxmpi.h @@ -80,8 +80,8 @@ #endif /*MPI_INT64_T*/ #else #ifdef GMX_THREAD_MPI -#include "../legacyheaders/thread_mpi/tmpi.h" -#include "../legacyheaders/thread_mpi/mpi_bindings.h" +#include "thread_mpi/tmpi.h" +#include "thread_mpi/mpi_bindings.h" #else typedef void* MPI_Comm; typedef void* MPI_Request; diff --git a/src/testutils/testoptions.cpp b/src/testutils/testoptions.cpp index 0b5e1c8951..f45871e3fe 100644 --- a/src/testutils/testoptions.cpp +++ b/src/testutils/testoptions.cpp @@ -48,7 +48,7 @@ #include -#include "gromacs/legacyheaders/thread_mpi/mutex.h" +#include "thread_mpi/mutex.h" #include "gromacs/commandline/cmdlinehelpcontext.h" #include "gromacs/commandline/cmdlinehelpwriter.h" diff --git a/tests/CppCheck.cmake b/tests/CppCheck.cmake index 0e3aeab8f7..1d7ac5c8e8 100644 --- a/tests/CppCheck.cmake +++ b/tests/CppCheck.cmake @@ -70,6 +70,7 @@ if (CPPCHECK_EXECUTABLE AND UNIX) set(_common_flags --enable=style -DLINUX -I src/gromacs/legacyheaders -I src + -I src/external/thread_mpi/include -I ${CMAKE_BINARY_DIR}/src -I ${CMAKE_BINARY_DIR}/src/gromacs/utility --quiet ${_outputopt})