Miscellaneous updates from nblib
authorJoe Jordan <ejjordan12@gmail.com>
Mon, 7 Jun 2021 09:16:35 +0000 (09:16 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 7 Jun 2021 09:16:35 +0000 (09:16 +0000)
api/nblib/CMakeLists.txt
api/nblib/basicdefinitions.h
api/nblib/interactions.h
api/nblib/particletype.h
api/nblib/tests/testhelpers.cpp [deleted file]
api/nblib/vector.h

index 90038702a7bc079afaa5662f2c8fda5f84b033f4..6cbc8f91245675890fe37b7c8ace217f8f267dc0 100644 (file)
@@ -99,6 +99,16 @@ set_target_properties(nblib PROPERTIES
         LINKER_LANGUAGE CXX
         OUTPUT_NAME "nblib")
 
+if (GMX_GPU_CUDA)
+    if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
+        find_package(CUDA)
+        target_include_directories(nblib PRIVATE "${CUDA_INCLUDE_DIRS}")
+    else()
+        find_package(CUDAToolkit)
+        target_link_libraries(nblib PRIVATE CUDA::cudart)
+    endif()
+endif()
+
 target_sources(nblib
         PRIVATE
         box.cpp
@@ -118,6 +128,7 @@ target_sources(nblib
 gmx_target_compile_options(nblib)
 
 target_link_libraries(nblib PRIVATE libgromacs)
+target_include_directories(nblib SYSTEM BEFORE PRIVATE ${PROJECT_SOURCE_DIR}/src/external/thread_mpi/include)
 target_include_directories(nblib PRIVATE ${PROJECT_SOURCE_DIR}/api)
 include_directories(BEFORE ${CMAKE_SOURCE_DIR}/api)
 target_link_libraries(nblib PRIVATE common)
index ebb4d3f43dcaebaf0d222da17fc6ddf0479197b7..88c0764aba3f22c0703e624d9a4e16cd8b595a9e 100644 (file)
@@ -88,11 +88,6 @@ constexpr const int N_IVEC  = (N_BOX_Z * N_BOX_Y * N_BOX_X);
 //! Needed for generating Bolzmann velocity distribution (kJ/(mol K))
 constexpr const real BOLTZ = (detail::RGAS / detail::KILO); /*  */
 
-#ifndef M_PI
-//! Required work-around for platforms that don't implement POSIX-style cmath header
-#    define M_PI 3.14159265358979323846
-#endif
-
 //! Charge multiplication factor for Coulomb interactions
 constexpr const real ONE_4PI_EPS0 = (1.0 / (4.0 * M_PI * detail::EPSILON0));
 
index fd563d0cd15cb62030112044689cf5ceae616624..f9d77a9bc76ee1e17c18990a0519df732f3c4e79 100644 (file)
 namespace nblib
 {
 
-//! Shorthand for a map used for looking up non-bonded parameters using particle types
-//! Named type for the C6 parameter in the Lennard-Jones potential
-using C6 = StrongType<real, struct C6Parameter>;
-//! Named type for the C12 parameter in the Lennard-Jones potential
-using C12 = StrongType<real, struct C12Parameter>;
-
 using NonBondedInteractionMapImpl =
         std::map<std::tuple<ParticleTypeName, ParticleTypeName>, std::tuple<C6, C12>>;
 
index 2fd4127a51415669dfe03ce1d6fc8ef0ef4496a9..f5d86bb39e685c839614280021eb7f49981c590b 100644 (file)
@@ -62,6 +62,12 @@ using ParticleTypeName = StrongType<std::string, struct ParticleTypeNameParamete
 //! Named type for particle mass
 using Mass = StrongType<real, struct MassParameter>;
 
+// Shorthand for a map used for looking up non-bonded parameters using particle types
+//! Named type for the C6 parameter in the Lennard-Jones potential
+using C6 = StrongType<real, struct C6Parameter>;
+//! Named type for the C12 parameter in the Lennard-Jones potential
+using C12 = StrongType<real, struct C12Parameter>;
+
 /*! \brief Class that represents the particle type.
  *
  * The particle type is used in lookup tables for masses, non-bonded parameters, etc.
diff --git a/api/nblib/tests/testhelpers.cpp b/api/nblib/tests/testhelpers.cpp
deleted file mode 100644 (file)
index 0884a06..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2020, 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.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*! \internal \file
- * \brief
- * This implements basic nblib test systems
- *
- * \author Victor Holanda <victor.holanda@cscs.ch>
- * \author Joe Jordan <ejjordan@kth.se>
- * \author Prashanth Kanduri <kanduri@cscs.ch>
- * \author Sebastian Keller <keller@cscs.ch>
- */
-#include "nblib/tests/testhelpers.h"
-
-namespace nblib
-{
-namespace test
-{
-
-//! Compare between two instances of the Box object
-bool operator==(const Box& a, const Box& b)
-{
-    if (a.legacyMatrix()[XX][XX] != b.legacyMatrix()[XX][XX])
-    {
-        return false;
-    }
-    if (a.legacyMatrix()[YY][YY] != b.legacyMatrix()[YY][YY])
-    {
-        return false;
-    }
-    if (a.legacyMatrix()[ZZ][ZZ] != b.legacyMatrix()[ZZ][ZZ])
-    {
-        return false;
-    }
-    return true;
-}
-
-} // namespace test
-} // namespace nblib
index eb32f4c075ea6c582297ad527739397a824253ee..8a23666292237fd3a53909bd7bebbc797b2677a6 100644 (file)
@@ -45,7 +45,6 @@
 #define NBLIB_BASICVECTOR_H
 
 #include "gromacs/math/vectypes.h"
-#include "nblib/basicdefinitions.h"
 
 namespace nblib
 {