Merge release-5-0 into release-5-1
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 5 Oct 2015 19:36:02 +0000 (21:36 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 5 Oct 2015 20:20:44 +0000 (22:20 +0200)
Conflicts:
cmake/gmxManageFFTLibraries.cmake
Fixes from release-5-0 goes in only one branch of the refactoring in
release-5-1 that separate the own-fftw build from an installed-fftw
build.

docs/manual/monster.bib
Insertions in both branches, both retained

src/gromacs/gmxana/gmx_wham.cpp
Fixed formatting of copyrighted years.

src/programs/mdrun/mdrun.cpp
Relocation of please_cite() calls was adjacent to removal of bSepPot,
trivial resolution

Change-Id: I9d6116534775906d74ddbd45925176a21b5afcd9

cmake/FindFFTW.cmake
cmake/gmxManageFFTLibraries.cmake
docs/manual/gromacs.tex
docs/manual/monster.bib
src/gromacs/gmxana/dlist.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/swap/swapcoords.cpp
src/programs/mdrun/runner.cpp

index bea6f0b0f772e920fd0941b0c54076df655b9912..c6058a7561ed227640e4962717fc7e14bc74a4ec 100644 (file)
@@ -39,7 +39,8 @@
 #  ${FFTW}_LIBRARIES    - List of libraries when using FFTW.
 #  ${FFTW}_PKG          - The name of the pkg-config package needed
 #  ${FFTW}_HAVE_SIMD    - True if FFTW was built with SIMD support
-#  ${FFTW}_HAVE_AVX     - True if FFTW was built with AVX support
+#  ${FFTW}_HAVE_SSE     - True if FFTW was built with SSE support
+#  ${FFTW}_HAVE_SSE2    - True if FFTW was built with SSE2 support
 #  ${FFTW}_FOUND        - True if FFTW was found
 #  where ${FFTW} is FFTW or FFTWF
 
@@ -101,64 +102,55 @@ if (${FFTW}_FOUND)
   endif()
 
   # Check for FFTW3 compiled with --enable-sse
-  foreach(SSE_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse)
+  foreach(SSE_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse ${${FFTW}_FUNCTION_PREFIX}_have_sse)
     if (FFTW_LIBRARY_CHANGED)
       unset(${FFTW}_HAVE_${SSE_FUNCTION} CACHE)
     endif()
     check_library_exists("${${FFTW}_LIBRARIES}" "${SSE_FUNCTION}" "" ${FFTW}_HAVE_${SSE_FUNCTION})
     if(${FFTW}_HAVE_${SSE_FUNCTION})
       set(${FFTW}_HAVE_SSE TRUE)
+      set(${FFTW}_HAVE_SIMD TRUE)
       break()
     endif()
   endforeach()
 
   # Check for FFTW3 compiled with --enable-sse2
-  foreach(SSE2_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse2)
+  foreach(SSE2_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse2 ${${FFTW}_FUNCTION_PREFIX}_have_sse2)
     if (FFTW_LIBRARY_CHANGED)
       unset(${FFTW}_HAVE_${SSE2_FUNCTION} CACHE)
     endif()
     check_library_exists("${${FFTW}_LIBRARIES}" "${SSE2_FUNCTION}" "" ${FFTW}_HAVE_${SSE2_FUNCTION})
     if(${FFTW}_HAVE_${SSE2_FUNCTION})
       set(${FFTW}_HAVE_SSE2 TRUE)
+      set(${FFTW}_HAVE_SIMD TRUE)
       break()
     endif()
   endforeach()
 
-  # Check for FFTW3 with 128-bit AVX compiled with --enable-avx
-  foreach(AVX_128_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx_128)
-    if (FFTW_LIBRARY_CHANGED)
-      unset(${FFTW}_HAVE_${AVX_128_FUNCTION} CACHE)
-    endif()
-    check_library_exists("${${FFTW}_LIBRARIES}" "${AVX_128_FUNCTION}" "" ${FFTW}_HAVE_${AVX_128_FUNCTION})
-    if(${FFTW}_HAVE_${AVX_128_FUNCTION})
-      set(${FFTW}_HAVE_AVX_128 TRUE)
-      break()
-    endif()
-  endforeach()
-
-  # Check for FFTW3 with 128-bit AVX2 compiled with --enable-avx2
-  foreach(AVX2_128_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx2_128)
-    if (FFTW_LIBRARY_CHANGED)
-      unset(${FFTW}_HAVE_${AVX2_128_FUNCTION} CACHE)
-    endif()
-    check_library_exists("${${FFTW}_LIBRARIES}" "${AVX2_128_FUNCTION}" "" ${FFTW}_HAVE_${AVX2_128_FUNCTION})
-    if(${FFTW}_HAVE_${AVX2_128_FUNCTION})
-      set(${FFTW}_HAVE_AVX2_128 TRUE)
-      break()
-    endif()
-  endforeach()
+  # Check for any other SIMD support in FFTW
+  if (NOT ${FFTW}_HAVE_SIMD)
+      foreach(SIMD_FCT
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx2
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx2_128
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx512
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx_128_fma
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_altivec
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_neon
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_vsx
+              ${${FFTW}_FUNCTION_PREFIX}_have_simd_altivec
+              ${${FFTW}_FUNCTION_PREFIX}_have_altivec) # Name used before FFTW 3.3
+          if (FFTW_LIBRARY_CHANGED)
+              unset(${FFTW}_HAVE_${SIMD_FCT} CACHE)
+          endif()
+          check_library_exists("${${FFTW}_LIBRARIES}" "${SIMD_FCT}" "" ${FFTW}_HAVE_${SIMD_FCT})
+          if(${FFTW}_HAVE_${SIMD_FCT})
+              set(${FFTW}_HAVE_SIMD TRUE)
+              break()
+          endif()
+      endforeach()
+  endif()
 
-  #in 3.3 sse function name has changed
-  foreach(SIMD_FCT ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse2;${${FFTW}_FUNCTION_PREFIX}_have_simd_avx;${${FFTW}_FUNCTION_PREFIX}_have_simd_altivec;${${FFTW}_FUNCTION_PREFIX}_have_simd_neon;${${FFTW}_FUNCTION_PREFIX}_have_sse2;${${FFTW}_FUNCTION_PREFIX}_have_sse;${${FFTW}_FUNCTION_PREFIX}_have_altivec)
-    if (FFTW_LIBRARY_CHANGED)
-      unset(${FFTW}_HAVE_${SIMD_FCT} CACHE)
-    endif()
-    check_library_exists("${${FFTW}_LIBRARIES}" "${SIMD_FCT}" "" ${FFTW}_HAVE_${SIMD_FCT})
-    if(${FFTW}_HAVE_${SIMD_FCT})
-      set(${FFTW}_HAVE_SIMD TRUE)
-      break()
-    endif()
-  endforeach()
   #Verify FFTW is compiled with fPIC (necessary for shared libraries)
   if (CMAKE_OBJDUMP AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND BUILD_SHARED_LIBS AND NOT CYGWIN)
       execute_process(COMMAND ${CMAKE_OBJDUMP} --reloc ${${FFTW}_LIBRARY} OUTPUT_VARIABLE ${FFTW}_OBJDUMP)
index fdd63bca94f258d402a7c3899f3b4c705d9981e3..90fdcd37bcf94a315a7a3d32245a5ff3481043c6 100644 (file)
@@ -87,12 +87,16 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
         if ((${GMX_SIMD} MATCHES "SSE" OR ${GMX_SIMD} MATCHES "AVX") AND NOT ${FFTW}_HAVE_SIMD)
             message(WARNING "The fftw library found is compiled without SIMD support, which makes it slow. Consider recompiling it or contact your admin")
         else()
-            if(${GMX_SIMD} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2 OR ${FFTW}_HAVE_AVX_128 OR ${FFTW}_HAVE_AVX2_128))
-                # If we end up here we have an AVX Gromacs build, and FFTW with SIMD, but no 128-bit SIMD, this means AVX is enabled for FFTW.
-                message(WARNING "The FFTW library was compiled with neither --enable-sse nor --enable-sse2; those would have enabled SSE(2) SIMD instructions. This will give suboptimal performance. You should (re)compile the FFTW library with both SSE2 and AVX instruction support (use both --enable-sse2 and --enable-avx). The FFTW library will determine at runtime which SIMD instruction set is fastest for different parts of the FFTs.")
+            if(${GMX_SIMD} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2))
+                # If we end up here we have an AVX Gromacs build, and FFTW
+                # with SIMD. FFTW 3.3.5 will have the behaviour that
+                # configuring with AVX support also adds SSE support, which is
+                # what we want. There is no good way to detect the FFTW
+                # version, however.
+                message(WARNING "The FFTW library was compiled with neither --enable-sse nor --enable-sse2; those would have enabled SSE(2) SIMD instructions. This will give suboptimal performance. You should (re)compile the FFTW library with both SSE2 and AVX instruction support (use both --enable-sse2 and --enable-avx). More recent versions of FFTW compile support for such narrower SIMD by default.")
             endif()
+            set(FFT_STATUS_MESSAGE "Using external FFT library - FFTW3")
         endif()
-        set(FFT_STATUS_MESSAGE "Using external FFT library - FFTW3")
     endif()
 
     set(FFT_LIBRARIES ${${FFTW}_LIBRARIES})
index bbb018c2702e9acfbe5054bdf1c4bed0bb643247..ff66f70f0939e8d0392dba13448b4608529f5303 100644 (file)
@@ -201,7 +201,7 @@ M.J. Abraham, D. van der Spoel, E. Lindahl, B. Hess, and the GROMACS development
 \hspace{0.3em} {\wwwpage} ({\gmxyear})
 \end{quote}
 However, we prefer that you cite (some of) the {\gromacs}
-papers~\cite{Bekker93a,Berendsen95a,Lindahl2001a,Spoel2005a,Hess2008b,Pronk2013}
+papers~\cite{Bekker93a,Berendsen95a,Lindahl2001a,Spoel2005a,Hess2008b,Pronk2013,Pall2015,Abraham2015}
 when you publish your results. Any future development depends on academic research
 grants, since the package is distributed as free software!
 
index a7ba8b5b9d613a2afa11ec1211c008e5db42666b..970cf315bea6127ac8f269b120a628202e4a4cdd 100644 (file)
@@ -8692,6 +8692,30 @@ keywords = {CHARMM, force field, molecular dynamics, parametrization, DNA, RNA},
 year = {2000},
 }
 
+@incollection {Pall2015,
+author = {P{\'a}ll, Szil{\'a}rd and Abraham, Mark James and Kutzner, Carsten and Hess, Berk and Lindahl, Erik},
+title = { Tackling Exascale Software Challenges in Molecular Dynamics Simulati\
+ons with {GROMACS} },
+booktitle = {Solving Software Challenges for Exascale },
+editor = { Markidis, Stephano and Laure, Erwin },
+pages = { 3--27 },
+year = { 2015 },
+volume = { 8759 },
+publisher = { Springer International Publishing Switzerland },
+address = { London }
+}
+
+@article {Abraham2015,
+author = { Abraham, Mark James and Murtola, Teemu and Schulz, Roland and P{\'a}ll, Szil{\'a}rd and Smith, Jeremy C. and Hess, Berk and Lindahl, Erik },
+title = { {GROMACS}: High performance molecular simulations through multi-level parallelism from laptops to supercomputers },
+journal = { {SoftwareX} },
+volume = { 1--2 },
+publisher = { John Wiley & Sons, Inc. },
+pages = { 19--25 },
+year = { 2015 },
+doi = "http://dx.doi.org/10.1016/j.softx.2015.06.001"
+}
+
 @Misc{lmfit,
   author =    {Joachim Wuttke},
   title =     {lmfit},
index b7578cef623f03e97c71f8f2dd82ae9b537ae70a..0a844a82603a4472ed8548688479980780ae9b5d 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,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
@@ -222,6 +222,16 @@ t_dlist *mk_dlist(FILE *log,
             }
             dl[nl].index = gmx_residuetype_get_index(rt, thisres);
 
+            /* Prevent seg fault from unknown residues. If one adds a custom residue to
+             * residuetypes.dat but somehow loses it, changes it, or does analysis on
+             * another machine, the residue type will be unknown. */
+            if (dl[nl].index == -1)
+            {
+                gmx_fatal(FARGS, "Unknown residue %s when searching for residue type.\n"
+                          "Maybe you need to add a custom residue in residuetypes.dat.",
+                          thisres, __FILE__, __LINE__);
+            }
+
             sprintf(dl[nl].name, "%s%d", thisres, ires+r0);
             nl++;
         }
index d2595be547c6a100667c660b0c29255d488ef3be..fe6f1a00151bfaee30e4e6e858ee6af4ba92d886 100644 (file)
@@ -2821,7 +2821,7 @@ int gmx_energy(int argc, char *argv[])
     {
         double dt = (frame[cur].t-start_t)/(edat.nframes-1);
         analyse_ener(opt2bSet("-corr", NFILE, fnm), opt2fn("-corr", NFILE, fnm),
-                     bFee, bSum, opt2parg_bSet("-nmol", npargs, ppa),
+                     bFee, bSum, bFluct,
                      bVisco, opt2fn("-vis", NFILE, fnm),
                      nmol,
                      start_step, start_t, frame[cur].step, frame[cur].t,
index bd8077af8a836d97a65ef112c9898273e8ce05a1..1d08bd543fbc44a814c213f860eb4cb511db085f 100644 (file)
@@ -643,7 +643,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
 
         sscanf(ptr, fmtlf, &time); /* printf("Time %f\n",time); */
         /* Round time to fs */
-        time = 1.0/1000*( static_cast<int> (time*1000+0.5) );
+        time = 1.0/1000*( static_cast<gmx_int64_t> (time*1000+0.5) );
 
         /* get time step of pdo file */
         if (count == 0)
@@ -2363,7 +2363,7 @@ void read_pull_xf(const char *fn, const char *fntpr, t_UmbrellaHeader * header,
     for (i = 0; i < nt; i++)
     {
         /* Do you want that time frame? */
-        t = 1.0/1000*( static_cast<int> ((y[0][i]*1000) + 0.5)); /* round time to fs */
+        t = 1.0/1000*( static_cast<gmx_int64_t> ((y[0][i]*1000) + 0.5)); /* round time to fs */
 
         /* get time step of pdo file and get dstep from opt->dt */
         if (i == 0)
index 668433235b85902d328baf8fa4fa156c24f7c605..80d10a224ed61047ecca163c9af8d86f97bde6ea 100644 (file)
@@ -610,7 +610,12 @@ void please_cite(FILE *fp, const char *key)
           "S. Páll, M. J. Abraham, C. Kutzner, B. Hess, E. Lindahl",
           "Tackling Exascale Software Challenges in Molecular Dynamics Simulations with GROMACS",
           "In S. Markidis & E. Laure (Eds.), Solving Software Challenges for Exascale",
-          8759, 2015, "3-27" }
+          8759, 2015, "3-27" },
+        { "Abraham2015",
+          "M. J. Abraham, T. Murtola, R. Schulz, S. Páll, J. C. Smith, B. Hess, E. Lindahl",
+          "GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers",
+          "SoftwareX",
+          1, 2015, "19-25" },
     };
 #define NSTR (int)asize(citedb)
 
index 6d1d944600274446a79f1b2130c3a924d94811a1..4c2a55a0239d5dbe9a60d40689570b7801a08c9a 100644 (file)
@@ -1357,6 +1357,7 @@ extern void init_swapcoords(
     t_group               *g;
     gmx_bool               bAppend, bStartFromCpt, bRerun;
     gmx_mtop_atomlookup_t  alook = NULL;
+    matrix                 boxCopy;
 
 
     alook = gmx_mtop_atomlookup_init(mtop);
@@ -1496,9 +1497,17 @@ extern void init_swapcoords(
         g->qc[i] = atom->q;
     }
 
+    /* Make a t_pbc struct on all nodes so that the molecules
+     * chosen for an exchange can be made whole. */
     snew(s->pbc, 1);
-    set_pbc(s->pbc, -1, box);
-
+    /* Every node needs to call set_pbc() and therefore every node needs
+     * to know the box dimensions */
+    copy_mat(box, boxCopy);
+    if (PAR(cr))
+    {
+        gmx_bcast(sizeof(boxCopy), boxCopy, cr);
+    }
+    set_pbc(s->pbc, -1, boxCopy);
 
     if (MASTER(cr))
     {
index cd696963004a82943f1b1863832aa2882847d73d..796333ebe211bbea2632945f76d86eb2d31095b3 100644 (file)
@@ -656,6 +656,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     if (fplog != NULL)
     {
         /* Print references after all software/hardware printing */
+        please_cite(fplog, "Abraham2015");
         please_cite(fplog, "Pall2015");
         please_cite(fplog, "Pronk2013");
         please_cite(fplog, "Hess2008b");