CMakeLists.txt.user
/VersionInfo*.cmake
Testing
+/.vs
+/CMakeSettings.json
tags[${#tags[@]}]=$tag
python3 $SCRIPT --cmake 3.9.6 --gcc 6 --cuda 10.1 --opencl --clfft --mpi openmpi | docker build -t $tag -
+tag="gromacs/cmake-3.9.6-gcc-7-amdopencl-clfft-openmpi:2020"
+tags[${#tags[@]}]=$tag
+python3 $SCRIPT --cmake 3.9.6 --gcc 7 --opencl amd --clfft --mpi openmpi | docker build -t $tag -
+
tag="gromacs/cmake-3.15.7-gcc-8-cuda-10.1-openmpi:2020"
tags[${#tags[@]}]=$tag
python3 $SCRIPT --cmake 3.15.7 --gcc 8 --cuda 10.1 --mpi openmpi | docker build -t $tag -
docker login
for tag in "${tags[@]}"; do
- docker push $tag
+ echo "Pushing $tag"
+ #docker push $tag
done
choices=[5, 6, 7, 8, 9],
help='Select GNU compiler tool chain. (Default) '
'Some checking is implemented to avoid incompatible combinations')
-compiler_group.add_argument('--llvm', type=int, nargs='?', const=7, default=None,
- choices=[3, 6, 7, 8, 9],
+compiler_group.add_argument('--llvm', type=str, nargs='?', const='7', default=None,
+ choices=['3.6', '6', '7', '8'],
help='Select LLVM compiler tool chain. '
'Some checking is implemented to avoid incompatible combinations')
compiler_group.add_argument('--icc', type=int, nargs='?', const=19, default=None,
# We had to pass the directory list as a string, so now we convert it back to a list
string(REPLACE ":" ";" DIRECTORIES_TO_CHECKSUM_LIST ${DIRECTORIES_TO_CHECKSUM})
+# We need the full path to the directories after passing it through
+set(FULL_PATH_DIRECTORIES "")
+foreach(DIR ${DIRECTORIES_TO_CHECKSUM_LIST})
+ list(APPEND FULL_PATH_DIRECTORIES "${PROJECT_SOURCE_DIR}/${DIR}")
+endforeach()
+
# Prepare for checking source tree file hashes.
# To notify the user during compilation and at runtime that the build source
# has not been modified after unpacking the source tarball, the contents are hashed
set(CHECKSUM_RESULT_FILE "${CMAKE_CURRENT_BINARY_DIR}/computed_checksum")
execute_process(COMMAND ${PYTHON_EXECUTABLE}
${PROJECT_SOURCE_DIR}/admin/createFileHash.py
- -s ${DIRECTORIES_TO_CHECKSUM_LIST}
+ -s ${FULL_PATH_DIRECTORIES}
-o ${CHECKSUM_RESULT_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
OUTPUT_QUIET)
elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VSX")
+ # IBM_VSX and gcc > 9 do not work together, so we need to prevent people from
+ # choosing a combination that might fail. Issue #3380.
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9")
+ message(FATAL_ERROR "IBM_VSX does not work together with gcc > 9. Disable SIMD support (slower), or use an older version of the GNU compiler")
+ endif()
+
+
gmx_find_simd_ibm_vsx_flags(SIMD_IBM_VSX_C_SUPPORTED SIMD_IBM_VSX_CXX_SUPPORTED
SIMD_IBM_VSX_C_FLAGS SIMD_IBM_VSX_CXX_FLAGS)
# build the regressiontests tarball with all the right naming. The
# naming affects the md5sum that has to go here, and if it isn't right
# release workflow will report a failure.
-set(REGRESSIONTEST_MD5SUM "b032e4517195b1f8cd9db87cee1b30df" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
+set(REGRESSIONTEST_MD5SUM "b75c3b1bac0e4114e236f049fc7f1f1c" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
math(EXPR GMX_VERSION_NUMERIC
"${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
set(VERSION_INFO_CMAKEIN_FILE ${CMAKE_CURRENT_LIST_DIR}/VersionInfo.cmake.cmakein)
set(VERSION_INFO_CONFIGURE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/gmxConfigureVersionInfo.cmake)
# A set of directories to scan for calculating the hash of source files.
-set(SET_OF_DIRECTORIES_TO_CHECKSUM "${PROJECT_SOURCE_DIR}/src")
-list(APPEND SET_OF_DIRECTORIES_TO_CHECKSUM "${PROJECT_SOURCE_DIR}/python_packaging")
+set(SET_OF_DIRECTORIES_TO_CHECKSUM "src")
+list(APPEND SET_OF_DIRECTORIES_TO_CHECKSUM "python_packaging")
# Due to the limitations for passing a list as arguments, we make the directories a string here
string(REPLACE ";" ":" DIRECTORIES_TO_CHECKSUM_STRING "${SET_OF_DIRECTORIES_TO_CHECKSUM}")
# not been tampered with.
# Note: The RUN_ALWAYS here is to regenerate the hash file only, it does not
# mean that the target is run in all builds
-if (PYTHON_EXECUTABLE)
+if (PYTHONINTERP_FOUND)
+ # We need the full path to the directories after passing it through
+ set(FULL_PATH_DIRECTORIES "")
+ foreach(DIR ${SET_OF_DIRECTORIES_TO_CHECKSUM})
+ list(APPEND FULL_PATH_DIRECTORIES "${PROJECT_SOURCE_DIR}/${DIR}")
+ endforeach()
gmx_add_custom_output_target(reference_checksum RUN_ALWAYS
OUTPUT ${CHECKSUM_FILE}
COMMAND ${PYTHON_EXECUTABLE}
${PROJECT_SOURCE_DIR}/admin/createFileHash.py
- -s ${SET_OF_DIRECTORIES_TO_CHECKSUM}
+ -s ${FULL_PATH_DIRECTORIES}
-o ${CHECKSUM_FILE}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating reference checksum of source files")
release-notes/2021/major/miscellaneous.rst
release-notes/2020/2020.1.rst
release-notes/2020/2020.2.rst
+ release-notes/2020/2020.3.rst
release-notes/2020/major/highlights.rst
release-notes/2020/major/features.rst
release-notes/2020/major/performance.rst
package for scripted Dockerfile generation.
See :file:`admin/containers/scripted_gmx_docker_builds.py`.
-.. automodule:: scripted_gmx_docker_builds
+.. todo:: :issue:`3272` Insert tool documentation.
+ E.g. ``.. automodule:: scripted_gmx_docker_builds``
GROMACS 2020.2 release notes
----------------------------
-This version was released on TODO, 2020. These release notes
+This version was released on April 30th, 2020. These release notes
document the changes that have taken place in GROMACS since the
previous 2020.1 version, to fix known issues. It also incorporates all
fixes made in version 2019.6 and earlier, which you can find described
Fixes where mdrun could behave incorrectly
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Ewald dipole correction incorrect without domain decomposition
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Ewald dipole correction (epsilon-surface != 0) is now disabled when not
+using domain decomposition. With domain decomposition, it only works
+when each molecule consists of a single update group (e.g. water).
+This will be fixed in release-2021.
+
+:issue:`3441`
+
+Expanded ensemble simulations restarted from checkpoints
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When restarting expanded ensemble simulations from checkpoints, expanded
+ensemble would silently refuse to run, and simulations would remain in
+their original lambda state.
+
+:issue:`3465`
+
+Fixed free energy calculations with LJ PME
+""""""""""""""""""""""""""""""""""""""""""
+
+Fixed an issue that calculated wrong long-range corrections when using
+free energy perturbation with ``vdwtype = pme``. This affected forces,
+energies, lambda derivatives and foreign lambdas.
+
+:issue:`3470`
+
+The velocities of the center of mass are now removed correctly in case of -update gpu
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When the center of mass motion is removed, the velocities are updated in the CPU memory.
+In case of GPU update, they should be copied back to the GPU memory after they were updated
+on the CPU. This affected most runs where the velocity of the center of mass has to be removed,
+in particular these where this velocity is large in the beginning of the run.
+
+:issue:`3508`
+
+Fix checkpoint restart with non-zero initial step
+"""""""""""""""""""""""""""""""""""""""""""""""""
+
+When restarting from the checkpoint, the init-step mdp parameter was ignored while
+checking if the simulation is already finished. As a result, this check only worked
+properly when init-step was 0 or was not specified.
+
+:issue:`3489`
+
Fixes for ``gmx`` tools
^^^^^^^^^^^^^^^^^^^^^^^
+Time output unit fixes
+^^^^^^^^^^^^^^^^^^^^^^
+
+When selecting a time unit of microseconds or larger,
+``gmx tool -tu`` now produces the correct string in .xvg and
+particularly .xvgr plots
+
+Fix do_dssp
+^^^^^^^^^^^
+
+The tool would fail with a segmentation fault.
+
+:issue:`3444`
+
Fixes that affect portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Give clearer message about not detecting IBM_VSX support in gcc > 9
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CMake would fail with a confusing error message.
+
+:issue:`3380`
+
Miscellaneous
^^^^^^^^^^^^^
+Fixed initial DLB state reporting
+"""""""""""""""""""""""""""""""""
+
+The initial DLB state was reported incorrectly in the log file when
+the either "on" or "auto" value was the chosen at mdrun startup.
--- /dev/null
+GROMACS 2020.3 release notes
+----------------------------
+
+This version was released on TODO, 2020. These release notes
+document the changes that have taken place in GROMACS since the
+previous 2020.2 version, to fix known issues. It also incorporates all
+fixes made in version 2019.6 and earlier, which you can find described
+in the :ref:`release-notes`.
+
+.. Note to developers!
+ Please use """"""" to underline the individual entries for fixed issues in the subfolders,
+ otherwise the formatting on the webpage is messed up.
+ Also, please use the syntax :issue:`number` to reference issues on redmine, without the
+ a space between the colon and number!
+
+Fixes where mdrun could behave incorrectly
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes for ``gmx`` tools
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes that affect portability
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fix error with tinyxml2 linking
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The signature for linking the external library was wrong.
+
+Miscellaneous
+^^^^^^^^^^^^^
+
2020/2020.1
2020/2020.2
+ 2020/2020.3
Major release
^^^^^^^^^^^^^
get_cuda_compiler_info(CUDA_COMPILER_INFO CUDA_DEVICE_COMPILER_FLAGS CUDA_HOST_COMPILER_FLAGS)
endif()
-string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
-configure_file(config.h.cmakein config.h)
-configure_file(gmxpre-config.h.cmakein gmxpre-config.h)
-configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES)
# Make a file with compiler flags used for libgromacs for each
# langauge and build configuration. The one that corresponds to
# CMAKE_BUILD_TYPE is #included into buildinfo.h and populates the
endif()
add_subdirectory(api)
endif()
+
+# Configure header files with configuration-specific values. This step
+# should follow all introspection e.g. looking for headers and
+# libraries. If not, cmake will need to change the contents of the
+# file upon subsequent runs of cmake. This can mean that
+#
+# cmake $src && make && make test
+#
+# requires building all the source files that depend on the changed
+# header file in both of the make stages. That's slow, and is useless
+# busy work for ccache, too.
+string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
+configure_file(config.h.cmakein config.h)
+configure_file(gmxpre-config.h.cmakein gmxpre-config.h)
+
+set(CMAKE_BUILD_CONFIGURATION_C_FLAGS ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}})
+set(CMAKE_BUILD_CONFIGURATION_CXX_FLAGS ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}})
+configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES)
endif()
set_target_properties(gmxapi PROPERTIES
+ OUTPUT_NAME "gmxapi${GMX_LIBS_SUFFIX}"
SOVERSION ${GMXAPI_MAJOR}
VERSION ${GMXAPI_RELEASE}
)
#include <string>
#include <vector>
+#include "config.h"
+
#include <gtest/gtest.h>
#include "gromacs/gmxpreprocess/grompp.h"
/** C compiler used to build */
#define BUILD_C_COMPILER "@BUILD_C_COMPILER@"
+/** C compiler flags for this build configuration */
+#define CMAKE_BUILD_CONFIGURATION_C_FLAGS "@CMAKE_BUILD_CONFIGURATION_C_FLAGS@"
+
#include "compilerflaginfo-@CMAKE_BUILD_TYPE@-C.h"
-/** C++ compiler flags used to build, or empty string if no C++ */
+/** C++ compiler used to build */
#define BUILD_CXX_COMPILER "@BUILD_CXX_COMPILER@"
+/** C++ compiler flags for this build configuration */
+#define CMAKE_BUILD_CONFIGURATION_CXX_FLAGS "@CMAKE_BUILD_CONFIGURATION_CXX_FLAGS@"
+
#include "compilerflaginfo-@CMAKE_BUILD_TYPE@-CXX.h"
/** Installation prefix (default location of data files) */
# TODO Perhaps generalize this for all headers from src/external
target_include_directories(libgromacs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/external)
-# Temporary fix to allow external access to restraintpotentail
-target_include_directories(libgromacs PUBLIC
- $<INSTALL_INTERFACE:include>
- )
-
if(SIMD_AVX_512_CXX_SUPPORTED AND NOT ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
# Since we might be overriding -march=core-avx2, add a flag so we don't warn for this specific file.
# On KNL this can cause illegal instruction because the compiler might use non KNL AVX instructions
"${CLANG_TIDY_EXE};-warnings-as-errors=*")
endif()
+# clang-3.6 warns about a number of issues that are not reported by more modern compilers
+# and we know they are not real issues. So we only check that it can compile without error
+# but ignore all warnings.
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^3\.6")
+ target_compile_options(libgromacs PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-w>)
+endif()
+
# Only install the library in mdrun-only mode if it is actually necessary
# for the binary
if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
#include "gromacs/compat/pointers.h"
+#include "config.h"
+
#include <memory>
#include <vector>
using gmx::DlbOption;
using gmx::DomdecOptions;
-static const char* edlbs_names[int(DlbState::nr)] = { "off", "auto", "locked", "on", "on" };
+static const char* edlbs_names[int(DlbState::nr)] = { "off", "off", "auto", "locked", "on", "on" };
/* The size per atom group of the cggl_flag buffer in gmx_domdec_comm_t */
#define DD_CGIBS 2
findLabelInLine(lineString, "type"); // discard the returned string
}
- if (!line || strncmp(line, "static", 6) != 0)
+ if (!line_buf || strncmp(line_buf, "static", 6) != 0)
{
gmx_input("Invalid XPixMap");
}
line = line_buf;
}
bSetLine = TRUE;
+ GMX_RELEASE_ASSERT(line, "Need to have valid line to parse");
if (strstr(line, "x-axis"))
{
line = std::strstr(line, "x-axis");
mat->axis_y.resize(nr);
std::iota(mat->axis_y.begin(), mat->axis_y.end(), 1);
mat->axis_x.resize(0);
- mat->matrix.resize(0, 0);
+ mat->matrix.resize(1, 1);
bFirst = false;
}
mat->axis_x.push_back(t);
char buf[12];
int i;
- srenew(xr->dih, xr->ndih + 2);
+ srenew(xr->dih, xr->ndih + 2LL);
for (i = 0; (i < 4); i++)
{
xr->dih[xr->ndih].ai[i] = ff[i];
}
xr->ndih += 2;
- srenew(xr->pp, xr->npp + 1);
+ srenew(xr->pp, xr->npp + 1LL);
xr->pp[xr->npp].iphi = xr->ndih - 2;
xr->pp[xr->npp].ipsi = xr->ndih - 1;
xr->pp[xr->npp].bShow = FALSE;
{
for (j = 0; (j < 4); j++)
{
+ MSVC_DIAGNOSTIC_IGNORE(28182) // false positive in 2019 (16.5.4)
ai = xr->dih[i].ai[j];
+ MSVC_DIAGNOSTIC_RESET
if (ai < xr->amin)
{
xr->amin = ai;
}
i += nra + 1;
- ia += nra + 1;
+ ia += nra + 1LL;
}
/* Fill in defaults for values not in the topology */
for (i = 0; (i < xr->ndih); i++)
real rcutoff_max2 = std::max(ic->rcoulomb, ic->rvdw);
rcutoff_max2 = rcutoff_max2 * rcutoff_max2;
- const real* tab_ewald_F_lj = nullptr;
- const real* tab_ewald_V_lj = nullptr;
- const real* ewtab = nullptr;
- real ewtabscale = 0;
- real ewtabhalfspace = 0;
- real sh_ewald = 0;
+ const real* tab_ewald_F_lj = nullptr;
+ const real* tab_ewald_V_lj = nullptr;
+ const real* ewtab = nullptr;
+ real coulombTableScale = 0;
+ real coulombTableScaleInvHalf = 0;
+ real vdwTableScale = 0;
+ real vdwTableScaleInvHalf = 0;
+ real sh_ewald = 0;
if (elecInteractionTypeIsEwald || vdwInteractionTypeIsEwald)
{
- const auto& tables = *ic->coulombEwaldTables;
- sh_ewald = ic->sh_ewald;
- ewtab = tables.tableFDV0.data();
- ewtabscale = tables.scale;
- ewtabhalfspace = half / ewtabscale;
- tab_ewald_F_lj = tables.tableF.data();
- tab_ewald_V_lj = tables.tableV.data();
+ sh_ewald = ic->sh_ewald;
+ }
+ if (elecInteractionTypeIsEwald)
+ {
+ const auto& coulombTables = *ic->coulombEwaldTables;
+ ewtab = coulombTables.tableFDV0.data();
+ coulombTableScale = coulombTables.scale;
+ coulombTableScaleInvHalf = half / coulombTableScale;
+ }
+ if (vdwInteractionTypeIsEwald)
+ {
+ const auto& vdwTables = *ic->vdwEwaldTables;
+ tab_ewald_F_lj = vdwTables.tableF.data();
+ tab_ewald_V_lj = vdwTables.tableV.data();
+ vdwTableScale = vdwTables.scale;
+ vdwTableScaleInvHalf = half / vdwTableScale;
}
/* For Ewald/PME interactions we cannot easily apply the soft-core component to
*/
real v_lr, f_lr;
- const RealType ewrt = r * ewtabscale;
+ const RealType ewrt = r * coulombTableScale;
IntType ewitab = static_cast<IntType>(ewrt);
const RealType eweps = ewrt - ewitab;
ewitab = 4 * ewitab;
f_lr = ewtab[ewitab] + eweps * ewtab[ewitab + 1];
- v_lr = (ewtab[ewitab + 2] - ewtabhalfspace * eweps * (ewtab[ewitab] + f_lr));
+ v_lr = (ewtab[ewitab + 2] - coulombTableScaleInvHalf * eweps * (ewtab[ewitab] + f_lr));
f_lr *= rinv;
/* Note that any possible Ewald shift has already been applied in
* r close to 0 for non-interacting pairs.
*/
- const RealType rs = rsq * rinv * ewtabscale;
+ const RealType rs = rsq * rinv * vdwTableScale;
const IntType ri = static_cast<IntType>(rs);
const RealType frac = rs - ri;
const RealType f_lr = (1 - frac) * tab_ewald_F_lj[ri] + frac * tab_ewald_F_lj[ri + 1];
*/
const RealType FF = f_lr * rinv / six;
RealType VV =
- (tab_ewald_V_lj[ri] - ewtabhalfspace * frac * (tab_ewald_F_lj[ri] + f_lr)) / six;
+ (tab_ewald_V_lj[ri] - vdwTableScaleInvHalf * frac * (tab_ewald_F_lj[ri] + f_lr))
+ / six;
if (ii == jnr)
{
#include "gromacs/gmxpreprocess/readir.h"
+#include "config.h"
+
#include <string>
#include <gtest/gtest.h>
int nrnbIndex;
};
+// Bug in old clang versions prevents constexpr. constexpr is needed for MSVC.
+#if defined(__clang__) && __clang_major__ < 6
+# define CONSTEXPR_EXCL_OLD_CLANG const
+#else
+# define CONSTEXPR_EXCL_OLD_CLANG constexpr
+#endif
+
/*! \brief Lookup table of bonded interaction functions
*
* This must have as many entries as interaction_function in ifunc.cpp */
template<BondedKernelFlavor flavor>
-const std::array<BondedInteractions, F_NRE> c_bondedInteractionFunctions = {
+CONSTEXPR_EXCL_OLD_CLANG std::array<BondedInteractions, F_NRE> c_bondedInteractionFunctions = {
BondedInteractions{ bonds<flavor>, eNR_BONDS }, // F_BONDS
BondedInteractions{ g96bonds<flavor>, eNR_BONDS }, // F_G96BONDS
BondedInteractions{ morse_bonds<flavor>, eNR_MORSE }, // F_MORSE
};
/*! \brief List of instantiated BondedInteractions list */
-const gmx::EnumerationArray<BondedKernelFlavor, std::array<BondedInteractions, F_NRE>> c_bondedInteractionFunctionsPerFlavor = {
+CONSTEXPR_EXCL_OLD_CLANG
+gmx::EnumerationArray<BondedKernelFlavor, std::array<BondedInteractions, F_NRE>> c_bondedInteractionFunctionsPerFlavor = {
c_bondedInteractionFunctions<BondedKernelFlavor::ForcesSimdWhenAvailable>,
c_bondedInteractionFunctions<BondedKernelFlavor::ForcesNoSimd>,
c_bondedInteractionFunctions<BondedKernelFlavor::ForcesAndVirialAndEnergy>,
void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, const real tableExtensionLength)
{
- if (EEL_PME_EWALD(ic->eeltype))
+ if (EEL_PME_EWALD(ic->eeltype) || EVDW_PME(ic->vdwtype))
{
- init_ewald_f_table(*ic, tableExtensionLength, ic->coulombEwaldTables.get(), nullptr);
+ init_ewald_f_table(*ic, tableExtensionLength, ic->coulombEwaldTables.get(),
+ ic->vdwEwaldTables.get());
if (fp != nullptr)
{
- fprintf(fp, "Initialized non-bonded Coulomb Ewald tables, spacing: %.2e size: %zu\n\n",
+ fprintf(fp, "Initialized non-bonded Ewald tables, spacing: %.2e size: %zu\n\n",
1 / ic->coulombEwaldTables->scale, ic->coulombEwaldTables->tableF.size());
}
}
ic->cutoff_scheme = ir->cutoff_scheme;
ic->coulombEwaldTables = std::make_unique<EwaldCorrectionTables>();
+ ic->vdwEwaldTables = std::make_unique<EwaldCorrectionTables>();
/* Lennard-Jones */
ic->vdwtype = ir->vdwtype;
// If coordinates are to be sent to PME task from GPU memory, perform that send here.
// Otherwise the send will occur before the H2D coordinate transfer.
- if (pmeSendCoordinatesFromGpu)
+ if (!thisRankHasDuty(cr, DUTY_PME) && pmeSendCoordinatesFromGpu)
{
/* Send particle coordinates to the pme nodes */
gmx_pme_send_coordinates(fr, cr, box, as_rvec_array(x.unpaddedArrayRef().data()), lambda[efptCOUL],
//! Contains command-line options to mdrun.
const MdrunOptions& mdrunOptions;
//! Whether the simulation will start afresh, or restart with/without appending.
- StartingBehavior startingBehavior;
+ const StartingBehavior startingBehavior;
//! Handles virtual sites.
gmx_vsite_t* vsite;
//! Handles constraints.
bDoDHDL = do_per_step(step, ir->fepvals->nstdhdl);
bDoFEP = ((ir->efep != efepNO) && do_per_step(step, nstfep));
bDoExpanded = (do_per_step(step, ir->expandedvals->nstexpanded) && (ir->bExpanded)
- && (step > 0) && (startingBehavior == StartingBehavior::NewSimulation));
+ && (!bFirstStep));
}
bDoReplEx = (useReplicaExchange && (step > 0) && !bLastStep
bInteractiveMDstep = imdSession->run(step, bNS, state->box, state->x.rvec_array(), t);
/* kludge -- virial is lost with restart for MTTK NPT control. Must reload (saved earlier). */
- if (startingBehavior != StartingBehavior::NewSimulation
+ if (startingBehavior != StartingBehavior::NewSimulation && bFirstStep
&& (inputrecNptTrotter(ir) || inputrecNphTrotter(ir)))
{
copy_mat(state->svir_prev, shake_vir);
// force kernels that use the coordinates on the next steps is not implemented
// (not because of a race on state->x being modified on the CPU while H2D is in progress).
stateGpu->waitCoordinatesCopiedToDevice(AtomLocality::Local);
+ // If the COM removal changed the velocities on the CPU, this has to be accounted for.
+ if (vcm.mode != ecmNO)
+ {
+ stateGpu->copyVelocitiesToGpu(state->v, AtomLocality::Local);
+ }
}
}
}
// Coulomb Ewald correction table
std::unique_ptr<EwaldCorrectionTables> coulombEwaldTables;
- /* Note that a Van der Waals Ewald correction table
- * of type EwaldCorrectionTables can be added here if wanted.
- */
+ // Van der Waals Ewald correction table
+ std::unique_ptr<EwaldCorrectionTables> vdwEwaldTables;
};
#endif
//! Returns the number of cells in the column
int numCellsInColumn(int columnIndex) const
{
- return cxy_ind_[columnIndex + 1] - cxy_ind_[columnIndex];
+ return cxy_ind_[columnIndex + 1LL] - cxy_ind_[columnIndex];
}
//! Returns the index of the first atom in the column
* On AMD Zen, tabulated Ewald kernels are faster on all 4 combinations
* of single or double precision and 128 or 256-bit AVX2.
*/
+ MSVC_DIAGNOSTIC_IGNORE(6285) // Always zero because compile time constant
if (
#if GMX_SIMD
(GMX_SIMD_REAL_WIDTH >= 8 || (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE)) &&
{
kernelSetup.ewaldExclusionType = EwaldExclusionType::Analytical;
}
- else
- {
- kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
- }
+ MSVC_DIAGNOSTIC_RESET
+ else { kernelSetup.ewaldExclusionType = EwaldExclusionType::Table; }
if (getenv("GMX_NBNXN_EWALD_TABLE") != nullptr)
{
kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
struct nbnxn_excl_t
{
//! Constructor, sets no exclusions, so all atom pairs interacting
+ MSVC_DIAGNOSTIC_IGNORE(26495) // pair is not being initialized!
nbnxn_excl_t()
{
for (unsigned int& pairEntry : pair)
pairEntry = NBNXN_INTERACTION_MASK_ALL;
}
}
+ MSVC_DIAGNOSTIC_RESET
//! Topology exclusion interaction bits per warp
unsigned int pair[c_nbnxnGpuExclSize];
{
store_->append(value);
}
- DIAGNOSTIC_RESET;
+ CLANG_DIAGNOSTIC_RESET;
clearSet();
}
gmx_target_warning_suppression(scanner -Wno-unused HAS_NO_UNUSED)
gmx_target_warning_suppression(scanner -Wno-unused-parameter HAS_NO_UNUSED_PARAMETER)
gmx_target_warning_suppression(scanner -Wno-missing-declarations HAS_NO_MISSING_DECLARATIONS)
+ gmx_target_warning_suppression(scanner -Wno-null-conversion HAS_NO_NULL_CONVERSIONS)
gmx_target_warning_suppression(scanner -wd1419 HAS_DECL_IN_SOURCE)
endif()
list(APPEND libgromacs_object_library_dependencies scanner)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,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.
class SimdFIBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFIBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFIBool(bool b) : simdInternal_(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
// Internal utility constructor to simplify return statements
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,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.
class Simd4Double
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4Double() {}
+ MSVC_DIAGNOSTIC_RESET
Simd4Double(double d) : simdInternal_(_mm256_set1_pd(d)) {}
class Simd4DBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4DBool() {}
+ MSVC_DIAGNOSTIC_RESET
//! \brief Construct from scalar bool
Simd4DBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)))
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019,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.
class Simd4Float
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4Float() {}
-
+ MSVC_DIAGNOSTIC_RESET
Simd4Float(float f) : simdInternal_(_mm_set1_ps(f)) {}
// Internal utility constructor to simplify return statements
class Simd4FBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4FBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
//! \brief Construct from scalar bool
Simd4FBool(bool b) : simdInternal_(_mm_castsi128_ps(_mm_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
class SimdDouble
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDouble() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDouble(double d) : simdInternal_(_mm256_set1_pd(d)) {}
// Internal utility constructor to simplify return statements
class SimdDInt32
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDInt32() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDInt32(std::int32_t i) : simdInternal_(_mm_set1_epi32(i)) {}
// Internal utility constructor to simplify return statements
class SimdDBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
// Internal utility constructor to simplify return statements
class SimdDIBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDIBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDIBool(bool b) : simdInternal_(_mm_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
// Internal utility constructor to simplify return statements
class SimdFloat
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFloat() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFloat(float f) : simdInternal_(_mm256_set1_ps(f)) {}
// Internal utility constructor to simplify return statements
class SimdFInt32
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFInt32() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFInt32(std::int32_t i) : simdInternal_(_mm256_set1_epi32(i)) {}
// Internal utility constructor to simplify return statements
class SimdFBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFBool(bool b) : simdInternal_(_mm256_castsi256_ps(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
// Internal utility constructor to simplify return statements
#include <array>
#include <type_traits>
+#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/real.h"
output += gmx::formatString(
"PP tasks will do (non-perturbed) short-ranged%s interactions on the GPU\n",
useGpuForBonded ? " and most bonded" : "");
- output += gmx::formatString("PP task will update and constrain coordinates on the %s",
+ output += gmx::formatString("PP task will update and constrain coordinates on the %s\n",
useGpuForUpdate ? "GPU" : "CPU");
if (pmeRunMode == PmeRunMode::Mixed)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019,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.
int numBlocks() const { return static_cast<int>(index_.size()) - 1; }
/*! \brief Returns the size of the block with index \p blockIndex */
- Block block(int blockIndex) const { return Block(index_[blockIndex], index_[blockIndex + 1]); }
+ Block block(int blockIndex) const
+ {
+ return Block(index_[blockIndex], index_[blockIndex + 1LL]);
+ }
/*! \brief Returns the full range */
Block fullRange() const { return Block(index_.front(), index_.back()); }
void reduceNumBlocks(int newNumBlocks)
{
GMX_ASSERT(newNumBlocks <= numBlocks(), "Can only shrink to fewer blocks");
- index_.resize(newNumBlocks + 1);
+ index_.resize(newNumBlocks + 1LL);
}
/*! \brief Sets the partitioning to \p numBlocks blocks each of size 1 */
# define DO_PRAGMA(x) _Pragma(# x)
# define CLANG_DIAGNOSTIC_IGNORE(warning) \
_Pragma("clang diagnostic push") DO_PRAGMA(clang diagnostic ignored #warning)
-# define DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
+# define CLANG_DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
#else
-//! Ignore specified clang warning until DIAGNOSTIC_RESET
+//! Ignore specified clang warning until CLANG_DIAGNOSTIC_RESET
# define CLANG_DIAGNOSTIC_IGNORE(warning)
//! Reset all diagnostics to default
-# define DIAGNOSTIC_RESET
+# define CLANG_DIAGNOSTIC_RESET
+#endif
+
+#ifdef _MSC_VER
+# define MSVC_DIAGNOSTIC_IGNORE(id) __pragma(warning(push)) __pragma(warning(disable : id))
+# define MSVC_DIAGNOSTIC_RESET __pragma(warning(pop))
+#else
+//! Ignore specified MSVC warning until MSVC_DIAGNOSTIC_RESET
+# define MSVC_DIAGNOSTIC_IGNORE(warning)
+//! Reset all diagnostics to default
+# define MSVC_DIAGNOSTIC_RESET
#endif
namespace gmx
* 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));
+ writer->writeLine(formatString("C++ compiler flags: %s %s", BUILD_CXXFLAGS,
+ CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
#ifdef 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__,
#endif
#if GMX_GPU == 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
#include "gromacs/utility/enumerationhelpers.h"
+#include "config.h"
+
#include <iostream>
#include <gtest/gtest.h>
*/
#include "gmxpre.h"
+#include "config.h"
+
#include <string>
#include <gmock/gmock.h>
if(HAVE_TINYXML2)
include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
+ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
else()
include_directories(BEFORE SYSTEM "../external/tinyxml2")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7")
target_compile_options(${EXENAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Weverything ${IGNORED_CLANG_ALL_WARNINGS} -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-as-null-pointer-constant -Wno-missing-variable-declarations>)
endif()
+ # clang-3.6 warns about a number of issues that are not reported by more modern compilers
+ # and we know they are not real issues. So we only check that it can compile without error
+ # but ignore all warnings.
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^3\.6")
+ target_compile_options(${EXENAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-w>)
+ endif()
endif()
endfunction()