diff --git a/regtest/basic/rt-cregex-backward-compatibility/Makefile b/regtest/basic/rt-cregex-backward-compatibility/Makefile new file mode 100644 index 0000000000..3703b27cea --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/basic/rt-cregex-backward-compatibility/config b/regtest/basic/rt-cregex-backward-compatibility/config new file mode 100644 index 0000000000..6db62fcce2 --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/config @@ -0,0 +1,3 @@ +type=plumed +#this just tests that config will always return cregex as existing, for backward compatibility +arg="config has cregex" diff --git a/regtest/basic/rt-cregex-backward-compatibility/out.reference b/regtest/basic/rt-cregex-backward-compatibility/out.reference new file mode 100644 index 0000000000..092a566f04 --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/out.reference @@ -0,0 +1 @@ +cregex on diff --git a/regtest/isdb/rt-Metainference-averaging/config b/regtest/isdb/rt-Metainference-averaging/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-Metainference-averaging/config +++ b/regtest/isdb/rt-Metainference-averaging/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-jcoupling-string-type/config b/regtest/isdb/rt-jcoupling-string-type/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-jcoupling-string-type/config +++ b/regtest/isdb/rt-jcoupling-string-type/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-mc-chunksize/config b/regtest/isdb/rt-metainference-mc-chunksize/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-mc-chunksize/config +++ b/regtest/isdb/rt-metainference-mc-chunksize/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-optisigmamean-sem-max/config b/regtest/isdb/rt-metainference-optisigmamean-sem-max/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-optisigmamean-sem-max/config +++ b/regtest/isdb/rt-metainference-optisigmamean-sem-max/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-optisigmamean-sem/config b/regtest/isdb/rt-metainference-optisigmamean-sem/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-optisigmamean-sem/config +++ b/regtest/isdb/rt-metainference-optisigmamean-sem/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-regres-zero/MISTATUSmij.reference b/regtest/isdb/rt-metainference-regres-zero/MISTATUSmij.reference index da32d314fa..96d284fc37 100644 --- a/regtest/isdb/rt-metainference-regres-zero/MISTATUSmij.reference +++ b/regtest/isdb/rt-metainference-regres-zero/MISTATUSmij.reference @@ -1,2 +1,2 @@ #! FIELDS time sigmaMean_0_0 sigma_0 sigma_max_0 scale0_ offset0_ weight_0 - 0 10 1 10 1.13019842568893 0 1 + 0.0000000 10.0000000 1.0000000 10.0000000 1.1301984 0.0000000 1.0000000 diff --git a/regtest/isdb/rt-metainference-regres-zero/config b/regtest/isdb/rt-metainference-regres-zero/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-regres-zero/config +++ b/regtest/isdb/rt-metainference-regres-zero/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-regres-zero/plumed.dat b/regtest/isdb/rt-metainference-regres-zero/plumed.dat index d7dfd57881..b0e9cf5b64 100644 --- a/regtest/isdb/rt-metainference-regres-zero/plumed.dat +++ b/regtest/isdb/rt-metainference-regres-zero/plumed.dat @@ -24,6 +24,7 @@ DSIGMA=0 LABEL=mij TEMP=300 REGRES_ZERO=1 +FMT=%12.7lf ... JCOUPLING ... @@ -43,6 +44,7 @@ JCOUPLING ... DSIGMA=0 TEMP=300 RESTART=YES + FMT=%12.7lf ... JCOUPLING BIASVALUE ARG=jmi.score diff --git a/regtest/isdb/rt-metainferencebase-averaging/config b/regtest/isdb/rt-metainferencebase-averaging/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainferencebase-averaging/config +++ b/regtest/isdb/rt-metainferencebase-averaging/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainferencebase-regres-zero/config b/regtest/isdb/rt-metainferencebase-regres-zero/config index dec4ec0c0d..147b050b4a 100644 --- a/regtest/isdb/rt-metainferencebase-regres-zero/config +++ b/regtest/isdb/rt-metainferencebase-regres-zero/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainferencebase-sem-max/config b/regtest/isdb/rt-metainferencebase-sem-max/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainferencebase-sem-max/config +++ b/regtest/isdb/rt-metainferencebase-sem-max/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/secondarystructure/rt-coverage-antibetarmsd/colvar.reference b/regtest/secondarystructure/rt-coverage-antibetarmsd/colvar.reference index 2e093c7e02..8224042792 100644 --- a/regtest/secondarystructure/rt-coverage-antibetarmsd/colvar.reference +++ b/regtest/secondarystructure/rt-coverage-antibetarmsd/colvar.reference @@ -1,4 +1,4 @@ -#! FIELDS time b.lessthan brf.lessthan br.lessthan p.lessthan prf.lessthan pr.lessthan sum +#! FIELDS time b_lessthan brf_lessthan br_lessthan p_lessthan prf_lessthan pr_lessthan sum 0.000000 0.0607 0.1654 0.1654 0.2681 0.1425 0.1425 0.3287 0.050000 0.0000 42.5600 42.5600 14.6579 4.1424 4.1424 14.6579 0.100000 0.0188 34.0262 34.0262 13.0049 3.2851 3.2851 13.0238 diff --git a/regtest/secondarystructure/rt-coverage-antibetarmsd/forces.reference b/regtest/secondarystructure/rt-coverage-antibetarmsd/forces.reference index cbb160398c..bbba83cdc7 100644 --- a/regtest/secondarystructure/rt-coverage-antibetarmsd/forces.reference +++ b/regtest/secondarystructure/rt-coverage-antibetarmsd/forces.reference @@ -1,7 +1,7 @@ -#! FIELDS time b.lessthan brf.lessthan br.lessthan p.lessthan prf.lessthan pr.lessthan sum @8.bias @8.force2 - 0.000000 -0.3893763023 -0.1653910914 -0.1653910914 -0.5967893540 -0.1425260828 -0.1425260828 -0.3287218854 0.0000000000 0.0000000000 - 0.050000 -14.6578542139 -42.5600014141 -42.5600014141 -29.3157084279 -4.1424316083 -4.1424316083 -14.6578542139 0.0000000000 0.0000000000 - 0.100000 -13.0426114706 -34.0261914601 -34.0261914601 -26.0287209912 -3.2850812434 -3.2850812434 -13.0237774873 0.0000000000 0.0000000000 - 0.150000 -16.2009073956 -47.7585572573 -47.7585572573 -32.4018147912 -4.3920871588 -4.3920871588 -16.2009073956 0.0000000000 0.0000000000 - 0.200000 -57.6661791916 -2.2688460225 -2.2688460225 -115.3323583831 -45.9215920978 -45.9215920978 -57.6661791916 0.0000000000 0.0000000000 - 0.250000 -100.7083276804 -4.8852734198 -4.8852734198 -201.4166553607 -83.4591661722 -83.4591661722 -100.7083276804 0.0000000000 0.0000000000 +#! FIELDS time b_lessthan brf_lessthan br_lessthan p_lessthan prf_lessthan pr_lessthan sum + 0.000000 -0.3893763023 -0.1653910914 -0.1653910914 -0.5967893540 -0.1425260828 -0.1425260828 -0.3287218854 + 0.050000 -14.6578542139 -42.5600014141 -42.5600014141 -29.3157084279 -4.1424316083 -4.1424316083 -14.6578542139 + 0.100000 -13.0426114706 -34.0261914601 -34.0261914601 -26.0287209912 -3.2850812434 -3.2850812434 -13.0237774873 + 0.150000 -16.2009073956 -47.7585572573 -47.7585572573 -32.4018147912 -4.3920871588 -4.3920871588 -16.2009073956 + 0.200000 -57.6661791916 -2.2688460225 -2.2688460225 -115.3323583831 -45.9215920978 -45.9215920978 -57.6661791916 + 0.250000 -100.7083276804 -4.8852734198 -4.8852734198 -201.4166553607 -83.4591661722 -83.4591661722 -100.7083276804 diff --git a/regtest/secondarystructure/rt-coverage-antibetarmsd/plumed.dat b/regtest/secondarystructure/rt-coverage-antibetarmsd/plumed.dat index 4fc2b04fd5..d546bcae36 100644 --- a/regtest/secondarystructure/rt-coverage-antibetarmsd/plumed.dat +++ b/regtest/secondarystructure/rt-coverage-antibetarmsd/plumed.dat @@ -9,7 +9,7 @@ COMBINE ARG=b.lessthan,p.lessthan PERIODIC=NO LABEL=sum RESTRAINT ARG=b.*,brf.*,br.*,p.*,prf.*,pr.*,sum KAPPA=1.,1.,1.,1,1,1,1 AT=0,0,0,0,0,0,0 SLOPE=0,0,0,0,0,0,0 -DUMPFORCES ARG=* FILE=forces STRIDE=1 +DUMPFORCES ARG=b.*,brf.*,br.*,p.*,prf.*,pr.*,sum FILE=forces STRIDE=1 PRINT ARG=b.*,brf.*,br.*,p.*,prf.*,pr.*,sum STRIDE=1 FILE=colvar FMT=%8.4f diff --git a/src/config/Config.h b/src/config/Config.h index 1604c5bab6..4f225200b9 100644 --- a/src/config/Config.h +++ b/src/config/Config.h @@ -99,7 +99,8 @@ bool hasDlopen(); bool isInstalled(); -bool hasCregex(); +/// This will always return true for backward compatibility +constexpr bool hasCregex() {return true;} bool hasMolfile(); diff --git a/src/config/Config.inc.in b/src/config/Config.inc.in index 39ff6f0989..cb821b217e 100644 --- a/src/config/Config.inc.in +++ b/src/config/Config.inc.in @@ -155,14 +155,6 @@ bool hasDlopen() { #endif } -bool hasCregex() { -#ifdef __PLUMED_HAS_CREGEX - return true; -#else - return false; -#endif -} - bool hasMolfile() { #ifdef __PLUMED_HAS_MOLFILE_PLUGINS return true; diff --git a/src/isdb/Metainference.cpp b/src/isdb/Metainference.cpp index 7ccd93b60f..961305a41c 100644 --- a/src/isdb/Metainference.cpp +++ b/src/isdb/Metainference.cpp @@ -318,6 +318,7 @@ void Metainference::registerKeywords(Keywords& keys) { keys.add("optional","MC_STEPS","number of MC steps"); keys.add("optional","MC_CHUNKSIZE","MC chunksize"); keys.add("optional","STATUS_FILE","write a file with all the data useful for restart/continuation of Metainference"); + keys.add("optional","FMT","specify format for HILLS files (useful for decrease the number of digits in regtests)"); keys.add("compulsory","WRITE_STRIDE","10000","write the status to a file every N steps, this can be used for restart/continuation"); keys.add("optional","SELECTOR","name of selector"); keys.add("optional","NSELECT","range of values for selector [0, N-1]"); @@ -590,6 +591,9 @@ Metainference::Metainference(const ActionOptions&ao): /* in this case Dsigma is initialised after reading the restart file if present */ } + std::string fmt_; + parse("FMT",fmt_); + // monte carlo stuff parse("MC_STEPS",MCsteps_); parse("MC_CHUNKSIZE", MCchunksize_); @@ -901,6 +905,7 @@ Metainference::Metainference(const ActionOptions&ao): if(write_stride_>0) { sfile_.link(*this); sfile_.open(status_file_name_); + if(fmt_.length()>0) sfile_.fmtField(fmt_); } log<<" Bibliography "<0&&doscore_) { sfile_.link(*this); sfile_.open(status_file_name_); + if(fmt_.length()>0) sfile_.fmtField(fmt_); } } diff --git a/src/isdb/MetainferenceBase.h b/src/isdb/MetainferenceBase.h index 6767d0b425..1e20d27c1f 100644 --- a/src/isdb/MetainferenceBase.h +++ b/src/isdb/MetainferenceBase.h @@ -124,6 +124,7 @@ class MetainferenceBase : // restart std::string status_file_name_; OFile sfile_; + std::string fmt_; // others bool firstTime; diff --git a/src/maketools/update-config-txt.sh b/src/maketools/update-config-txt.sh index 198750e188..a55a863a60 100755 --- a/src/maketools/update-config-txt.sh +++ b/src/maketools/update-config-txt.sh @@ -132,6 +132,8 @@ echo "# if option xx is on then plumed has beeen compiled with -D__PLUMED_HAS_XX echo "has $u off" fi done + #this is here for backward compatibility (since we are using c++17 that has ) + echo "has cregex on" } | sort echo echo "# other defines"