Update for FFTW 3.3.5
authorMark Abraham <mark.j.abraham@gmail.com>
Sat, 8 Oct 2016 23:35:10 +0000 (01:35 +0200)
committerErik Lindahl <erik.lindahl@gmail.com>
Tue, 11 Oct 2016 12:50:36 +0000 (14:50 +0200)
The auto-download now gets FFTW 3.3.5 and builds it properly,
including with --enable-vsx when GMX_SIMD is set to VSX, i.e. for
Power8, and --enable-avx512 when GMX_SIMD is any of the AVX flavours
(which is safe on non-512 now, works on KNL, and is presumed useful
for future AVX512 architectures).

Note that 3.3.5 does not automatically add avx and sse support if
configured with --enable-avx2, so changed the documentation
accordingly.

Change-Id: I2a48ec1cb4f812dcae18870e0afcaf1120da251b

cmake/gmxManageFFTLibraries.cmake
docs/install-guide/index.rst
src/contrib/fftw/CMakeLists.txt

index db3e5d4f0915b734627535b9e2de5699f2ec426c..800b2f633ca71fe5dec3230db5fee93413598e8f 100644 (file)
@@ -93,12 +93,9 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
             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))
-                # 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.")
+                # If we end up here we have an AVX Gromacs build, and
+                # FFTW with SIMD.
+                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 --enable-sse2 and --enable-avx (and --enable-avx2 or --enable-avx512 if supported).")
             endif()
         endif()
         set(FFT_STATUS_MESSAGE "Using external FFT library - FFTW3")
index 7737fec08435d24b57df6ac9e22c7e09d0f0ed16..10466c382c8fab59437bd8a70f925cfd41965818 100644 (file)
@@ -251,23 +251,20 @@ recommends either
 * that you build FFTW from the source code.
 
 If you build FFTW from source yourself, get the most recent version
-and follow the `FFTW installation guide`_. Note that we have recently
-contributed new SIMD optimization for several extra platforms to
-FFTW, which will appear in FFTW-3.3.5 (for now it is available in the
-FFTW repository on github, or you can find a very unofficial prerelease
-version at ftp://ftp.gromacs.org/pub/contrib ).
-Choose the precision for FFTW (i.e. single/float vs. double) to
-match whether you will later use mixed or double precision for
-|Gromacs|. There is no need to compile FFTW with
-threading or MPI support, but it does no harm. On x86 hardware,
-compile with *both* ``--enable-sse2`` and ``--enable-avx`` for
-FFTW-3.3.4 and earlier. As of FFTW-3.3.5 you should also add
-``--enable-avx2``. FFTW will create a fat library with codelets
-for all different instruction sets, and pick the fastest supported
-one at runtime. On IBM Power8, you definitely want the upcoming
-FFTW-3.3.5 and to compile it with ``--enable-vsx`` for SIMD support. If you are
-using a Cray, there is a special modified (commercial) version of
-FFTs using the FFTW interface which can be slightly faster.
+and follow the `FFTW installation guide`_. Choose the precision for
+FFTW (i.e. single/float vs. double) to match whether you will later
+use mixed or double precision for |Gromacs|. There is no need to
+compile FFTW with threading or MPI support, but it does no harm. On
+x86 hardware, compile with *both* ``--enable-sse2`` and
+``--enable-avx`` for FFTW-3.3.4 and earlier. From FFTW-3.3.5, you
+should also add ``--enable-avx2`` also. On Intel chipsets supporting
+512-wide AVX, including KNL, add ``--enable-avx512`` also. FFTW will
+create a fat library with codelets for all different instruction sets,
+and pick the fastest supported one at runtime. On IBM Power8, you
+definitely want FFTW-3.3.5 and to compile it with ``--enable-vsx`` for
+SIMD support. If you are using a Cray, there is a special modified
+(commercial) version of FFTs using the FFTW interface which can be
+slightly faster.
 
 Using MKL
 ^^^^^^^^^
index a39af0b5ab6b61c5ce781fe571559c494b852bd0..5c061659c44a8d5e1f2699921b9dcfcf68f6a44d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -69,8 +69,13 @@ elseif(${GMX_SIMD} MATCHES "^(SSE)")
     set(_fftw_simd_support_level "--enable-sse2")
 elseif(${GMX_SIMD} MATCHES "^(AVX)")
     # Testing shows FFTW configured with --enable-sse2 --enable-avx is
-    # slightly faster on most architectures than --enable-sse2 alone
-    set(_fftw_simd_support_level --enable-sse2;--enable-avx)
+    # slightly faster on most architectures than --enable-sse2 alone.
+    # Support for --enable-avx2 was only added in 3.3.5, but
+    # configuring with it is at worst a warning, even on an earlier
+    # version.
+    set(_fftw_simd_support_level --enable-sse2;--enable-avx;--enable-avx2;--enable-avx512)
+elseif(${GMX_SIMD} MATCHES "^(VSX)")
+    set(_fftw_simd_support_level --enable-vsx)
 endif()
 set(GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION ${_fftw_simd_support_level} CACHE INTERNAL "Optimization flags for FFTW compilation")
 
@@ -80,12 +85,12 @@ if (TARGET_HOST)
 endif()
 
 # Machinery for running the external project
-set(EXTERNAL_FFTW_VERSION 3.3.4)
+set(EXTERNAL_FFTW_VERSION 3.3.5)
 # cmake make eats slashes //// -> //
 set(GMX_BUILD_OWN_FFTW_URL
     "http:////www.fftw.org/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz" CACHE PATH
     "URL from where to download fftw (use an absolute path when offline, adjust GMX_BUILD_OWN_FFTW_MD5 if downloading other version than ${EXTERNAL_FFTW_VERSION})")
-set(GMX_BUILD_OWN_FFTW_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3 CACHE STRING
+set(GMX_BUILD_OWN_FFTW_MD5 6cc08a3b9c7ee06fdd5b9eb02e06f569 CACHE STRING
     "Expected MD5 hash for the file at GMX_BUILD_OWN_FFTW_URL")
 mark_as_advanced(GMX_BUILD_OWN_FFTW_URL GMX_BUILD_OWN_FFTW_MD5)