Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unformatted (binary) checkpointing #558

Merged
merged 63 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
236550d
Simplify formatted state writing
giacomofiorin Aug 22, 2023
32f0dba
Remove trivial derivations of base-class functions
giacomofiorin Jul 20, 2023
6f8ea4f
Initial implementation of memory_stream class
giacomofiorin Jun 23, 2023
791b6eb
Add missing const accessors
giacomofiorin Jun 23, 2023
6a687bf
Abstract the stream operators for colvarvalue
giacomofiorin Jun 23, 2023
166df95
Formatting tweaks
giacomofiorin Jun 23, 2023
8435763
Add unit test for memory stream
giacomofiorin Jun 24, 2023
062d9d3
Work around incomplete C++11 compliance for old GCC
giacomofiorin Jun 25, 2023
f1109c6
Refine compiler selection to address overlap between Clang and GCC ma…
giacomofiorin Jul 21, 2023
132dc37
MSVC fixes
giacomofiorin Jun 25, 2023
b71a6b0
Add template specializations to ignore formatting operators
giacomofiorin Jul 19, 2023
76cd13c
Do not specify the starting point if not needed
giacomofiorin Jul 19, 2023
12ba148
Move specializations to source file
giacomofiorin Jul 19, 2023
f621ab1
Make memory_stream compatible with STL streams in templates
giacomofiorin Jul 19, 2023
36d1ba5
Unformatted I/O for colvar objects
giacomofiorin Jul 19, 2023
50bcdaa
Implement read_block() for unformatted input streams
giacomofiorin Jul 19, 2023
f5e9b5c
Separate checking the name of the colvar from reading its state data
giacomofiorin Jul 20, 2023
9665ed6
Unformatted I/O for grid objects
giacomofiorin Jul 20, 2023
5827f34
Remove duplicate specialization specific to Visual Studio and Sun com…
giacomofiorin Jul 21, 2023
046f081
Unformatted I/O for colvarbias base class
giacomofiorin Aug 21, 2023
8a974e8
Unformatted I/O for colvarbias_abf and colvarbias_histogram
giacomofiorin Aug 21, 2023
2a7f42f
More formatting functions being ignored
giacomofiorin Aug 21, 2023
54f2956
Unformatted I/O for colvarbias_ti
giacomofiorin Aug 21, 2023
2c78dbb
Remove obsolete code block
giacomofiorin Aug 21, 2023
f168c1a
Forward declare STL streams in colvargrid template
giacomofiorin Aug 21, 2023
04ffe29
Small fixes
giacomofiorin Aug 22, 2023
d8cbd75
Remove declarations of functions that were never defined
giacomofiorin Aug 23, 2023
81fb6b1
Simplify and improve error handling
giacomofiorin Aug 23, 2023
bf432f8
More forward declarations of STL streams
giacomofiorin Aug 23, 2023
c024e3a
Unformatted I/O for reweightAMD
giacomofiorin Aug 23, 2023
7c2ab17
Condense and simplify metadynamics state reading
giacomofiorin Aug 23, 2023
c30ebcf
Refactor formatted I/O for metadynamics before adding unformatted ver…
giacomofiorin Aug 24, 2023
03b5f54
Unformatted state I/O for metadynamics
giacomofiorin Aug 25, 2023
0623ed9
Ensure that a string object is written
giacomofiorin Aug 31, 2023
d8ccd02
Unformatted I/O for colvarmodule
giacomofiorin Aug 25, 2023
e2a1e94
Always allow seeking in a memory buffer
giacomofiorin Aug 31, 2023
839653c
Stop using preprocessor macros for return codes
giacomofiorin Aug 25, 2023
66461d2
Open text files in binary mode (we are not using EOL conversion anyway)
giacomofiorin Aug 26, 2023
4b49671
Remove check no longer needed after #537
giacomofiorin Sep 1, 2023
e00358f
Enable binary restarts from environment variable
giacomofiorin Sep 1, 2023
7540c29
Fix forgotten renaming of functions
giacomofiorin Sep 1, 2023
b02fae0
Remove non-essential debug call to avoid segfault
giacomofiorin Sep 1, 2023
8f47227
Embed unformatted state in LAMMPS restart file
giacomofiorin Sep 8, 2023
c7b8841
Remove now unneeded LAMMPS proxy wrappers
giacomofiorin Sep 8, 2023
ef623ad
Auto-detect unformatted vs. formatted input
giacomofiorin Sep 9, 2023
a136ade
Cosmetic changes
giacomofiorin Sep 9, 2023
c756a59
Add warning about mismatched binary state versions
giacomofiorin Sep 9, 2023
1f05c89
Ignore unformatted input state buffer (e.g. LAMMPS restart) if explic…
giacomofiorin Sep 9, 2023
8bda90f
Only write output state if the prefix is not null
giacomofiorin Sep 9, 2023
aebc3d2
Clarify that an empty output prefix is allowed in LAMMPS
giacomofiorin Sep 9, 2023
09ae9d9
Document binary vs. formatted state file format
giacomofiorin Sep 9, 2023
8f6e03c
Remove last instance of #include <iostream> in widely included header
giacomofiorin Sep 9, 2023
8445e01
Move include to where it is required
giacomofiorin Sep 9, 2023
45f38c2
More consistent naming of stream I/O template functions
giacomofiorin Sep 9, 2023
e06fd28
Silence redundant Clang analyzer warning
giacomofiorin Sep 15, 2023
5d06e56
Support external output buffer in memory_stream
giacomofiorin Sep 15, 2023
73b7e4b
Silence compiler warning
giacomofiorin Sep 15, 2023
3e18a93
Add wrapper code to serialize/deserialize to std::vector<unsigned char>
giacomofiorin Sep 15, 2023
233c0ee
Simplify test
jhenin Sep 21, 2023
c3058c9
Expand doc on binary restart
jhenin Sep 21, 2023
6bb2333
Further improve doc
giacomofiorin Sep 25, 2023
fe116a5
Fix incomplete sections
giacomofiorin Sep 25, 2023
c05cbd4
Mini-edit in doc
jhenin Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,12 @@ jobs:
name: failed-interface-test-diffs-${{ inputs.backend_name }}
path: ${{ inputs.test_interface_directory }}/*/*.diff

- name: Run regression tests for library code with ${{ inputs.backend_name }} (binary restarts)
if: ${{ inputs.test_lib_directory }}
shell: bash
working-directory: ${{ inputs.test_lib_directory }}
env:
COLVARS_BINARY_RESTART: 1
run: |
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }} 0??_*
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if(COLVARS_DEBUG)
endif()

option(ENABLE_COVERAGE "Enable code coverage reporting" ON)
if(ENABLE_COVERAGE AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "SunPro"))
if(ENABLE_COVERAGE AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
target_compile_options(colvars PUBLIC --coverage)
target_link_options(colvars PUBLIC --coverage)
endif()
Expand Down
1 change: 1 addition & 0 deletions colvartools/poisson_integrator.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <iostream>
#include <fstream>

#include "colvargrid.h"
Expand Down
123 changes: 83 additions & 40 deletions doc/colvars-refman-main.tex

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions gromacs/tests/library/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ for dir in ${DIRLIST} ; do
for f in AutoDiff/*
do
base=`basename $f`

if [ "${base%.state.stripped}" != "${base}" ] && [ -n "${COLVARS_BINARY_RESTART}" ] ; then
# Do not try comparing binary state files, they will never match anyway
continue
fi

if [ ! -f $base ] ; then
echo -e "\n*** File $(${TPUT_RED})$base$(${TPUT_CLEAR}) is missing. ***"
SUCCESS=0
Expand Down
7 changes: 4 additions & 3 deletions lammps/doc/src/fix_colvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ selection keywords in the Colvars configuration file or files. There is
no need to define multiple "fix colvars" instances and it is not
allowed.

The "output" keyword allows to specify the prefix of output files
generated by Colvars, for example "*output*.colvars.traj" or
"output.pmf".
The "output" keyword allows to specify the prefix of output files generated
by Colvars, for example "*output*.colvars.traj" or "output.pmf". Supplying
an empty string suppresses any file output from Colvars to file, except for
data saved into the LAMMPS :doc:`binary restart <restart>` files.

The "input" keyword allows to specify an optional state file that contains
the restart information needed to continue a previous simulation state.
Expand Down
1 change: 1 addition & 0 deletions lammps/lib/colvars/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ COLVARS_SRCS = \
colvarscript_commands.cpp \
colvarscript_commands_bias.cpp \
colvarscript_commands_colvar.cpp \
colvars_memstream.cpp \
colvartypes.cpp \
colvarvalue.cpp \
colvar_neuralnetworkcompute.cpp
Expand Down
294 changes: 162 additions & 132 deletions lammps/lib/colvars/Makefile.deps

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions lammps/src/COLVARS/colvarproxy_lammps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,6 @@ double colvarproxy_lammps::compute()
return bias_energy;
}

void colvarproxy_lammps::serialize_status(std::string &rst)
{
std::ostringstream os;
colvars->write_restart(os);
rst = os.str();
}

// set status from string
bool colvarproxy_lammps::deserialize_status(std::string &rst)
{
if (! colvarproxy_io::input_stream_from_string("input state string", rst)) {
return false;
} else {
return true;
}
}


cvm::rvector colvarproxy_lammps::position_distance(cvm::atom_pos const &pos1,
cvm::atom_pos const &pos2)
Expand Down
6 changes: 0 additions & 6 deletions lammps/src/COLVARS/colvarproxy_lammps.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ class colvarproxy_lammps : public colvarproxy {
// perform colvars computation. returns biasing energy
double compute();

// dump status to string
void serialize_status(std::string &);

// set status from string
bool deserialize_status(std::string &);

// Request to set the units used internally by Colvars
int set_unit_system(std::string const &units_in, bool check_only = false) override;

Expand Down
28 changes: 18 additions & 10 deletions lammps/src/COLVARS/fix_colvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
#include <iostream>
#include <vector>

#include "colvarproxy_lammps.h"
#include "colvarmodule.h"
#include "colvarproxy.h"
#include "colvarproxy_lammps.h"
#include "colvarscript.h"
#include "colvars_memstream.h"


/* struct for packed data communication of coordinates and forces. */
Expand Down Expand Up @@ -888,13 +890,17 @@ void FixColvars::end_of_step()
void FixColvars::write_restart(FILE *fp)
{
if (me == 0) {
std::string rest_text;
proxy->serialize_status(rest_text);
// TODO call write_output_files()
const char *cvm_state = rest_text.c_str();
int len = strlen(cvm_state) + 1; // need to include terminating null byte.
fwrite(&len,sizeof(int),1,fp);
fwrite(cvm_state,1,len,fp);
cvm::memory_stream ms;
if (proxy->colvars->write_state(ms)) {
int len_cv_state = ms.length();
// Will write the buffer's length twice, so that the fix can read it later, too
int len = len_cv_state + sizeof(int);
fwrite(&len, sizeof(int), 1, fp);
fwrite(&len, sizeof(int), 1, fp);
fwrite(ms.output_buffer(), 1, len_cv_state, fp);
} else {
error->all(FLERR, "Failed to write Colvars state to binary file");
}
}
}

Expand All @@ -903,8 +909,10 @@ void FixColvars::write_restart(FILE *fp)
void FixColvars::restart(char *buf)
{
if (me == 0) {
std::string rest_text(buf);
if (!proxy->deserialize_status(rest_text)) {
// Read the buffer's length, then load it into Colvars starting right past that location
int length = *(reinterpret_cast<int *>(buf));
unsigned char *colvars_state_buffer = reinterpret_cast<unsigned char *>(buf + sizeof(int));
if (proxy->colvars->set_input_state_buffer(length, colvars_state_buffer) != COLVARS_OK) {
error->all(FLERR, "Failed to set the Colvars input state from string buffer");
}
}
Expand Down
4 changes: 4 additions & 0 deletions lammps/tests/library/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ for dir in ${DIRLIST} ; do
for f in AutoDiff/*
do
base=`basename $f`
if [ "${base%.state.stripped}" != "${base}" ] && [ -n "${COLVARS_BINARY_RESTART}" ] ; then
# Do not try comparing binary state files, they will never match anyway
continue
fi
if [ "${base}" != "${base%.traj}" ] ; then
# System force is now total force
sed 's/fs_/ft_/g' < ${base} > ${TMPDIR}/${base}
Expand Down
2 changes: 2 additions & 0 deletions misc_interfaces/stubs/colvarproxy_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// If you wish to distribute your changes, please submit them to the
// Colvars repository at GitHub.

#include <iostream>

#include "colvarmodule.h"
#include "colvarscript.h"
#include "colvaratoms.h"
Expand Down
70 changes: 47 additions & 23 deletions namd/colvars/Make.depends
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,41 @@ obj/colvar.o: \
colvars/src/colvartypes.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h \
colvars/src/colvar.h \
colvars/src/colvardeps.h \
colvars/src/colvarcomp.h \
colvars/src/colvaratoms.h \
colvars/src/colvarproxy.h \
colvars/src/colvarproxy_io.h \
colvars/src/colvarproxy_system.h \
colvars/src/colvarproxy_tcl.h \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvardeps.h \
colvars/src/colvar.h \
colvars/src/colvar_arithmeticpath.h \
colvars/src/colvar_geometricpath.h \
colvars/src/colvarscript.h \
colvars/src/colvarbias.h \
colvars/src/colvarscript_commands.h \
colvars/src/colvarscript_commands_colvar.h \
colvars/src/colvarscript_commands_bias.h
colvars/src/colvarscript_commands_bias.h \
colvars/src/colvars_memstream.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvar.o $(COPTC) colvars/src/colvar.cpp
obj/colvaratoms.o: \
obj/.exists \
colvars/src/colvaratoms.cpp \
colvars/src/colvardeps.h \
colvars/src/colvarmodule.h \
colvars/src/colvars_version.h \
colvars/src/colvarproxy.h \
colvars/src/colvartypes.h \
colvars/src/colvarparse.h \
colvars/src/colvarvalue.h \
colvars/src/colvartypes.h \
colvars/src/colvarparams.h \
colvars/src/colvarproxy.h \
colvars/src/colvarproxy_io.h \
colvars/src/colvarproxy_system.h \
colvars/src/colvarproxy_tcl.h \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h \
colvars/src/colvaratoms.h \
colvars/src/colvardeps.h \
colvars/src/colvar_rotation_derivative.h
colvars/src/colvar_rotation_derivative.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvaratoms.o $(COPTC) colvars/src/colvaratoms.cpp
obj/colvarbias.o: \
obj/.exists \
Expand Down Expand Up @@ -87,10 +88,15 @@ obj/colvarbias_alb.o: \
colvars/src/colvarbias_alb.cpp \
colvars/src/colvarmodule.h \
colvars/src/colvars_version.h \
colvars/src/colvarproxy.h \
colvars/src/colvartypes.h \
colvars/src/colvarvalue.h \
colvars/src/colvarproxy_io.h \
colvars/src/colvarproxy_system.h \
colvars/src/colvarproxy_tcl.h \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvarbias.h \
colvars/src/colvar.h \
colvars/src/colvarvalue.h \
colvars/src/colvartypes.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h \
colvars/src/colvardeps.h \
Expand Down Expand Up @@ -301,7 +307,7 @@ obj/colvarcomp_distances.o: \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvar_arithmeticpath.h \
colvars/src/colvar_geometricpath.h \
colvars/src/colvar_rotation_derivative.h
colvars/src/colvar_rotation_derivative.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarcomp_distances.o $(COPTC) colvars/src/colvarcomp_distances.cpp
obj/colvarcomp_gpath.o: \
obj/.exists \
Expand Down Expand Up @@ -365,7 +371,7 @@ obj/colvarcomp_rotations.o: \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvar_arithmeticpath.h \
colvars/src/colvar_geometricpath.h \
colvars/src/colvar_rotation_derivative.h
colvars/src/colvar_rotation_derivative.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarcomp_rotations.o $(COPTC) colvars/src/colvarcomp_rotations.cpp
obj/colvarcomp_volmaps.o: \
obj/.exists \
Expand Down Expand Up @@ -394,18 +400,18 @@ obj/colvarcomp_combination.o: \
colvars/src/colvarcomp.h \
colvars/src/colvarmodule.h \
colvars/src/colvars_version.h \
colvars/src/colvar.h \
colvars/src/colvarvalue.h \
colvars/src/colvartypes.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h \
colvars/src/colvardeps.h \
colvars/src/colvaratoms.h \
colvars/src/colvarproxy.h \
colvars/src/colvartypes.h \
colvars/src/colvarvalue.h \
colvars/src/colvarproxy_io.h \
colvars/src/colvarproxy_system.h \
colvars/src/colvarproxy_tcl.h \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h \
colvars/src/colvardeps.h \
colvars/src/colvar.h \
colvars/src/colvar_arithmeticpath.h \
colvars/src/colvar_geometricpath.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarcomp_combination.o $(COPTC) colvars/src/colvarcomp_combination.cpp
Expand Down Expand Up @@ -538,7 +544,8 @@ obj/colvarparse.o: \
colvars/src/colvarvalue.h \
colvars/src/colvartypes.h \
colvars/src/colvarparse.h \
colvars/src/colvarparams.h
colvars/src/colvarparams.h \
colvars/src/colvars_memstream.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarparse.o $(COPTC) colvars/src/colvarparse.cpp
obj/colvarproxy.o: \
obj/.exists \
Expand Down Expand Up @@ -705,6 +712,15 @@ obj/colvarscript_commands_colvar.o: \
colvars/src/colvarscript_commands_colvar.h \
colvars/src/colvarscript_commands_bias.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarscript_commands_colvar.o $(COPTC) colvars/src/colvarscript_commands_colvar.cpp
obj/colvars_memstream.o: \
obj/.exists \
colvars/src/colvars_memstream.cpp \
colvars/src/colvarmodule.h \
colvars/src/colvars_version.h \
colvars/src/colvartypes.h \
colvars/src/colvarvalue.h \
colvars/src/colvars_memstream.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvars_memstream.o $(COPTC) colvars/src/colvars_memstream.cpp
obj/colvartypes.o: \
obj/.exists \
colvars/src/colvartypes.cpp \
Expand All @@ -714,16 +730,24 @@ obj/colvartypes.o: \
colvars/src/colvarparse.h \
colvars/src/colvarvalue.h \
colvars/src/colvarparams.h \
colvars/src/nr_jacobi.h \
colvars/src/colvar_rotation_derivative.h
colvars/src/colvaratoms.h \
colvars/src/colvarproxy.h \
colvars/src/colvarproxy_io.h \
colvars/src/colvarproxy_system.h \
colvars/src/colvarproxy_tcl.h \
colvars/src/colvarproxy_volmaps.h \
colvars/src/colvardeps.h \
colvars/src/colvar_rotation_derivative.h \
colvars/src/nr_jacobi.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvartypes.o $(COPTC) colvars/src/colvartypes.cpp
obj/colvarvalue.o: \
obj/.exists \
colvars/src/colvarvalue.cpp \
colvars/src/colvarmodule.h \
colvars/src/colvars_version.h \
colvars/src/colvarvalue.h \
colvars/src/colvartypes.h
colvars/src/colvartypes.h \
colvars/src/colvars_memstream.h
$(CXX) $(COLVARSCXXFLAGS) $(COPTO)obj/colvarvalue.o $(COPTC) colvars/src/colvarvalue.cpp
obj/nr_jacobi.o: \
obj/.exists \
Expand Down
1 change: 1 addition & 0 deletions namd/colvars/src/Makefile.namd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ COLVARSLIB = \
$(DSTDIR)/colvarscript_commands.o \
$(DSTDIR)/colvarscript_commands_bias.o \
$(DSTDIR)/colvarscript_commands_colvar.o \
$(DSTDIR)/colvars_memstream.o \
$(DSTDIR)/colvartypes.o \
$(DSTDIR)/colvarvalue.o \
$(DSTDIR)/nr_jacobi.o
Expand Down
2 changes: 1 addition & 1 deletion namd/src/colvarproxy_namd.C
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ std::ostream & colvarproxy_namd::output_stream(std::string const &output_name,

backup_file(output_name.c_str());

output_streams_[output_name] = new ofstream_namd(output_name.c_str());
output_streams_[output_name] = new ofstream_namd(output_name.c_str(), std::ios::binary);
if (! output_streams_[output_name]->good()) {
cvm::error("Error: cannot write to "+description+" \""+output_name+"\".\n",
COLVARS_FILE_ERROR);
Expand Down
17 changes: 12 additions & 5 deletions namd/tests/library/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,18 @@ for dir in ${DIRLIST} ; do
script=`basename ${script}`
basename=${script%.namd}

# Don't do multithreading for reinitatoms
NUM_THREADS_THIS=${NUM_THREADS}
if [ ${dir} == 003_reinitatoms ] ; then
NUM_THREADS_THIS=1
# If we are doing binary restarts, make an exception for tests that don't support it
if [ -n "${COLVARS_BINARY_RESTART}" ] ; then
if [ ${dir} == 004_10ala_moving_restart ] ; then
export COLVARS_BINARY_RESTART=0
else
export COLVARS_BINARY_RESTART=1
fi
fi

# Run the test (use a subshell to avoid cluttering stdout)
# Use multiple threads to test SMP code (TODO: move SMP tests to interface?)
NAMD_CUDASOA=$CUDASOA $BINARY +p ${NUM_THREADS_THIS} $script > ${basename}.out
NAMD_CUDASOA=$CUDASOA $BINARY +p ${NUM_THREADS} $script > ${basename}.out

# Output of Colvars module, minus the version numbers
grep "^colvars:" ${basename}.out | grep -v 'Initializing the collective variables module' \
Expand Down Expand Up @@ -227,6 +230,10 @@ for dir in ${DIRLIST} ; do
for f in AutoDiff/*
do
base=`basename $f`
if [ "${base%.state.stripped}" != "${base}" ] && [ -n "${COLVARS_BINARY_RESTART}" ] ; then
# Do not try comparing binary state files, they will never match anyway
continue
fi
if [ ! -f $base ] ; then
echo -e "\n*** File $(${TPUT_RED})$base$(${TPUT_CLEAR}) is missing. ***"
SUCCESS=0
Expand Down
3 changes: 3 additions & 0 deletions src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ ObjCBlockIndentWidth: 2
PenaltyBreakAssignment: 2
AccessModifierOffset: -2
BreakBeforeBraces: WebKit
EmptyLineAfterAccessModifier: Leave
NamespaceIndentation: None
MaxEmptyLinesToKeep: 2
...
Loading