OFF)
mark_as_advanced(GMX_DEVELOPER_BUILD)
+option(GMX_BUILD_SHARED_EXE
+ "Build exectuables as shared binaries. If not set, this disables rpath and dynamic linker flags in an attempt to build a static binary, but this may require setting up the toolchain properly and making appropriate libraries available."
+ ON)
+mark_as_advanced(GMX_BUILD_SHARED_EXE)
+
######################################################################
# Detect OpenMP support
######################################################################
# CMake supports RPATH on OS X only from 2.8.12 upwards.
# CMAKE_SYSTEM_VERSION > 8.0 matches OS X 10.5 and above, where RPATH support
# was added.
-if((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
+
+if(NOT GMX_BUILD_SHARED_EXE)
+ # No rpath
+ set(CMAKE_SKIP_RPATH TRUE)
+ set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
+ set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
+elseif((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
((CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) AND (NOT CMAKE_VERSION VERSION_LESS 2.8.12)))
# The build folder always has bin/ and lib/; if we are also going to
# install to lib/, then the installation RPATH works also in the build
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, 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.
message(FATAL_ERROR "Could not find ${${FFTW}_FUNCTION_PREFIX}_plan_r2r_1d in ${${FFTW}_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what went wrong. If you are using a static lib (.a) make sure you have specified all dependencies of ${${FFTW}_PKG} in ${FFTW}_LIBRARY by hand (e.g. -D${FFTW}_LIBRARY='/path/to/lib${${FFTW}_PKG}.so;/path/to/libm.so') !")
endif()
- # Check for FFTW3 compiled with --enable-avx, which is slower for GROMACS than --enable-sse or --enable-sse2
- foreach(AVX_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx)
+ # Check for FFTW3 compiled with --enable-sse
+ foreach(SSE_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse)
if (FFTW_LIBRARY_CHANGED)
- unset(${FFTW}_HAVE_${AVX_FUNCTION} CACHE)
+ unset(${FFTW}_HAVE_${SSE_FUNCTION} CACHE)
endif()
- check_library_exists("${${FFTW}_LIBRARIES}" "${AVX_FUNCTION}" "" ${FFTW}_HAVE_${AVX_FUNCTION})
- if(${FFTW}_HAVE_${AVX_FUNCTION})
- set(${FFTW}_HAVE_AVX TRUE)
+ check_library_exists("${${FFTW}_LIBRARIES}" "${SSE_FUNCTION}" "" ${FFTW}_HAVE_${SSE_FUNCTION})
+ if(${FFTW}_HAVE_${SSE_FUNCTION})
+ set(${FFTW}_HAVE_SSE TRUE)
+ break()
+ endif()
+ endforeach()
+
+ # Check for FFTW3 compiled with --enable-sse2
+ foreach(SSE2_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_sse2)
+ if (FFTW_LIBRARY_CHANGED)
+ unset(${FFTW}_HAVE_${SSE2_FUNCTION} CACHE)
+ endif()
+ check_library_exists("${${FFTW}_LIBRARIES}" "${SSE2_FUNCTION}" "" ${FFTW}_HAVE_${SSE2_FUNCTION})
+ if(${FFTW}_HAVE_${SSE2_FUNCTION})
+ set(${FFTW}_HAVE_SSE2 TRUE)
+ break()
+ endif()
+ endforeach()
+
+ # Check for FFTW3 with 128-bit AVX compiled with --enable-avx
+ foreach(AVX_128_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx_128)
+ if (FFTW_LIBRARY_CHANGED)
+ unset(${FFTW}_HAVE_${AVX_128_FUNCTION} CACHE)
+ endif()
+ check_library_exists("${${FFTW}_LIBRARIES}" "${AVX_128_FUNCTION}" "" ${FFTW}_HAVE_${AVX_128_FUNCTION})
+ if(${FFTW}_HAVE_${AVX_128_FUNCTION})
+ set(${FFTW}_HAVE_AVX_128 TRUE)
+ break()
+ endif()
+ endforeach()
+
+ # Check for FFTW3 with 128-bit AVX2 compiled with --enable-avx2
+ foreach(AVX2_128_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx2_128)
+ if (FFTW_LIBRARY_CHANGED)
+ unset(${FFTW}_HAVE_${AVX2_128_FUNCTION} CACHE)
+ endif()
+ check_library_exists("${${FFTW}_LIBRARIES}" "${AVX2_128_FUNCTION}" "" ${FFTW}_HAVE_${AVX2_128_FUNCTION})
+ if(${FFTW}_HAVE_${AVX2_128_FUNCTION})
+ set(${FFTW}_HAVE_AVX2_128 TRUE)
break()
endif()
endforeach()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, 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.
set(FFTW fftwf)
endif()
+ # Note that these calls are expected to function the same way,
+ # particularly with respect to setting CMake variables that
+ # record the presence of particular FFTW SIMD support.
+ # TODO There is no need for this requirement, all the remaining
+ # code here can be refactored to have just one check of
+ # GMX_BUILD_OWN_FFTW, which simplifies both code paths.
if(GMX_BUILD_OWN_FFTW)
add_subdirectory(src/contrib/fftw)
else()
if ((${GMX_SIMD} MATCHES "SSE" OR ${GMX_SIMD} MATCHES "AVX") AND NOT ${FFTW}_HAVE_SIMD)
message(WARNING "The fftw library found is compiled without SIMD support, which makes it slow. Consider recompiling it or contact your admin")
- endif()
-
- if((${GMX_SIMD} MATCHES "SSE" OR ${GMX_SIMD} MATCHES "AVX") AND ${FFTW}_HAVE_AVX)
- # If we're not using SIMD instructions, we don't care about FFTW performance on x86 either
- message(WARNING "The FFTW library was compiled with --enable-avx to enable AVX SIMD instructions. That might sound like a good idea for your processor, but for FFTW versions up to 3.3.3, these are slower than the SSE/SSE2 SIMD instructions for the way GROMACS uses FFTs. Limitations in the way FFTW allows GROMACS to measure performance make it awkward for either GROMACS or FFTW to make the decision for you based on runtime performance. You should compile a different FFTW library with --enable-sse or --enable-sse2. If you have a more recent FFTW, you may like to compare the performance of GROMACS with FFTW libraries compiled with and without --enable-avx. However, the GROMACS developers do not really expect the FFTW AVX optimization to help, because the performance is limited by memory access, not computation.")
+ else()
+ if(${GMX_SIMD} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2 OR ${FFTW}_HAVE_AVX_128 OR ${FFTW}_HAVE_AVX2_128))
+ # If we end up here we have an AVX Gromacs build, and FFTW with SIMD, but no 128-bit SIMD, this means AVX is enabled for FFTW.
+ 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). The FFTW library will determine at runtime which SIMD instruction set is fastest for different parts of the FFTs.")
+ endif()
endif()
set(FFT_STATUS_MESSAGE "Using external FFT library - FFTW3")
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, 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.
if (WIN32 AND NOT BUILD_SHARED_LIBS)
set(GMX_PREFER_STATIC_LIBS_DEFAULT ON)
endif()
+if (NOT GMX_BUILD_SHARED_EXE)
+ set(GMX_PREFER_STATIC_LIBS_DEFAULT ON)
+ set(SHARED_LIBS_DEFAULT OFF)
+endif()
# Declare the user-visible options
option(BUILD_SHARED_LIBS "Enable shared libraries (can be problematic e.g. with MPI, or on some HPC systems)" ${SHARED_LIBS_DEFAULT})
where that is the default. To use static system libraries,
additional compiler/linker flags are necessary, e.g. ``-static-libgcc
-static-libstdc++``.
+* To attempt to link a fully static binary set
+ ``-DGMX_BUILD_SHARED_EXE=OFF``. This will prevent CMake from explicitly
+ setting any dynamic linking flags. This option also sets
+ ``-DBUILD_SHARED_LIBS=OFF`` and ``-DGMX_PREFER_STATIC_LIBS=ON`` by
+ default, but the above caveats apply. For compilers which don't
+ default to static linking, the required flags have to be specified. On
+ Linux, this is usually ``CFLAGS=-static CXXFLAGS=-static``.
Portability aspects
^^^^^^^^^^^^^^^^^^^
----------------
|Gromacs| builds mostly out of the box on modern Cray machines, but
-* you may need to specify the use of static or dynamic libraries
- (depending on the machine) with ``-DBUILD_SHARED_LIBS=off``,
+* you may need to specify the use of static binaries
+ with ``-DGMX_BUILD_SHARED_EXE=off``,
* you may need to set the F77 environmental variable to ``ftn`` when
compiling FFTW,
-* you may need to use ``-DCMAKE_SKIP_RPATH=YES``, and
-* you may need to modify the CMakeLists.txt files to specify the
- ``BUILD_SEARCH_END_STATIC`` target property.
Building on BlueGene
--------------------
this effect, but it will also increase the interactions with hydrogens
relative to the other interactions in the soft-core state.
-When soft core potentials are selected (by setting {\tt sc-alpha} \textgreater
+When soft-core potentials are selected (by setting {\tt sc-alpha} \textgreater
0), and the Coulomb and Lennard-Jones potentials are turned on or off
sequentially, then the Coulombic interaction is turned off linearly,
-rather than using soft core interactions, which should be less
-statistically noisy in most cases. This behavior can be overwritten
-by using the mdp option {\tt sc-coul} to {\tt yes}. Additionally, the
-soft-core interaction potential is only applied when either the A or B
-state has zero interaction potential. If both A and B states have
+rather than using soft-core interactions, which should be less
+statistically noisy in most cases. This behavior can be overwritten
+by using the mdp option {\tt sc-coul} to {\tt yes}. Note that the {\tt sc-coul}
+is only taken into account when lambda states are used, not with
+{\tt couple-lambda0/couple-lambda1}, and you can still turn off soft-core
+interactions by setting {\tt sc-alpha=0}. Additionally, the soft-core
+interaction potential is only applied when either the A or B
+state has zero interaction potential. If both A and B states have
nonzero interaction potential, default linear scaling described above
is used. When both Coulombic and Lennard-Jones interactions are turned
off simultaneously, a soft-core potential is used, and a hydrogen is
.. mdp:: sc-coul
(no)
- Whether to apply the soft core free energy interaction
+ Whether to apply the soft-core free energy interaction
transformation to the Columbic interaction of a molecule. Default
is no, as it is generally more efficient to turn off the Coulomic
interactions linearly before turning off the van der Waals
- interactions.
+ interactions. Note that it is only taken into account when lambda
+ states are used, not with :mdp:`couple-lambda0` /
+ :mdp:`couple-lambda1`, and you can still turn off soft-core
+ interactions by setting :mdp:`sc-alpha` to 0.
.. mdp:: sc-power
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, 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.
# Input: FFTW variable contains the FFTW component to build,
# either fftw or fftwf for double or single precision
+string(TOUPPER "${FFTW}" UPPERFFTW)
+string(TOLOWER "${FFTW}" LOWERFFTW)
+
set(GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION "" CACHE INTERNAL "Optimization flags for FFTW compilation")
if(${CMAKE_CURRENT_BINARY_DIR} MATCHES ".*[[:space:]].*")
message(FATAL_ERROR "An internal limitation of FFTW means GROMACS cannot build FFTW in a directory with whitespace in its name. Either use a system FFTW, build it yourself, or build GROMACS in a different location.")
# Testing shows FFTW configured with --enable-avx is never better than --enable-sse2, so we do the latter always.
if(${GMX_SIMD} MATCHES "^(SSE|AVX)")
set(GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION --enable-sse2 CACHE INTERNAL "Optimization flags for FFTW compilation")
+ # Fake the result of the SIMD test, so the checks for x86 SIMD
+ # suport are silent
+ set(${UPPERFFTW}_HAVE_SSE2 TRUE PARENT_SCOPE)
endif()
# Allow cross-compiles
ExternalProject_get_property(${EXTERNAL_FFTW_BUILD_TARGET} INSTALL_DIR)
-string(TOUPPER "${FFTW}" UPPERFFTW)
-string(TOLOWER "${FFTW}" LOWERFFTW)
string(REGEX REPLACE "fftw" "fftw3" FFTW_LIBNAME ${LOWERFFTW})
set(${UPPERFFTW}_LIBRARIES ${INSTALL_DIR}/lib/lib${FFTW_LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(${UPPERFFTW}_INCLUDE_DIRS ${INSTALL_DIR}/include PARENT_SCOPE)
set(${UPPERFFTW}_FOUND TRUE PARENT_SCOPE)
+# TODO This is only true on x86, but does not actually cause a problem
set(${UPPERFFTW}_HAVE_SIMD TRUE PARENT_SCOPE)
add_library(gmxfftw STATIC IMPORTED GLOBAL)
Steps to produce minimal version of BOOST:
1) Download Boost (current minimal version is derived from 1.55.0)
2) Extract
-3) Edit Boost files to uncomment unnessary includes (search for GMX in minimal version and copy all changes)
+3) Edit Boost files to uncomment unnessary includes and insert warning-suppression pragmas
+ (search for GMX in minimal version and copy all changes)
Alternative make a patch by diffing against unmodified version and applying patch. Such as
diff /path/to/boost_1_55_0 . -rwu |grep -v ^"Only in" > patch && patch -p? < patch
4) Make sure our subset works even with compilers not listed
# include <boost/utility/addressof.hpp>
#endif
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic pop
+#endif
+
#ifdef __BORLANDC__
# pragma warn .8027 // Functions containing try are not expanded inline
#endif
# include <memory> // for std::auto_ptr
#endif
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic pop
+#endif
+
#endif // #ifndef BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
#endif
#endif
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+//GMX_INSERTED
+#if (__GNUC__ >= 5)
+#pragma GCC diagnostic pop
+#endif
+
#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
#endif // #ifndef BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2013,2014,2015, 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.
# As stated in README.Gromacs, this file is not part of GMock, but is written
# specifically for the GROMACS build system from scratch.
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag("-Wno-unused-variable" HAS_NO_UNUSED_VARIABLE)
+
+# Avoid compiler warnings with GCC 5, which doesn't like the way
+# Google Test makes int variables that hold the results of
+# value-parameterized test registration calls, and then doesn't use
+# them. Because these definitions are created by the
+# test-instantiation macros, there's no good way to suppress them;
+# we'd prefer to avoid modifying Google Test source, and don't wish to
+# embed compiler-specific suppressions in all our test-code source
+# files.
+#
+# TODO When updating the embedded Google Test version in future, check
+# if this is still needed
+#
+# TODO If other compilers start complaining similarly, consider a
+# unilateral suppression, like we use for the Google Mock source code
+# itself.
+if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5")
+ if(HAS_NO_UNUSED_VARIABLE)
+ set(GMOCK_COMPILE_FLAGS "-Wno-unused-variable")
+ endif()
+endif()
+
include(gmxGetGmockTupleWorkaround)
get_gmock_tuple_workaround(GMOCK_COMPILE_DEFINITIONS)
include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
include_directories(BEFORE ${GMOCK_DIR})
-include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag(-Wno-unused-variable HAS_NO_UNUSED_VARIABLE)
if (HAS_NO_UNUSED_VARIABLE)
set_source_files_properties(${GTEST_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable")
endif()
add_library(gmock STATIC ${UNITTEST_TARGET_OPTIONS} ${GMOCK_SOURCES} ${GTEST_SOURCES})
set_property(TARGET gmock APPEND PROPERTY COMPILE_DEFINITIONS
"_GNU_SOURCE=1;${GMOCK_COMPILE_DEFINITIONS};GTEST_CAN_STREAM_RESULTS=0")
+set_property(TARGET gmock APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
set(GMOCK_LIBRARIES gmock ${PTHREADS_LIBRARIES} PARENT_SCOPE)
set(GTEST_LIBRARIES ${GMOCK_LIBRARIES} PARENT_SCOPE)
set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} PARENT_SCOPE)
set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
set(GMOCK_COMPILE_DEFINITIONS ${GMOCK_COMPILE_DEFINITIONS} PARENT_SCOPE)
+set(GMOCK_COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}" PARENT_SCOPE)
if (nframes-1 < ndim)
{
end = nframes-1;
- fprintf(out, "WARNING: there are fewer frames in your trajectory than there are\n");
- fprintf(out, "degrees of freedom in your system. Only generating the first\n");
- fprintf(out, "%d out of %d eigenvectors and eigenvalues.\n", end, (int)ndim);
+ fprintf(stderr, "\nWARNING: there are fewer frames in your trajectory than there are\n");
+ fprintf(stderr, "degrees of freedom in your system. Only generating the first\n");
+ fprintf(stderr, "%d out of %d eigenvectors and eigenvalues.\n", end, (int)ndim);
}
else
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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 i;
- state->natoms = natoms;
- state->flags = 0;
- state->lambda = 0;
+ state->natoms = natoms;
+ state->flags = 0;
+ state->fep_state = 0;
+ state->lambda = 0;
snew(state->lambda, efptNR);
for (i = 0; i < efptNR; i++)
{
t_inputrec *ir;
int natoms, nvsite, comb, mt;
t_params *plist;
- t_state state;
+ t_state *state;
matrix box;
real max_spacing, fudgeQQ;
double reppow;
{
gmx_fatal(FARGS, "%s does not exist", fn);
}
+ snew(state, 1);
new_status(fn, opt2fn_null("-pp", NFILE, fnm), opt2fn("-c", NFILE, fnm),
- opts, ir, bZero, bGenVel, bVerbose, &state,
+ opts, ir, bZero, bGenVel, bVerbose, state,
atype, sys, &nmi, &mi, plist, &comb, &reppow, &fudgeQQ,
opts->bMorse,
wi);
/* Check velocity for virtual sites and shells */
if (bGenVel)
{
- check_vel(sys, state.v);
+ check_vel(sys, state->v);
}
/* check for shells and inpurecs */
}
do_index(mdparin, ftp2fn_null(efNDX, NFILE, fnm),
sys, bVerbose, ir,
- bGenVel ? state.v : NULL,
+ bGenVel ? state->v : NULL,
wi);
if (ir->cutoff_scheme == ecutsVERLET && ir->verletbuf_tol > 0 &&
}
else
{
- buffer_temp = calc_temp(sys, ir, state.v);
+ buffer_temp = calc_temp(sys, ir, state->v);
}
if (buffer_temp > 0)
{
warning_note(wi, warn_buf);
}
- set_verlet_buffer(sys, ir, buffer_temp, state.box, wi);
+ set_verlet_buffer(sys, ir, buffer_temp, state->box, wi);
}
}
}
/* Init the temperature coupling state */
- init_gtc_state(&state, ir->opts.ngtc, 0, ir->opts.nhchainlength); /* need to add nnhpres here? */
+ init_gtc_state(state, ir->opts.ngtc, 0, ir->opts.nhchainlength); /* need to add nnhpres here? */
if (bVerbose)
{
fprintf(stderr, "getting data from old trajectory ...\n");
}
cont_status(ftp2fn(efTRN, NFILE, fnm), ftp2fn_null(efEDR, NFILE, fnm),
- bNeedVel, bGenVel, fr_time, ir, &state, sys, oenv);
+ bNeedVel, bGenVel, fr_time, ir, state, sys, oenv);
}
if (ir->ePBC == epbcXY && ir->nwall != 2)
{
- clear_rvec(state.box[ZZ]);
+ clear_rvec(state->box[ZZ]);
}
if (ir->cutoff_scheme != ecutsVERLET && ir->rlist > 0)
{
set_warning_line(wi, mdparin, -1);
- check_chargegroup_radii(sys, ir, state.x, wi);
+ check_chargegroup_radii(sys, ir, state->x, wi);
}
if (EEL_FULL(ir->coulombtype) || EVDW_PME(ir->vdwtype))
{
/* Calculate the optimal grid dimensions */
- copy_mat(state.box, box);
+ copy_mat(state->box, box);
if (ir->ePBC == epbcXY && ir->nwall == 2)
{
svmul(ir->wall_ewald_zfac, box[ZZ], box[ZZ]);
potentially conflict if not handled correctly. */
if (ir->efep != efepNO)
{
- state.fep_state = ir->fepvals->init_fep_state;
+ state->fep_state = ir->fepvals->init_fep_state;
for (i = 0; i < efptNR; i++)
{
/* init_lambda trumps state definitions*/
if (ir->fepvals->init_lambda >= 0)
{
- state.lambda[i] = ir->fepvals->init_lambda;
+ state->lambda[i] = ir->fepvals->init_lambda;
}
else
{
}
else
{
- state.lambda[i] = ir->fepvals->all_lambda[i][state.fep_state];
+ state->lambda[i] = ir->fepvals->all_lambda[i][state->fep_state];
}
}
}
if (ir->bPull)
{
- set_pull_init(ir, sys, state.x, state.box, state.lambda[efptMASS], oenv);
+ set_pull_init(ir, sys, state->x, state->box, state->lambda[efptMASS], oenv);
}
if (ir->bRot)
{
- set_reference_positions(ir->rot, state.x, state.box,
+ set_reference_positions(ir->rot, state->x, state->box,
opt2fn("-ref", NFILE, fnm), opt2bSet("-ref", NFILE, fnm),
wi);
}
if (EEL_PME(ir->coulombtype))
{
- float ratio = pme_load_estimate(sys, ir, state.box);
+ float ratio = pme_load_estimate(sys, ir, state->box);
fprintf(stderr, "Estimate for the relative computational load of the PME mesh part: %.2f\n", ratio);
/* With free energy we might need to do PME both for the A and B state
* charges. This will double the cost, but the optimal performance will
}
done_warning(wi, FARGS);
- write_tpx_state(ftp2fn(efTPR, NFILE, fnm), ir, &state, sys);
+ write_tpx_state(ftp2fn(efTPR, NFILE, fnm), ir, state, sys);
/* Output IMD group, if bIMD is TRUE */
- write_IMDgroup_to_file(ir->bIMD, ir, &state, sys, NFILE, fnm);
+ write_IMDgroup_to_file(ir->bIMD, ir, state, sys, NFILE, fnm);
+ done_state(state);
+ sfree(state);
done_atomtype(atype);
done_mtop(sys, TRUE);
done_inputrec_strings();
int max_grid_x_size;
assert(dinfo);
+ /* CUDA does not accept grid dimension of 0 (which can happen e.g. with an
+ empty domain) and that case should be handled before this point. */
+ assert(nwork_units > 0);
max_grid_x_size = dinfo->prop.maxGridSize[0];
we always call the local kernel, the local x+q copy and later (not in
this function) the stream wait, local f copyback and the f buffer
clearing. All these operations, except for the local interaction kernel,
- are needed for the non-local interactions. */
+ are needed for the non-local interactions. The skip of the local kernel
+ call is taken care of later in this function. */
if (iloc == eintNonlocal && plist->nsci == 0)
{
return;
CU_RET_ERR(stat, "cudaEventRecord failed");
}
+ if (plist->nsci == 0)
+ {
+ /* Don't launch an empty local kernel (not allowed with CUDA) */
+ return;
+ }
+
/* beginning of timed nonbonded calculation section */
if (bDoTime)
{
include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
add_library(${NAME} OBJECT ${UNITTEST_TARGET_OPTIONS} ${ARGN})
set_property(TARGET ${NAME} APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
+ set_property(TARGET ${NAME} APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
endif()
endfunction ()
include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS} ${ARGN} ${TESTUTILS_DIR}/unittest_main.cpp)
set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
+ set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
target_link_libraries(${EXENAME} ${TESTUTILS_LIBS} libgromacs ${GMOCK_LIBRARIES} ${GMX_EXE_LINKER_FLAGS})
file(RELATIVE_PATH _input_files_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(_temporary_files_path "${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary")
if(REGRESSIONTEST_DOWNLOAD)
if (NOT SOURCE_IS_SOURCE_DISTRIBUTION)
set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/${REGRESSIONTEST_BRANCH})
- set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests"
- CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+ # REGRESSIONTEST_PATH for dev trees is set later based on the dirname found in the tar
else()
set(REGRESSIONTEST_URL http://gerrit.gromacs.org/download/regressiontests-${REGRESSIONTEST_VERSION}.tar.gz)
set(REGRESSIONTEST_PATH
if(NOT ${REGRESSIONTEST_MD5SUM} STREQUAL ${COMPUTED_MD5SUM})
message(FATAL_ERROR "Download of regressiontests failed. Expected MD5 of ${REGRESSIONTEST_MD5SUM} but download has ${COMPUTED_MD5SUM}")
endif()
+ else()
+ # Extract the REGRESSIONTEST_PATH from the tar when using dev tree.
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar tf "${REGRESSIONTEST_FILE}"
+ RESULT_VARIABLE _tar_tf_res
+ OUTPUT_VARIABLE _tar_tf_out)
+ if (${_tar_tf_res} EQUAL 0)
+ string(REGEX REPLACE "/\n.*$" "" _regressiontest_dir "${_tar_tf_out}")
+ set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/${_regressiontest_dir}"
+ CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+ else()
+ message(FATAL_ERROR "Failed to list the contents of the downloaded tarball: ${REGRESSIONTEST_FILE}")
+ endif()
endif()
file(REMOVE_RECURSE "${REGRESSIONTEST_PATH}") #delete potential prior folder