Add Oliver Fleetwood as a contributor
[alexxy/gromacs.git] / src / gromacs / utility / binaryinformation.cpp
index e081ed4b5e2d76baa2ff3777d767eb4ee8e399a7..a1bff11d524a2330f316d6605217e4feb219c3e2 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
@@ -52,7 +52,7 @@
 #    include <fftw3.h>
 #endif
 
-#ifdef HAVE_LIBMKL
+#if HAVE_LIBMKL
 #    include <mkl.h>
 #endif
 
@@ -86,6 +86,7 @@
 #include "gromacs/utility/textwriter.h"
 
 #include "cuda_version_information.h"
+#include "sycl_version_information.h"
 
 namespace
 {
@@ -107,23 +108,59 @@ std::string formatCentered(int width, const char* text)
 
 void printCopyright(gmx::TextWriter* writer)
 {
-    static const char* const Contributors[] = {
-        "Emile Apol",         "Rossen Apostolov",   "Paul Bauer",         "Herman J.C. Berendsen",
-        "Par Bjelkmar",       "Christian Blau",     "Viacheslav Bolnykh", "Kevin Boyd",
-        "Aldert van Buuren",  "Rudi van Drunen",    "Anton Feenstra",     "Alan Gray",
-        "Gerrit Groenhof",    "Anca Hamuraru",      "Vincent Hindriksen", "M. Eric Irrgang",
-        "Aleksei Iupinov",    "Christoph Junghans", "Joe Jordan",         "Dimitrios Karkoulis",
-        "Peter Kasson",       "Jiri Kraus",         "Carsten Kutzner",    "Per Larsson",
-        "Justin A. Lemkul",   "Viveca Lindahl",     "Magnus Lundborg",    "Erik Marklund",
-        "Pascal Merz",        "Pieter Meulenhoff",  "Teemu Murtola",      "Szilard Pall",
-        "Sander Pronk",       "Roland Schulz",      "Michael Shirts",     "Alexey Shvetsov",
-        "Alfons Sijbers",     "Peter Tieleman",     "Jon Vincent",        "Teemu Virolainen",
-        "Christian Wennberg", "Maarten Wolf",       "Artem Zhmurov"
-    };
+    // Contributors sorted alphabetically by last name
+    static const char* const Contributors[]  = { "Andrey Alekseenko",
+                                                "Emile Apol",
+                                                "Rossen Apostolov",
+                                                "Paul Bauer",
+                                                "Herman J.C. Berendsen",
+                                                "Par Bjelkmar",
+                                                "Christian Blau",
+                                                "Viacheslav Bolnykh",
+                                                "Kevin Boyd",
+                                                "Aldert van Buuren",
+                                                "Rudi van Drunen",
+                                                "Anton Feenstra",
+                                                "Oliver Fleetwood",
+                                                "Gaurav Garg",
+                                                "Gilles Gouaillardet",
+                                                "Alan Gray",
+                                                "Gerrit Groenhof",
+                                                "Anca Hamuraru",
+                                                "Vincent Hindriksen",
+                                                "M. Eric Irrgang",
+                                                "Aleksei Iupinov",
+                                                "Christoph Junghans",
+                                                "Joe Jordan",
+                                                "Dimitrios Karkoulis",
+                                                "Peter Kasson",
+                                                "Jiri Kraus",
+                                                "Carsten Kutzner",
+                                                "Per Larsson",
+                                                "Justin A. Lemkul",
+                                                "Viveca Lindahl",
+                                                "Magnus Lundborg",
+                                                "Erik Marklund",
+                                                "Pascal Merz",
+                                                "Pieter Meulenhoff",
+                                                "Teemu Murtola",
+                                                "Szilard Pall",
+                                                "Sander Pronk",
+                                                "Roland Schulz",
+                                                "Michael Shirts",
+                                                "Alexey Shvetsov",
+                                                "Alfons Sijbers",
+                                                "Peter Tieleman",
+                                                "Jon Vincent",
+                                                "Teemu Virolainen",
+                                                "Christian Wennberg",
+                                                "Maarten Wolf",
+                                                "Artem Zhmurov" };
     static const char* const CopyrightText[] = {
         "Copyright (c) 1991-2000, University of Groningen, The Netherlands.",
         "Copyright (c) 2001-2019, The GROMACS development team at",
-        "Uppsala University, Stockholm University and", "the Royal Institute of Technology, Sweden.",
+        "Uppsala University, Stockholm University and",
+        "the Royal Institute of Technology, Sweden.",
         "check out http://www.gromacs.org for more information."
     };
 
@@ -134,9 +171,9 @@ void printCopyright(gmx::TextWriter* writer)
     writer->writeLine(formatCentered(78, "GROMACS is written by:"));
     for (int i = 0; i < NCONTRIBUTORS;)
     {
-        for (int j = 0; j < 4 && i < NCONTRIBUTORS; ++j, ++i)
+        for (int j = 0; j < 3 && i < NCONTRIBUTORS; ++j, ++i)
         {
-            const int            width = 18;
+            const int            width = 26;
             std::array<char, 30> buf;
             const int            offset = centeringOffset(width, strlen(Contributors[i]));
             GMX_RELEASE_ASSERT(static_cast<int>(strlen(Contributors[i])) + offset < gmx::ssize(buf),
@@ -169,8 +206,8 @@ void printCopyright(gmx::TextWriter* writer)
     }
 }
 
-// Construct a string that describes the library that provides FFT support to this build
-const char* getFftDescriptionString()
+//! Construct a string that describes the library that provides CPU FFT support to this build
+const char* getCpuFftDescriptionString()
 {
 // Define the FFT description string
 #if GMX_FFT_FFTW3 || GMX_FFT_ARMPL_FFTW3
@@ -194,6 +231,35 @@ const char* getFftDescriptionString()
 #endif
 };
 
+//! Construct a string that describes the library that provides GPU FFT support to this build
+const char* getGpuFftDescriptionString()
+{
+    if (GMX_GPU)
+    {
+        if (GMX_GPU_CUDA)
+        {
+            return "cuFFT";
+        }
+        else if (GMX_GPU_OPENCL)
+        {
+            return "clFFT";
+        }
+        else if (GMX_GPU_SYCL)
+        {
+            return "unknown";
+        }
+        else
+        {
+            GMX_RELEASE_ASSERT(false, "Unknown GPU configuration");
+            return "impossible";
+        }
+    }
+    else
+    {
+        return "none";
+    }
+};
+
 void gmx_print_version_info(gmx::TextWriter* writer)
 {
     writer->writeLine(formatString("GROMACS version:    %s", gmx_version()));
@@ -251,14 +317,18 @@ void gmx_print_version_info(gmx::TextWriter* writer)
 #if GMX_DOUBLE
     writer->writeLine("Precision:          double");
 #else
-    writer->writeLine("Precision:          single");
+    writer->writeLine("Precision:          mixed");
 #endif
     writer->writeLine(formatString("Memory model:       %u bit", static_cast<unsigned>(8 * sizeof(void*))));
 
 #if GMX_THREAD_MPI
     writer->writeLine("MPI library:        thread_mpi");
 #elif GMX_MPI
+#    if HAVE_CUDA_AWARE_MPI
+    writer->writeLine("MPI library:        MPI (CUDA-aware)");
+#    else
     writer->writeLine("MPI library:        MPI");
+#    endif
 #else
     writer->writeLine("MPI library:        none");
 #endif
@@ -270,8 +340,11 @@ void gmx_print_version_info(gmx::TextWriter* writer)
 #endif
     writer->writeLine(formatString("GPU support:        %s", getGpuImplementationString()));
     writer->writeLine(formatString("SIMD instructions:  %s", GMX_SIMD_STRING));
-    writer->writeLine(formatString("FFT library:        %s", getFftDescriptionString()));
-    writer->writeLine(formatString("RDTSCP usage:       %s", HAVE_RDTSCP ? "enabled" : "disabled"));
+    writer->writeLine(formatString("CPU FFT library:    %s", getCpuFftDescriptionString()));
+    writer->writeLine(formatString("GPU FFT library:    %s", getGpuFftDescriptionString()));
+#if GMX_TARGET_X86
+    writer->writeLine(formatString("RDTSCP usage:       %s", GMX_USE_RDTSCP ? "enabled" : "disabled"));
+#endif
 #if GMX_USE_TNG
     writer->writeLine("TNG support:        enabled");
 #else
@@ -285,8 +358,8 @@ void gmx_print_version_info(gmx::TextWriter* writer)
 #if HAVE_EXTRAE
     unsigned major, minor, revision;
     Extrae_get_version(&major, &minor, &revision);
-    writer->writeLine(formatString("Tracing support:    enabled. Using Extrae-%d.%d.%d", major,
-                                   minor, revision));
+    writer->writeLine(formatString(
+            "Tracing support:    enabled. Using Extrae-%d.%d.%d", major, minor, revision));
 #else
     writer->writeLine("Tracing support:    disabled");
 #endif
@@ -296,25 +369,38 @@ void gmx_print_version_info(gmx::TextWriter* writer)
      * them. Can wait for later, as the master branch has ready code to do all
      * that. */
     writer->writeLine(formatString("C compiler:         %s", BUILD_C_COMPILER));
-    writer->writeLine(formatString("C compiler flags:   %s", BUILD_CFLAGS));
+    writer->writeLine(formatString(
+            "C compiler flags:   %s %s", BUILD_CFLAGS, CMAKE_BUILD_CONFIGURATION_C_FLAGS));
     writer->writeLine(formatString("C++ compiler:       %s", BUILD_CXX_COMPILER));
-    writer->writeLine(formatString("C++ compiler flags: %s", BUILD_CXXFLAGS));
-#ifdef HAVE_LIBMKL
+    writer->writeLine(formatString(
+            "C++ compiler flags: %s %s", BUILD_CXXFLAGS, CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
+#if HAVE_LIBMKL
     /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
-    writer->writeLine(formatString("Linked with Intel MKL version %d.%d.%d.", __INTEL_MKL__,
-                                   __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__));
+    writer->writeLine(formatString(
+            "Intel MKL version:  %d.%d.%d", __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__));
 #endif
-#if GMX_GPU == GMX_GPU_OPENCL
+#if GMX_GPU_OPENCL
     writer->writeLine(formatString("OpenCL include dir: %s", OPENCL_INCLUDE_DIR));
     writer->writeLine(formatString("OpenCL library:     %s", OPENCL_LIBRARY));
     writer->writeLine(formatString("OpenCL version:     %s", OPENCL_VERSION_STRING));
 #endif
-#if GMX_GPU == GMX_GPU_CUDA
+#if GMX_GPU_CUDA
     writer->writeLine(formatString("CUDA compiler:      %s", CUDA_COMPILER_INFO));
-    writer->writeLine(formatString("CUDA compiler flags:%s", CUDA_COMPILER_FLAGS));
+    writer->writeLine(formatString(
+            "CUDA compiler flags:%s %s", CUDA_COMPILER_FLAGS, CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
     writer->writeLine("CUDA driver:        " + gmx::getCudaDriverVersionString());
     writer->writeLine("CUDA runtime:       " + gmx::getCudaRuntimeVersionString());
 #endif
+#if GMX_SYCL_DPCPP
+    writer->writeLine(formatString("SYCL DPC++ flags:   %s", SYCL_DPCPP_COMPILER_FLAGS));
+    writer->writeLine("SYCL DPC++ version: " + gmx::getSyclCompilerVersion());
+#endif
+#if GMX_SYCL_HIPSYCL
+    writer->writeLine(formatString("hipSYCL launcher:   %s", SYCL_HIPSYCL_COMPILER_LAUNCHER));
+    writer->writeLine(formatString("hipSYCL flags:      %s", SYCL_HIPSYCL_COMPILER_FLAGS));
+    writer->writeLine(formatString("hipSYCL targets:    %s", SYCL_HIPSYCL_TARGETS));
+    writer->writeLine("hipSYCL version:    " + gmx::getSyclCompilerVersion());
+#endif
 }
 
 //! \endcond
@@ -388,8 +474,8 @@ void printBinaryInformation(TextWriter*                      writer,
         // necessary to read stuff above the copyright notice.
         // The line above the copyright notice puts the copyright notice is
         // context, though.
-        writer->writeLine(formatString("%sGROMACS:      %s, version %s%s%s", prefix, name,
-                                       gmx_version(), precisionString, suffix));
+        writer->writeLine(formatString(
+                "%sGROMACS:      %s, version %s%s%s", prefix, name, gmx_version(), precisionString, suffix));
     }
     const char* const binaryPath = programContext.fullBinaryPath();
     if (!gmx::isNullOrEmpty(binaryPath))
@@ -399,8 +485,11 @@ void printBinaryInformation(TextWriter*                      writer,
     const gmx::InstallationPrefixInfo installPrefix = programContext.installationPrefix();
     if (!gmx::isNullOrEmpty(installPrefix.path))
     {
-        writer->writeLine(formatString("%sData prefix:  %s%s%s", prefix, installPrefix.path,
-                                       installPrefix.bSourceLayout ? " (source tree)" : "", suffix));
+        writer->writeLine(formatString("%sData prefix:  %s%s%s",
+                                       prefix,
+                                       installPrefix.path,
+                                       installPrefix.bSourceLayout ? " (source tree)" : "",
+                                       suffix));
     }
     const std::string workingDir = Path::getWorkingDirectory();
     if (!workingDir.empty())
@@ -414,8 +503,8 @@ void printBinaryInformation(TextWriter*                      writer,
     const char* const commandLine = programContext.commandLine();
     if (!gmx::isNullOrEmpty(commandLine))
     {
-        writer->writeLine(formatString("%sCommand line:%s\n%s  %s%s", prefix, suffix, prefix,
-                                       commandLine, suffix));
+        writer->writeLine(formatString(
+                "%sCommand line:%s\n%s  %s%s", prefix, suffix, prefix, commandLine, suffix));
     }
     if (settings.bExtendedInfo_)
     {