Move thread_mpi to src/external/
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 25 Mar 2014 04:10:31 +0000 (06:10 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 27 Mar 2014 03:15:44 +0000 (04:15 +0100)
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

96 files changed:
.gitattributes
CMakeLists.txt
COPYING
cmake/ThreadMPI.cmake
doxygen/Doxyfile-common.cmakein
doxygen/mainpage.md
src/external/thread_mpi/include/thread_mpi.h [moved from src/gromacs/legacyheaders/thread_mpi.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/cce.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/cce.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/cce_intrinsics.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/cce_intrinsics.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/cce_spinlock.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/cce_spinlock.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/cycles.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/cycles.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/derived.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/derived.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/fujitsu_sparc64.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/fujitsu_sparc64.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc_ia64.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ia64.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc_intrinsics.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_intrinsics.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc_ppc.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_ppc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc_spinlock.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_spinlock.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/gcc_x86.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/gcc_x86.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/msvc.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/msvc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/suncc-sparc.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/suncc-sparc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic/xlc_ppc.h [moved from src/gromacs/legacyheaders/thread_mpi/atomic/xlc_ppc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/barrier.h [moved from src/gromacs/legacyheaders/thread_mpi/barrier.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/collective.h [moved from src/gromacs/legacyheaders/thread_mpi/collective.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/event.h [moved from src/gromacs/legacyheaders/thread_mpi/event.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/hwinfo.h [moved from src/gromacs/legacyheaders/thread_mpi/hwinfo.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/list.h [moved from src/gromacs/legacyheaders/thread_mpi/list.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/lock.h [moved from src/gromacs/legacyheaders/thread_mpi/lock.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/mpi_bindings.h [moved from src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/mutex.h [moved from src/gromacs/legacyheaders/thread_mpi/mutex.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/numa_malloc.h [moved from src/gromacs/legacyheaders/thread_mpi/numa_malloc.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/system_error.h [moved from src/gromacs/legacyheaders/thread_mpi/system_error.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/threads.h [moved from src/gromacs/legacyheaders/thread_mpi/threads.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/tmpi.h [moved from src/gromacs/legacyheaders/thread_mpi/tmpi.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/visibility.h [moved from src/gromacs/legacyheaders/thread_mpi/visibility.h with 100% similarity]
src/external/thread_mpi/include/thread_mpi/wait.h [moved from src/gromacs/legacyheaders/thread_mpi/wait.h with 100% similarity]
src/external/thread_mpi/include/tmpi.h [moved from src/gromacs/legacyheaders/tmpi.h with 100% similarity]
src/external/thread_mpi/src/alltoall.c [moved from src/gromacs/gmxlib/thread_mpi/alltoall.c with 100% similarity]
src/external/thread_mpi/src/atomic.c [moved from src/gromacs/gmxlib/thread_mpi/atomic.c with 100% similarity]
src/external/thread_mpi/src/barrier.c [moved from src/gromacs/gmxlib/thread_mpi/barrier.c with 100% similarity]
src/external/thread_mpi/src/bcast.c [moved from src/gromacs/gmxlib/thread_mpi/bcast.c with 100% similarity]
src/external/thread_mpi/src/collective.c [moved from src/gromacs/gmxlib/thread_mpi/collective.c with 100% similarity]
src/external/thread_mpi/src/collective.h [moved from src/gromacs/gmxlib/thread_mpi/collective.h with 100% similarity]
src/external/thread_mpi/src/comm.c [moved from src/gromacs/gmxlib/thread_mpi/comm.c with 100% similarity]
src/external/thread_mpi/src/errhandler.c [moved from src/gromacs/gmxlib/thread_mpi/errhandler.c with 100% similarity]
src/external/thread_mpi/src/event.c [moved from src/gromacs/gmxlib/thread_mpi/event.c with 100% similarity]
src/external/thread_mpi/src/gather.c [moved from src/gromacs/gmxlib/thread_mpi/gather.c with 100% similarity]
src/external/thread_mpi/src/group.c [moved from src/gromacs/gmxlib/thread_mpi/group.c with 100% similarity]
src/external/thread_mpi/src/impl.h [moved from src/gromacs/gmxlib/thread_mpi/impl.h with 100% similarity]
src/external/thread_mpi/src/list.c [moved from src/gromacs/gmxlib/thread_mpi/list.c with 100% similarity]
src/external/thread_mpi/src/lock.c [moved from src/gromacs/gmxlib/thread_mpi/lock.c with 100% similarity]
src/external/thread_mpi/src/numa_malloc.c [moved from src/gromacs/gmxlib/thread_mpi/numa_malloc.c with 100% similarity]
src/external/thread_mpi/src/once.c [moved from src/gromacs/gmxlib/thread_mpi/once.c with 100% similarity]
src/external/thread_mpi/src/p2p.h [moved from src/gromacs/gmxlib/thread_mpi/p2p.h with 100% similarity]
src/external/thread_mpi/src/p2p_buffer.c [moved from src/gromacs/gmxlib/thread_mpi/p2p_buffer.c with 100% similarity]
src/external/thread_mpi/src/p2p_protocol.c [moved from src/gromacs/gmxlib/thread_mpi/p2p_protocol.c with 100% similarity]
src/external/thread_mpi/src/p2p_send_recv.c [moved from src/gromacs/gmxlib/thread_mpi/p2p_send_recv.c with 100% similarity]
src/external/thread_mpi/src/p2p_wait.c [moved from src/gromacs/gmxlib/thread_mpi/p2p_wait.c with 100% similarity]
src/external/thread_mpi/src/profile.c [moved from src/gromacs/gmxlib/thread_mpi/profile.c with 100% similarity]
src/external/thread_mpi/src/profile.h [moved from src/gromacs/gmxlib/thread_mpi/profile.h with 100% similarity]
src/external/thread_mpi/src/pthreads.c [moved from src/gromacs/gmxlib/thread_mpi/pthreads.c with 100% similarity]
src/external/thread_mpi/src/pthreads.h [moved from src/gromacs/gmxlib/thread_mpi/pthreads.h with 100% similarity]
src/external/thread_mpi/src/reduce.c [moved from src/gromacs/gmxlib/thread_mpi/reduce.c with 100% similarity]
src/external/thread_mpi/src/reduce_fast.c [moved from src/gromacs/gmxlib/thread_mpi/reduce_fast.c with 100% similarity]
src/external/thread_mpi/src/scan.c [moved from src/gromacs/gmxlib/thread_mpi/scan.c with 100% similarity]
src/external/thread_mpi/src/scatter.c [moved from src/gromacs/gmxlib/thread_mpi/scatter.c with 100% similarity]
src/external/thread_mpi/src/settings.h [moved from src/gromacs/gmxlib/thread_mpi/settings.h with 100% similarity]
src/external/thread_mpi/src/system_error.cpp [moved from src/gromacs/gmxlib/thread_mpi/system_error.cpp with 100% similarity]
src/external/thread_mpi/src/tmpi_init.c [moved from src/gromacs/gmxlib/thread_mpi/tmpi_init.c with 100% similarity]
src/external/thread_mpi/src/tmpi_malloc.c [moved from src/gromacs/gmxlib/thread_mpi/tmpi_malloc.c with 100% similarity]
src/external/thread_mpi/src/tmpi_ops.h [moved from src/gromacs/gmxlib/thread_mpi/tmpi_ops.h with 100% similarity]
src/external/thread_mpi/src/topology.c [moved from src/gromacs/gmxlib/thread_mpi/topology.c with 100% similarity]
src/external/thread_mpi/src/type.c [moved from src/gromacs/gmxlib/thread_mpi/type.c with 100% similarity]
src/external/thread_mpi/src/unused.h [moved from src/gromacs/gmxlib/thread_mpi/unused.h with 100% similarity]
src/external/thread_mpi/src/winthreads.c [moved from src/gromacs/gmxlib/thread_mpi/winthreads.c with 100% similarity]
src/external/thread_mpi/src/winthreads.h [moved from src/gromacs/gmxlib/thread_mpi/winthreads.h with 100% similarity]
src/gromacs/CMakeLists.txt
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/pargs.cpp
src/gromacs/fileio/futil.cpp
src/gromacs/fileio/gmxfio.c
src/gromacs/fileio/gmxfio_int.h
src/gromacs/fileio/timecontrol.c
src/gromacs/gmxlib/CMakeLists.txt
src/gromacs/gmxlib/gmx_fatal.c
src/gromacs/gmxlib/nonbonded/nonbonded.c
src/gromacs/gmxlib/smalloc.c
src/gromacs/gmxlib/thread_mpi/CMakeLists.txt [deleted file]
src/gromacs/gmxlib/typedefs.c
src/gromacs/selection/nbsearch.cpp
src/gromacs/utility/errorcodes.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/gmxmpi.h
src/testutils/testoptions.cpp
tests/CppCheck.cmake

index 1aa10d59e37cac3f28bc12b1ec2bdd0b0824c5ef..e9739ac87405f7cfc45b33b4ea60b6056c551363 100644 (file)
@@ -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
index 6180d173f7094e86ce6727a415024e91fc45811f..63e61763c3dc068c497fc8070f4a779dc5aa7681 100644 (file)
@@ -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 23867a8ee62798e2d5fc87e57c1e38c18e48dab8..8d102037d7e97048e7807f76bed0110e4e7912c7 100644 (file)
--- 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.
index 7eabdd450f62a7f4dbbc940f3766c9bf354f0bfa..d039dba5afd39972591a42db46a18341fcc4fa8f 100644 (file)
@@ -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)
 
index 580039ea2e1ebd38ed20598fea9752fd6a363899..344173026f4fdf01f0bec29d7ffc6eeeacd7179f 100644 (file)
@@ -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
index 217cf5f8c81c433a17376c3c21ff177b1f67c4dd..9393c835f3c479cb8439ab45dd070640d2e84e04 100644 (file)
@@ -69,11 +69,6 @@ give an overview of some of the topics that are documented:
  - \subpage page_simd <br/>
    Documentation about the new SIMD module that makes it possible to write
    highly accelerated CPU code that is still portable.
- - \subpage thread_mpi <br/>
-   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.
index 6f5d146b1b1c882d2e8c3c16a483ff4c2b1618c8..a541e1c46684d71e402155a052df5df75c7efad6 100644 (file)
@@ -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})
index ce66daf88a72072d6c456c977bb6f6380d3bc9a8..0f3ce6c383458e8a9e3913a98a500e45f1c80be5 100644 (file)
@@ -53,7 +53,7 @@
 
 #include <boost/scoped_ptr.hpp>
 
-#include "gromacs/legacyheaders/thread_mpi/mutex.h"
+#include "thread_mpi/mutex.h"
 
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
index 5fab063d6808db46d4dd03eed69a29213a09bf7d..d78d31b195cd67846035552321b6076c3b1c5580 100644 (file)
 #include <sys/sysmp.h>
 #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"
index 28b5af6d29371f97ee0a926c460ad9af3810d478..cbfba4683f1e48a2e99bc606dff363a2df987dbf 100644 (file)
@@ -65,6 +65,8 @@
 #include <windows.h>
 #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)
index 3325a3605b073264171f87e3abe6d0294726956e..25696d1a4feba75b3124a6de962905185b8fd616 100644 (file)
@@ -48,6 +48,8 @@
 #include <unistd.h>
 #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. */
index 9399a966b91934962b16734fe35a8a86ef02b52d..cedde9ae907317e4960af5a66ddbf6df88dcc871 100644 (file)
@@ -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 */
index 1f084a1a0db2dc34b4acd1a58c8a7a51cdbf283f..062a771665a1fb0dce1f2be6150288ee9f910d5c 100644 (file)
@@ -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.
 #include <config.h>
 #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. */
 
index ca1b51e731429d0c1573bd72924c35f0ecb8af71..204fb6a66adccf61ed32968b86d25dd871b14860 100644 (file)
@@ -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)
index 86ea38079061ba48904af4dbba78b2c4acbac68a..c7bab505dbd2d128b1e708b92d3a85c3241f1dd0 100644 (file)
@@ -43,6 +43,8 @@
 #include <stdarg.h>
 #include <string.h>
 
+#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;
index d8dc5767b6a2d8a1fece1fb4f43c9c88e6676298..d85fecec8bfb6eb4452d9d0a3790f521c2ad80c3 100644 (file)
 #include <config.h>
 #endif
 
-#include "gromacs/legacyheaders/thread_mpi/threads.h"
-
 #include <stdio.h>
 #include <stdlib.h>
+
+#include "thread_mpi/threads.h"
+
 #include "typedefs.h"
 #include "txtdump.h"
 #include "smalloc.h"
index cd7482548343ec2bdc2ddea28d5392644785861e..4578ffcaa75d3a8734aaeb4d78d35839d646de6d 100644 (file)
@@ -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 (file)
index 62f082e..0000000
+++ /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)
index ad7a93dca3cff962b50d9f498fffdfa7035fc1fa..a550ee4789f866ff3244b85add08f45ab269e64e 100644 (file)
@@ -39,6 +39,8 @@
 #include <config.h>
 #endif
 
+#include "thread_mpi/threads.h"
+
 #include "smalloc.h"
 #include "symtab.h"
 #include "vec.h"
@@ -47,8 +49,6 @@
 #include <string.h>
 #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. */
 
index 268553218ac65d6261a8788934055e8a536c7624..ffa113817f029e381c5792602b987b3394dedfd7 100644 (file)
@@ -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.
 #include <algorithm>
 #include <vector>
 
+#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"
index 476b22ef9291e65452db8ef382e858919e848bfc..f03bf2d38b4dce265ea6dfbebcc9203167301e62 100644 (file)
@@ -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 <cstdlib>
 
-#include "gromacs/legacyheaders/thread_mpi/mutex.h"
+#include "thread_mpi/mutex.h"
 
 #include "errorformat.h"
 
index f0e46f9bd15ae62dcb68c527c00ba407d226c32f..0f0d003696989cf3969e65dafcd5ad600d05b081 100644 (file)
@@ -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.
 #include <boost/exception/get_error_info.hpp>
 #include <boost/shared_ptr.hpp>
 
+#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"
index 640d553f34210fd9524a284373c1720559053658..286154855587dfce67f4cfb5ec0b17b5730e0dad 100644 (file)
@@ -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;
index 0b5e1c895175866ca9ce0504c7fd31883a796eec..f45871e3fea5637b3df45a6b416e617b963a059a 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <gmock/gmock.h>
 
-#include "gromacs/legacyheaders/thread_mpi/mutex.h"
+#include "thread_mpi/mutex.h"
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpwriter.h"
index 0e3aeab8f79e9652051acd52ecf959feeea0f7ed..1d7ac5c8e846a9fdd1c1db4278eaeed4d75c67df 100644 (file)
@@ -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})