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
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)
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)
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
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.
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)
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@
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
- \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.
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})
#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"
#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"
#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"
#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)
#include <unistd.h>
#endif
+#include "thread_mpi/threads.h"
+
#include "gmx_fatal.h"
#include "macros.h"
#include "smalloc.h"
#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. */
* 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.
*/
#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 */
*
* 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. */
# 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 *\#*)
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)
#include <stdarg.h>
#include <string.h>
+#include "thread_mpi/threads.h"
+
#include "main.h"
#include "types/commrec.h"
#include "network.h"
#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;
#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"
#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)
+++ /dev/null
-
-# 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)
#include <config.h>
#endif
+#include "thread_mpi/threads.h"
+
#include "smalloc.h"
#include "symtab.h"
#include "vec.h"
#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. */
/*
* 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"
/*
* 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.
#include <cstdlib>
-#include "gromacs/legacyheaders/thread_mpi/mutex.h"
+#include "thread_mpi/mutex.h"
#include "errorformat.h"
/*
* 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"
#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;
#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"
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})