Fixes for Solaris
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 3 Sep 2017 13:59:12 +0000 (15:59 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 5 Sep 2017 16:29:48 +0000 (18:29 +0200)
Suggested by Maureen Chew, of Oracle.

Change-Id: I5c3f868721944e7586b7001f3ffdf6ab17953526

docs/install-guide/index.rst
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/cpuinfo.h
src/gromacs/tables/forcetable.cpp
src/gromacs/utility/sysinfo.cpp

index 4bb8bb329fa0719d63f688344dc4d69dc2db02e7..2f8afec88bb6a9c86dacf7d035f7cda04a9c3a47 100644 (file)
@@ -1027,6 +1027,19 @@ you may need to specify the use of static binaries with
 ``-DGMX_BUILD_SHARED_EXE=off``, and you may need to set the F77
 environmental variable to ``ftn`` when compiling FFTW.
 
+Building on Solaris
+-------------------
+
+The built-in |Gromacs| processor detection does not work on Solaris,
+so it is strongly recommended that you build |Gromacs| with
+``-DGMX_HWLOC=on`` and ensure that the ``CMAKE_PREFIX_PATH`` includes
+the path where the hwloc headers and libraries can be found. At least
+version 1.11.8 of hwloc is recommended.
+
+Oracle Developer Studio is not a currently supported compiler (and
+does not currently compile |Gromacs| correctly, perhaps because the
+thread-MPI atomics are incorrectly implemented in |Gromacs|).
+
 Building on BlueGene
 --------------------
 
index b2ec55a6683932120b11300b321a29665817ed16..df8d70086f945ca8b10f640af6d69e6f1358c9f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, 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.
@@ -669,7 +669,8 @@ detectProcCpuInfoVendor(const std::map<std::string, std::string> &cpuInfo)
         { "AArch64",      CpuInfo::Vendor::Arm     },
         { "Fujitsu",      CpuInfo::Vendor::Fujitsu },
         { "IBM",          CpuInfo::Vendor::Ibm     },
-        { "POWER",        CpuInfo::Vendor::Ibm     }
+        { "POWER",        CpuInfo::Vendor::Ibm     },
+        { "Oracle",       CpuInfo::Vendor::Oracle  },
     };
 
     // For each label in /proc/cpuinfo, compare the value to the name in the
@@ -892,6 +893,10 @@ CpuInfo CpuInfo::detect()
     result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
 #    endif
 
+#    if defined sun
+    result.vendor_ = CpuInfo::Vendor::Oracle;
+#    endif
+
     // On Linux we might be able to find information in /proc/cpuinfo. If vendor or brand
     // is set to a known value this routine will not overwrite it.
     detectProcCpuInfo(&result.vendor_, &result.brandString_, &result.family_,
@@ -936,7 +941,8 @@ CpuInfo::s_vendorStrings_ =
     { CpuInfo::Vendor::Amd, "AMD"                                 },
     { CpuInfo::Vendor::Fujitsu, "Fujitsu"                         },
     { CpuInfo::Vendor::Ibm, "IBM"                                 },
-    { CpuInfo::Vendor::Arm, "ARM"                                 }
+    { CpuInfo::Vendor::Arm, "ARM"                                 },
+    { CpuInfo::Vendor::Oracle, "Oracle"                           },
 };
 
 
index 7ea85c1845d3cf80cbf89f6ca2f78a007862985f..bd2be6bc24d786b2de89cb1687cbc575cf9ce65b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, 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.
@@ -86,6 +86,7 @@ class CpuInfo
             Fujitsu,      //!< Only works on Linux (parsed from /proc/cpuinfo)
             Ibm,          //!< Only works on Linux (parsed from /proc/cpuinfo)
             Arm,          //!< Only works on Linux (parsed from /proc/cpuinfo)
+            Oracle,       //!< Cannot detect anything else yet (no /proc/cpuinfo available)
         };
 
         /*! \brief List of CPU features
index 2b52c178a32c6f43df8d33d4a246ef9fd0900c7e..04eae447f76929965d45e3896b08f082487577f1 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,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
@@ -317,7 +317,7 @@ static double spline3_table_scale(double third_deriv_max,
 
     /* Don't try to be more accurate on energy than the precision */
     func_tol  = std::max(func_tol, static_cast<double>(GMX_REAL_EPS));
-    sc_func   = std::cbrt(third_deriv_max/(6*12*sqrt(3)*func_tol))*x_scale;
+    sc_func   = std::cbrt(third_deriv_max/(6*12*std::sqrt(3.0)*func_tol))*x_scale;
 
     return std::max(sc_deriv, sc_func);
 }
index 374b3c04a47495afd43357179808cbbb8a216c2b..8bcf8b5de0e215b083a7ef6a239770963d5583eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, 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.
@@ -144,7 +144,7 @@ gmx_ctime_r(const time_t *clock, char *buf, size_t len)
     buf[len-1] = '\0';
 #elif (defined(__sun))
     /*Solaris*/
-    ctime_r(clock, buf, len);
+    ctime_r(clock, buf);
 #else
     char tmpbuf[30];
     ctime_r(clock, tmpbuf);