Merge release-4-5-patches into release-4-6
authorRoland Schulz <roland@utk.edu>
Thu, 19 Jan 2012 06:11:18 +0000 (01:11 -0500)
committerRoland Schulz <roland@utk.edu>
Thu, 19 Jan 2012 06:22:33 +0000 (01:22 -0500)
Conflicts:
admin/GerritBuild
admin/GerritBuild.bat

Change-Id: I812540cbc8c076aae9f21c52eb035b920430e033

12 files changed:
CMakeLists.txt
admin/GerritBuild [deleted file]
admin/GerritBuild.bat [changed mode: 0644->0755]
cmake/Toolchain-BlueGeneP.cmake [new file with mode: 0644]
cmake/gmxTestIsfinite.cmake [new file with mode: 0644]
include/maths.h
src/config.h.cmakein
src/gmxlib/maths.c
src/kernel/grompp.c
src/mdlib/clincs.c
src/tools/geminate.c
src/tools/gmx_cluster.c

index ff80a485dd13d2ce2b1f84391f9460f93e9110a8..8c23fd975407f86190b4dee582050089b68f0855 100644 (file)
@@ -280,8 +280,6 @@ check_function_exists(_aligned_malloc   HAVE__ALIGNED_MALLOC)
 check_function_exists(gettimeofday      HAVE_GETTIMEOFDAY)
 check_function_exists(isnan             HAVE_ISNAN)
 check_function_exists(_isnan            HAVE__ISNAN)
-check_function_exists(isfinite          HAVE_ISFINITE)
-check_function_exists(_isfinite         HAVE__ISFINITE)
 check_function_exists(fsync             HAVE_FSYNC)
 check_function_exists(_fileno           HAVE__FILENO)
 check_function_exists(fileno            HAVE_FILENO)
@@ -481,6 +479,11 @@ gmx_test_inline(RESTRICT_KEYWORD)
 include(gmxTestPipes)
 gmx_test_pipes(HAVE_PIPES)
 
+include(gmxTestIsfinite)
+gmx_test_isfinite(HAVE_ISFINITE)
+gmx_test__isfinite(HAVE__ISFINITE)
+gmx_test__finite(HAVE__FINITE)
+
 include(gmxTestInlineASM)
 gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
 gmx_test_inline_asm_msvc_x86(GMX_X86_MSVC_INLINE_ASM)
diff --git a/admin/GerritBuild b/admin/GerritBuild
deleted file mode 100755 (executable)
index 88a4ec0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -x
-if [ -n "${CMakeVersion}" ] ; then
-   export PATH=$HOME/tools/cmake-${CMakeVersion}/bin:$PATH
-fi
-export CMAKE_LIBRARY_PATH=/usr/lib/atlas-base
-if [ $GMX_MPI = on ]; then
-    export OMPI_CC=gcc-${CompilerVersion}
-    export OMPI_CXX=g++-${CompilerVersion}
-    export OMPI_FC=gfortran-${CompilerVersion}
-    export CC=mpicc
-    export CXX=mpic++
-    export FC=mpif90
-else
-    export CC=gcc-${CompilerVersion}
-    export CXX=g++-${CompilerVersion}
-    export FC=gfortran-${CompilerVersion}
-fi
-cmake -D GMX_DOUBLE=${GMX_DOUBLE} -D GMX_MPI=${GMX_MPI} -D GMX_OPENMP=${GMX_OPENMP} \
-    -DGMX_EXTERNAL_BLAS=${GMX_EXTERNAL} -DGMX_EXTERNAL_LAPACK=${GMX_EXTERNAL} \
-    -DGMX_DEFAULT_SUFFIX=off -DCMAKE_BUILD_TYPE=Debug . &&
-make &&
-ctest -D ExperimentalTest -V
old mode 100644 (file)
new mode 100755 (executable)
index a343203..1200e0a
@@ -1,6 +1,3 @@
-REM Requires Windows SDK and CMake to be in the path
-REM Run Windows SDK SetEnv script
-SetEnv /Release && ^
-cmake -G "Visual Studio 10 Win64" -D GMX_DOUBLE=%GMX_DOUBLE% -D GMX_MPI=%GMX_MPI% -D GMX_OPENMP=%GMX_OPENMP% -DGMX_DEFAULT_SUFFIX=off . && ^
-msbuild /m:2 /p:Configuration=MinSizeRel All_Build.vcxproj && ^
-ctest -D ExperimentalTest -C MinSizeRel -V
+mkdir releng
+cd releng
+git init && git fetch ssh://jenkins@gerrit.gromacs.org:29418/releng refs/heads/4.6.0 && git checkout -q -f FETCH_HEAD && cd .. && python -u releng/GerritBuild.py
diff --git a/cmake/Toolchain-BlueGeneP.cmake b/cmake/Toolchain-BlueGeneP.cmake
new file mode 100644 (file)
index 0000000..73b6b34
--- /dev/null
@@ -0,0 +1,8 @@
+# the name of the target operating system
+set(CMAKE_SYSTEM_NAME BlueGeneP-static CACHE STRING "Cross-compiling for BlueGene/P")
+
+# set the compiler
+set(CMAKE_C_COMPILER mpixlc_r)
+set(CMAKE_CXX_COMPILER mpixlcxx_r)
+
+set(GMX_ACCELERATION "BlueGene" CACHE STRING "Forcing BlueGene acceleration when using BlueGene toolchain")
diff --git a/cmake/gmxTestIsfinite.cmake b/cmake/gmxTestIsfinite.cmake
new file mode 100644 (file)
index 0000000..95c07fe
--- /dev/null
@@ -0,0 +1,77 @@
+# - Define macro to check if isfinite or _isfinite exists
+#
+#  gmx_test_isfinite(VARIABLE)
+#
+#  VARIABLE will be set to true if isfinite exists
+#
+#  gmx_test__isfinite(VARIABLE)
+#
+#  VARIABLE will be set to true if _isfinite exists
+#
+#  gmx_test__finite(VARIABLE) - disabled since it doesn't seem to work the way the MSVC docs suggest
+#
+#  VARIABLE will be set to true if _finite exists
+#
+
+MACRO(gmx_test_isfinite VARIABLE)
+    MESSAGE(STATUS "Checking for isfinite")
+
+    set(CMAKE_REQUIRED_INCLUDES "math.h")
+    set(CMAKE_REQUIRED_LIBRARIES "m")
+    check_c_source_compiles(
+      "#include <math.h>
+int main(void) {
+  float f;
+  isfinite(f);
+}" isfinite_compile_ok)
+
+    if(isfinite_compile_ok)
+        MESSAGE(STATUS "Checking for isfinite - yes")
+            set(${VARIABLE} ${isfinite_compile_ok}
+                "Result of test for isfinite")
+    else(isfinite_compile_ok)
+        MESSAGE(STATUS "Checking for isfinite - no")
+    endif(isfinite_compile_ok)
+ENDMACRO(gmx_test_isfinite VARIABLE)
+
+MACRO(gmx_test__isfinite VARIABLE)
+    MESSAGE(STATUS "Checking for _isfinite")
+
+    set(CMAKE_REQUIRED_INCLUDES "math.h")
+    set(CMAKE_REQUIRED_LIBRARIES "m")
+    check_c_source_compiles(
+      "#include <math.h>
+int main(void) {
+  float f;
+  _isfinite(f);
+}" _isfinite_compile_ok)
+
+    if(_isfinite_compile_ok)
+        MESSAGE(STATUS "Checking for _isfinite - yes")
+            set(${VARIABLE} ${_isfinite_compile_ok}
+                "Result of test for _isfinite")
+    else(_isfinite_compile_ok)
+        MESSAGE(STATUS "Checking for _isfinite - no")
+    endif(_isfinite_compile_ok)
+ENDMACRO(gmx_test__isfinite VARIABLE)
+
+# Necessary for MSVC
+MACRO(gmx_test__finite VARIABLE)
+    MESSAGE(STATUS "Checking for _finite")
+
+    set(CMAKE_REQUIRED_INCLUDES "float.h")
+    check_c_source_compiles(
+      "#include <float.h>
+int main(void) {
+  float f;
+  _finite(f);
+}" _finite_compile_ok)
+
+    if(_finite_compile_ok)
+        MESSAGE(STATUS "Checking for _finite - yes")
+            set(${VARIABLE} ${_finite_compile_ok}
+                "Result of test for _finite")
+    else(_finite_compile_ok)
+        MESSAGE(STATUS "Checking for _finite - no")
+    endif(_finite_compile_ok)
+ENDMACRO(gmx_test__finite VARIABLE)
index f4a998e042d09bc93244b7aad043018dc5e06c30..21755c2115c37696ac084e9c9adbbb706cf9e100 100644 (file)
@@ -105,6 +105,8 @@ real    cuberoot (real a);
 real    gmx_erf(real x);
 real    gmx_erfc(real x);
 
+gmx_bool gmx_isfinite(real x);
+
 /*! \brief Check if two numbers are within a tolerance
  *
  *  This routine checks if the relative difference between two numbers is
index 2cb5b1af69ca2c5e88affd37c5e8690c52641c69..84436417ad91d3cd30e439d2f9d1f0938c696bd1 100644 (file)
 /* Define to 1 if you have the _isfinite() function. */
 #cmakedefine HAVE__ISFINITE
 
+/* Define to 1 if you have the _finite() function. */
+#cmakedefine HAVE__FINITE
+
 /* Define to 1 if you have the fsync() function. */
 #cmakedefine HAVE_FSYNC
 
index 9ffa832b35b55f1440b737a1aa94181ef4b7458d..cfa55f6953fdb281e809482ec348d5d207c64025 100644 (file)
@@ -40,6 +40,9 @@
 #include <math.h>
 #include <limits.h>
 #include "maths.h"
+#ifdef HAVE__FINITE
+#include "float.h"
+#endif
 
 int gmx_nint(real a)
 {   
@@ -659,3 +662,19 @@ float fast_float_erfc(float x)
                t*(-0.82215223+t*0.17087277)))))))));
        return ans;
 }
+
+gmx_bool gmx_isfinite(real x)
+{
+    gmx_bool returnval = TRUE;
+    /* If no suitable function was found, assume the value is
+     * finite. */
+
+#ifdef HAVE_ISFINITE
+    returnval = isfinite(x);
+#elif defined HAVE__ISFINITE
+    returnval = _isfinite(x);
+#elif defined HAVE__FINITE
+    returnval = _finite(x);
+#endif
+    return returnval;
+}
index bf9cc3c3e7bf79f4787ad2bb5c6c52c19bc4de1b..779f594c27929280fe2c86fb63ed5029c55b9e2e 100644 (file)
@@ -1125,6 +1125,22 @@ static void check_gbsa_params(t_inputrec *ir,gpp_atomtype_t atype)
   
 }
 
+static void check_settle(gmx_mtop_t   *sys)
+{
+    int i,j,cgj1,nra;
+    
+    nra = interaction_function[F_SETTLE].nratoms;
+    for(i=0; (i<sys->nmoltype); i++) 
+    {
+        for(j=0; (j<sys->moltype[i].ilist[F_SETTLE].nr); j+=nra+1)
+        {
+            cgj1 = sys->moltype[i].cgs.index[j+1];
+            if (j+2 >= cgj1)
+                gmx_fatal(FARGS,"For SETTLE you need to have all atoms involved in one charge group. Please fix your topology.");
+        }
+    }
+}
+
 int main (int argc, char *argv[])
 {
   static const char *desc[] = {
@@ -1477,6 +1493,9 @@ int main (int argc, char *argv[])
     check_vel(sys,state.v);
   }
     
+  /* check for charge groups in settles */
+  check_settle(sys);
+  
   /* check masses */
   check_mol(sys,wi);
   
index 9fc87071449f4b7109c3f8371c28608b6b2e574e..89531f60a4fd7505e989fdc54bab5869a275f2c5 100644 (file)
@@ -1036,15 +1036,10 @@ static void lincs_warning(FILE *fplog,
             {
                 fprintf(fplog,"%s",buf);
             }
-            #ifdef HAS_ISFINITE
-            if (!isfinite(d1)) 
-                gmx_fatal(FARGS,"Bond length not finite.")
-            #else
-            #ifdef HAS__ISFINITE
-            if (!_isfinite(d1))        
-                gmx_fatal(FARGS,"Bond length not finite.")
-            #endif
-            #endif
+            if (!gmx_isfinite(d1))
+            {
+                gmx_fatal(FARGS,"Bond length not finite.");
+            }
 
             (*warncount)++;
         }
index 0d160cdb47be93b72ded4dfb278fedb8cef44a0b..20f2430335dda83ecf90b430f9de95b5043e73ff 100644 (file)
@@ -887,13 +887,7 @@ extern real fitGemRecomb(double *ct, double *time, double **ctFit,
        for(i=0; i<GD->nData; i++)
          {
            dumpdata[i] = (real)(GD->ctTheory[i]);
-#ifdef HAS_ISFINITE
-           if (!isfinite(dumpdata[i]))
-#elif defined HAS__ISFINITE
-           if (!_isfinite(dumpdata[i]))
-#else
-            if (0)
-#endif
+           if (!gmx_isfinite(dumpdata[i]))
              {
                gmx_fatal(FARGS, "Non-finite value in acf.");
              }
index c29e3bda2e9f84d0a3ab40765bb5b0d8b57ae570..997fecdf6a9055cc9dd2653604163120d1fed02f 100644 (file)
@@ -1054,7 +1054,9 @@ int gmx_cluster(int argc,char *argv[])
     "[TT]-cl[tt] writes average (with option [TT]-av[tt]) or central",
     "structure of each cluster or writes numbered files with cluster members",
     "for a selected set of clusters (with option [TT]-wcl[tt], depends on",
-    "[TT]-nst[tt] and [TT]-rmsmin[tt]).[BR]",
+    "[TT]-nst[tt] and [TT]-rmsmin[tt]). The center of a cluster is the",
+    "structure with the smallest average RMSD from all other structures",
+    "of the cluster.[BR]",
   };
   
   FILE         *fp,*log;