Gentoo Archives: gentoo-commits

From: "Christoph Junghans (ottxor)" <ottxor@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-chemistry/gromacs/files: gromacs-4.6.1-openmm.patch
Date: Wed, 06 Mar 2013 02:02:06
Message-Id: 20130306020201.D225C2171E@flycatcher.gentoo.org
1 ottxor 13/03/06 02:02:01
2
3 Added: gromacs-4.6.1-openmm.patch
4 Log:
5 version bump
6
7 (Portage version: 2.2.0_alpha165/cvs/Linux x86_64, signed Manifest commit with key C2000586)
8
9 Revision Changes Path
10 1.1 sci-chemistry/gromacs/files/gromacs-4.6.1-openmm.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/files/gromacs-4.6.1-openmm.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/files/gromacs-4.6.1-openmm.patch?rev=1.1&content-type=text/plain
14
15 Index: gromacs-4.6.1-openmm.patch
16 ===================================================================
17 From e96c29f92e6cd1dd05945ef80e6a78d55747cf2e Mon Sep 17 00:00:00 2001
18 From: Christoph Junghans <junghans@×××××.org>
19 Date: Thu, 17 Jan 2013 20:30:30 -0700
20 Subject: [PATCH] fix out of source build for OpenMM
21
22 * introduced in e508a07b6e127fa1cf31d263bcbd33e4040066cb
23
24 Change-Id: I6ad45fd2d5766d1c4a91ef2e0c442ff030fc1296
25 ---
26 CMakeLists.txt | 2 +-
27 src/contrib/BuildMdrunOpenMM.cmake | 6 +++---
28 src/contrib/CMakeLists.txt | 3 ---
29 src/contrib/mdrun_openmm.c | 12 +++++++-----
30 src/contrib/openmm_wrapper.cpp | 1 +
31 src/kernel/CMakeLists.txt | 5 ++++-
32 6 files changed, 16 insertions(+), 13 deletions(-)
33
34 diff --git a/CMakeLists.txt b/CMakeLists.txt
35 index df12172..4c11a29 100644
36 --- a/CMakeLists.txt
37 +++ b/CMakeLists.txt
38 @@ -153,7 +153,7 @@ mark_as_advanced(GMX_FORCE_CXX)
39 option(GMX_COOL_QUOTES "Enable Gromacs cool quotes" ON)
40 mark_as_advanced(GMX_COOL_QUOTES)
41
42 -if(GMX_GPU OR GMX_FORCE_CXX)
43 +if(GMX_GPU OR GMX_FORCE_CXX OR GMX_OPENMM)
44 enable_language(CXX)
45 endif()
46 set(CMAKE_PREFIX_PATH "" CACHE STRING "Extra locations to search for external libraries and tools (give directory without lib, bin, or include)")
47 diff --git a/src/contrib/BuildMdrunOpenMM.cmake b/src/contrib/BuildMdrunOpenMM.cmake
48 index bc954d6..6d04958 100644
49 --- a/src/contrib/BuildMdrunOpenMM.cmake
50 +++ b/src/contrib/BuildMdrunOpenMM.cmake
51 @@ -39,14 +39,14 @@ link_directories(${OpenMM_LIBRARY_DIR})
52 # if the same OpenMM installation is used for running and building
53 add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" )
54 file(TO_CMAKE_PATH ${OpenMM_PLUGIN_DIR} _path)
55 -add_library(openmm_api_wrapper STATIC openmm_wrapper.cpp)
56 +add_library(openmm_api_wrapper STATIC ${CMAKE_SOURCE_DIR}/src/contrib/openmm_wrapper.cpp)
57 target_link_libraries(openmm_api_wrapper ${OpenMM_LIBRARIES})
58 list(APPEND GMX_EXTRA_LIBRARIES openmm_api_wrapper ${OpenMM_LIBRARIES})
59
60 list(REMOVE_ITEM MDRUN_SOURCES mdrun.c)
61 list(APPEND MDRUN_SOURCES
62 - ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/md_openmm.c
63 - ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/mdrun_openmm.c)
64 + ${CMAKE_SOURCE_DIR}/src/contrib/md_openmm.c
65 + ${CMAKE_SOURCE_DIR}/src/contrib/mdrun_openmm.c)
66
67 # this is to circumvent the following MSVC error:
68 # warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs
69 diff --git a/src/contrib/CMakeLists.txt b/src/contrib/CMakeLists.txt
70 index 7c5bb83..7725210 100644
71 --- a/src/contrib/CMakeLists.txt
72 +++ b/src/contrib/CMakeLists.txt
73 @@ -49,7 +49,6 @@ if(GMX_OPENMM)
74 message(FATAL_ERROR "The OpenMM build is not compatible with the native GPU build")
75 endif()
76
77 - enable_language(CXX)
78 set (GMX_BINARY_SUFFIX "-openmm")
79 set (GMX_LIBS_SUFFIX "_openmm")
80
81 @@ -99,8 +98,6 @@ if(GMX_OPENMM)
82 if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
83 set(CUDA_VERBOSE_BUILD ON)
84 endif()
85 - list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib)
86 - find_package(OpenMM)
87
88 # mark as advanced the unused variables
89 mark_as_advanced(FORCE GMX_CPU_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
90 diff --git a/src/contrib/mdrun_openmm.c b/src/contrib/mdrun_openmm.c
91 index 7771dcd..aeedeb4 100644
92 --- a/src/contrib/mdrun_openmm.c
93 +++ b/src/contrib/mdrun_openmm.c
94 @@ -153,7 +153,7 @@ int cmain(int argc,char *argv[])
95 { efXVG, "-tpi", "tpi", ffOPTWR },
96 { efXVG, "-tpid", "tpidist", ffOPTWR },
97 { efEDI, "-ei", "sam", ffOPTRD },
98 - { efEDO, "-eo", "sam", ffOPTWR },
99 + { efXVG, "-eo", "sam", ffOPTWR },
100 { efGCT, "-j", "wham", ffOPTRD },
101 { efGCT, "-jo", "bam", ffOPTWR },
102 { efXVG, "-ffout", "gct", ffOPTWR },
103 @@ -205,6 +205,8 @@ int cmain(int argc,char *argv[])
104 { NULL, "interleave", "pp_pme", "cartesian", NULL };
105 const char *dddlb_opt[] =
106 { NULL, "auto", "no", "yes", NULL };
107 + const char *thread_aff_opt[threadaffNR+1] =
108 + { NULL, "auto", "no", "yes", NULL };
109 const char *nbpu_opt[] =
110 { NULL, "auto", "cpu", "gpu", "gpu_cpu", NULL };
111 real rdd=0.0,rconstr=0.0,dlb_scale=0.8,pforce=-1;
112 @@ -236,12 +238,12 @@ int cmain(int argc,char *argv[])
113 "Number of OpenMP threads per MPI process/thread to start (0 is guess)" },
114 { "-ntomp_pme", FALSE, etINT, {&hw_opt.nthreads_omp_pme},
115 "Number of OpenMP threads per MPI process/thread to start (0 is -ntomp)" },
116 - { "-pin", FALSE, etBOOL, {&hw_opt.bThreadPinning},
117 + { "-pin", FALSE, etBOOL, {thread_aff_opt},
118 "Pin OpenMP threads to cores" },
119 - { "-pinht", FALSE, etBOOL, {&hw_opt.bPinHyperthreading},
120 - "Always pin threads to Hyper-Threading cores" },
121 { "-pinoffset", FALSE, etINT, {&hw_opt.core_pinning_offset},
122 "Core offset for pinning (for running multiple mdrun processes on a single physical node)" },
123 + { "-pinstride", FALSE, etINT, {&hw_opt.core_pinning_stride},
124 + "Pinning distance in logical cores for threads, use 0 to minimize the number of threads per physical core" },
125 { "-gpu_id", FALSE, etSTR, {&hw_opt.gpu_id},
126 "List of GPU id's to use" },
127 { "-ddcheck", FALSE, etBOOL, {&bDDBondCheck},
128 @@ -413,7 +415,7 @@ int cmain(int argc,char *argv[])
129
130 if (MULTISIM(cr) && MASTER(cr))
131 {
132 - check_multi_int(stdout,cr->ms,sim_part,"simulation part");
133 + check_multi_int(stdout,cr->ms,sim_part,"simulation part", TRUE);
134 }
135 }
136 else
137 diff --git a/src/contrib/openmm_wrapper.cpp b/src/contrib/openmm_wrapper.cpp
138 index 07f0eca..05c3210 100644
139 --- a/src/contrib/openmm_wrapper.cpp
140 +++ b/src/contrib/openmm_wrapper.cpp
141 @@ -63,6 +63,7 @@ using namespace std;
142 #include "mdrun.h"
143 #include "physics.h"
144 #include "string2.h"
145 +#include "openmm_gpu_utils.h"
146 #include "gpu_utils.h"
147 #include "mtop_util.h"
148
149 diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt
150 index 01e290c..3f95d33 100644
151 --- a/src/kernel/CMakeLists.txt
152 +++ b/src/kernel/CMakeLists.txt
153 @@ -88,7 +88,10 @@ if(GMX_OPENMM)
154 # Even though the OpenMM build has "moved to contrib", many things
155 # have be be done from within the scope of the CMakeLists.txt that
156 # builds its mdrun, and that is here
157 - include(../contrib/BuildMdrunOpenMM)
158 + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/contrib)
159 + find_package(OpenMM)
160 + include_directories(${CMAKE_CURRENT_SOURCE_DIR})
161 + include(${CMAKE_SOURCE_DIR}/src/contrib/BuildMdrunOpenMM.cmake)
162 endif(GMX_OPENMM)
163
164 if(GMX_GPU OR GMX_FORCE_CXX)
165 --
166 1.8.1.5