Merge "Fixing issues with replica exchange" into release-4-6
authorDavid van der Spoel <davidvanderspoel@gmail.com>
Sat, 13 Oct 2012 19:31:04 +0000 (21:31 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 13 Oct 2012 19:31:04 +0000 (21:31 +0200)
include/types/hw_info.h
include/types/ifunc.h
src/kernel/CMakeLists.txt
src/mdlib/clincs.c
src/mdlib/pme.c
src/tools/CMakeLists.txt

index 1d04f60f1c0f1a8d58870b24fc233eb626b799fb..179b669beea0fb51e17ba7633e31b53ddf47dc92 100644 (file)
@@ -22,9 +22,9 @@
 #ifndef HWINFO_H
 #define HWINFO_H
 
-#include "types/simple.h"
-#include "types/nbnxn_cuda_types_ext.h"
-#include "gmx_cpuid.h"
+#include "simple.h"
+#include "nbnxn_cuda_types_ext.h"
+#include "../gmx_cpuid.h"
 
 #ifdef __cplusplus
 extern "C" {
index 503e53d1765bcc02d7c976431a72cb4366575c2f..0e953dfcb441eec28463bb7907c0793f4257c49f 100644 (file)
 #ifndef _ifunc_h
 #define _ifunc_h
 
-#include "types/idef.h"
-#include "types/mdatom.h"
-#include "types/fcdata.h"
-#include "types/graph.h"
-#include "types/pbc.h"
+#include "idef.h"
+#include "mdatom.h"
+#include "fcdata.h"
+#include "graph.h"
+#include "pbc.h"
 
 #ifdef __cplusplus
 extern "C" {
index cb5d998dee7fd5c162bda5c04aaf15d2698e7cbd..2a8408f0b6cb9935d6757c31453df9520bc8e853 100644 (file)
@@ -93,22 +93,26 @@ if(GMX_OPENMM AND MSVC)
     set_target_properties(mdrun PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
 endif()
 
-# Construct component groups for installation
-foreach(PROGRAM ${GMX_KERNEL_PROGRAMS} mdrun)
+# Construct component groups for installation; note that a component may
+# belong to only one group
+foreach(PROGRAM ${GMX_KERNEL_PROGRAMS})
     set(CPACK_COMPONENT_${PROGRAM}_GROUP tools)
 endforeach()
 set(CPACK_COMPONENT_MDRUN_GROUP mdrun)
 
-# Create custom install-xxxx targets, component dependences,
-# and trigger the installation
 foreach(PROGRAM ${GMX_KERNEL_PROGRAMS} mdrun)
-    set(CPACK_COMPONENT_${PROGRAM}_DEPENDS libraries)
+    # Manage CPack component dependencies
+    set(CPACK_COMPONENT_${PROGRAM}_DEPENDS libraries libraries-gmxpreprocess)
+
+    # Create custom install-xxxx target
     if (BUILD_SHARED_LIBS)
     # If shared libraries are used, we need to install the libraries in
     # addition to the mdrun binary.
        add_custom_target(install-${PROGRAM}
            COMMAND ${CMAKE_COMMAND} -DCOMPONENT=libraries
                    -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+           COMMAND ${CMAKE_COMMAND} -DCOMPONENT=libraries-gmxpreprocess
+                   -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
            COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${PROGRAM}
                    -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
            COMMENT "Installing ${PROGRAM}")
@@ -119,6 +123,8 @@ foreach(PROGRAM ${GMX_KERNEL_PROGRAMS} mdrun)
            COMMENT "Installing ${PROGRAM}")
     endif()
     add_dependencies(install-${PROGRAM} ${PROGRAM})
+
+    # Finally, trigger installation
     install(
       TARGETS ${PROGRAM}
       COMPONENT ${PROGRAM}
@@ -126,7 +132,7 @@ foreach(PROGRAM ${GMX_KERNEL_PROGRAMS} mdrun)
       )
 endforeach()
 
-install(TARGETS gmxpreprocess DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
+install(TARGETS gmxpreprocess DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries-gmxpreprocess)
 
 endif(GMX_FAHCORE)
 
index d124eec7914c6e37642a34b3d73eb7f57c9bf030..e650ea6650ea8e40012006501ac85f0a98a40188 100644 (file)
@@ -53,6 +53,7 @@
 #include "mtop_util.h"
 #include "gmxfio.h"
 #include "gmx_omp_nthreads.h"
+#include "gmx_omp.h"
 
 typedef struct {
     int b0;           /* first constraint for this thread */
@@ -1522,18 +1523,14 @@ gmx_bool constrain_lincs(FILE *fplog,gmx_bool bLog,gmx_bool bEner,
         }
 
         /* The (only) OpenMP parallel region of constrain_lincs */
+#pragma omp parallel num_threads(lincsd->nth)
         {
-            int th;
-
-#pragma omp parallel for num_threads(lincsd->nth) schedule(static)
-            for(th=0; th<lincsd->nth; th++)
-            {
-                do_lincs(x,xprime,box,pbc,lincsd,th,
-                         md->invmass,cr,
-                         bCalcVir || (ir->efep != efepNO),
-                         ir->LincsWarnAngle,&warn,
-                         invdt,v,bCalcVir,rmdr);
-            }
+            int th=gmx_omp_get_thread_num();
+            do_lincs(x,xprime,box,pbc,lincsd,th,
+                     md->invmass,cr,
+                     bCalcVir || (ir->efep != efepNO),
+                     ir->LincsWarnAngle,&warn,
+                     invdt,v,bCalcVir,rmdr);
         }
         
         if (ir->efep != efepNO)
index a9fa5c1d07b2ae4cf7551916c5f61d997ace7a3f..5ff27d7e0ec73abcbda257ad4506557b0ed09682 100644 (file)
@@ -88,6 +88,7 @@
 #include "gmx_parallel_3dfft.h"
 #include "pdbio.h"
 #include "gmx_cyclecounter.h"
+#include "gmx_omp.h"
 
 /* Single precision, with SSE2 or higher available */
 #if defined(GMX_X86_SSE2) && !defined(GMX_DOUBLE)
@@ -4324,9 +4325,9 @@ int gmx_pme_do(gmx_pme_t pme,
         }
 
         /* Here we start a large thread parallel region */
-#pragma omp parallel for num_threads(pme->nthread) schedule(static)
-        for(thread=0; thread<pme->nthread; thread++)
+#pragma omp parallel num_threads(pme->nthread) private(thread)
         {
+            thread=gmx_omp_get_thread_num();
             if (flags & GMX_PME_SOLVE)
             {
                 int loop_count;
index 4c07ad9c5e50e3ed7fe5a11ca567227d7649c7e2..27d12639d497efb7936e82811bddc6aa8f59f7a1 100644 (file)
@@ -75,16 +75,20 @@ foreach(TOOL ${GMX_TOOLS_PROGRAMS})
         gmx_add_man_page(${TOOL})
     endif()
 
-    # Create custom install-xxxx targets, manage components and
-    # component groups, and trigger the installation
-    set(CPACK_COMPONENT_${TOOL}_DEPENDS libraries)
+    # Manage CPack component dependencies, and group membership; note that
+    # a component may belong to only one group
+    set(CPACK_COMPONENT_${TOOL}_DEPENDS libraries libraries-gmxana)
     set(CPACK_COMPONENT_${TOOL}_GROUP tools)
+
+    # Create custom install-xxxx target
     if (BUILD_SHARED_LIBS)
     # If shared libraries are used, we need to install the libraries in
     # addition to the tool binary.
        add_custom_target(install-${TOOL}
            COMMAND ${CMAKE_COMMAND} -DCOMPONENT=libraries
                    -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+           COMMAND ${CMAKE_COMMAND} -DCOMPONENT=libraries-gmxana
+                   -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
            COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${TOOL}
                    -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
            COMMENT "Installing ${TOOL}")
@@ -95,6 +99,8 @@ foreach(TOOL ${GMX_TOOLS_PROGRAMS})
            COMMENT "Installing ${TOOL}")
     endif()
     add_dependencies(install-${TOOL} ${TOOL})
+
+    # Finally, trigger installation
     install(
       TARGETS ${TOOL}
       COMPONENT ${TOOL}
@@ -102,7 +108,7 @@ foreach(TOOL ${GMX_TOOLS_PROGRAMS})
       )
 endforeach()
 
-install(TARGETS gmxana DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
+install(TARGETS gmxana DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries-gmxana)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgmxana.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libgmxana.pc @ONLY)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgmxana.pc