hillclimber 0.1.5a8__cp314-cp314-macosx_15_0_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hillclimber/__init__.py +39 -0
- hillclimber/actions.py +53 -0
- hillclimber/analysis.py +590 -0
- hillclimber/biases.py +293 -0
- hillclimber/calc.py +22 -0
- hillclimber/cvs.py +1065 -0
- hillclimber/interfaces.py +133 -0
- hillclimber/metadynamics.py +325 -0
- hillclimber/nodes.py +6 -0
- hillclimber/opes.py +359 -0
- hillclimber/selectors.py +230 -0
- hillclimber/virtual_atoms.py +341 -0
- hillclimber-0.1.5a8.dist-info/METADATA +209 -0
- hillclimber-0.1.5a8.dist-info/RECORD +469 -0
- hillclimber-0.1.5a8.dist-info/WHEEL +6 -0
- hillclimber-0.1.5a8.dist-info/entry_points.txt +8 -0
- hillclimber-0.1.5a8.dist-info/licenses/LICENSE +165 -0
- plumed/__init__.py +104 -0
- plumed/_lib/bin/plumed +0 -0
- plumed/_lib/bin/plumed-config +9 -0
- plumed/_lib/bin/plumed-patch +9 -0
- plumed/_lib/include/plumed/adjmat/AdjacencyMatrixBase.h +659 -0
- plumed/_lib/include/plumed/adjmat/ContactMatrix.h +59 -0
- plumed/_lib/include/plumed/asmjit/arch.h +228 -0
- plumed/_lib/include/plumed/asmjit/arm.h +43 -0
- plumed/_lib/include/plumed/asmjit/asmjit.h +69 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apibegin.h +143 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apiend.h +93 -0
- plumed/_lib/include/plumed/asmjit/asmjit_build.h +971 -0
- plumed/_lib/include/plumed/asmjit/assembler.h +183 -0
- plumed/_lib/include/plumed/asmjit/base.h +56 -0
- plumed/_lib/include/plumed/asmjit/codebuilder.h +944 -0
- plumed/_lib/include/plumed/asmjit/codecompiler.h +767 -0
- plumed/_lib/include/plumed/asmjit/codeemitter.h +528 -0
- plumed/_lib/include/plumed/asmjit/codeholder.h +777 -0
- plumed/_lib/include/plumed/asmjit/constpool.h +286 -0
- plumed/_lib/include/plumed/asmjit/cpuinfo.h +402 -0
- plumed/_lib/include/plumed/asmjit/func.h +1327 -0
- plumed/_lib/include/plumed/asmjit/globals.h +370 -0
- plumed/_lib/include/plumed/asmjit/inst.h +137 -0
- plumed/_lib/include/plumed/asmjit/logging.h +317 -0
- plumed/_lib/include/plumed/asmjit/misc_p.h +103 -0
- plumed/_lib/include/plumed/asmjit/moved_string.h +318 -0
- plumed/_lib/include/plumed/asmjit/operand.h +1599 -0
- plumed/_lib/include/plumed/asmjit/osutils.h +207 -0
- plumed/_lib/include/plumed/asmjit/regalloc_p.h +597 -0
- plumed/_lib/include/plumed/asmjit/runtime.h +227 -0
- plumed/_lib/include/plumed/asmjit/simdtypes.h +1104 -0
- plumed/_lib/include/plumed/asmjit/utils.h +1387 -0
- plumed/_lib/include/plumed/asmjit/vmem.h +183 -0
- plumed/_lib/include/plumed/asmjit/x86.h +45 -0
- plumed/_lib/include/plumed/asmjit/x86assembler.h +125 -0
- plumed/_lib/include/plumed/asmjit/x86builder.h +117 -0
- plumed/_lib/include/plumed/asmjit/x86compiler.h +322 -0
- plumed/_lib/include/plumed/asmjit/x86emitter.h +5149 -0
- plumed/_lib/include/plumed/asmjit/x86globals.h +535 -0
- plumed/_lib/include/plumed/asmjit/x86inst.h +2547 -0
- plumed/_lib/include/plumed/asmjit/x86instimpl_p.h +74 -0
- plumed/_lib/include/plumed/asmjit/x86internal_p.h +108 -0
- plumed/_lib/include/plumed/asmjit/x86logging_p.h +92 -0
- plumed/_lib/include/plumed/asmjit/x86misc.h +417 -0
- plumed/_lib/include/plumed/asmjit/x86operand.h +1133 -0
- plumed/_lib/include/plumed/asmjit/x86regalloc_p.h +734 -0
- plumed/_lib/include/plumed/asmjit/zone.h +1157 -0
- plumed/_lib/include/plumed/bias/Bias.h +82 -0
- plumed/_lib/include/plumed/bias/ReweightBase.h +58 -0
- plumed/_lib/include/plumed/blas/blas.h +253 -0
- plumed/_lib/include/plumed/blas/def_external.h +61 -0
- plumed/_lib/include/plumed/blas/def_internal.h +97 -0
- plumed/_lib/include/plumed/blas/real.h +49 -0
- plumed/_lib/include/plumed/cltools/CLTool.h +32 -0
- plumed/_lib/include/plumed/clusters/ClusteringBase.h +70 -0
- plumed/_lib/include/plumed/colvar/Colvar.h +32 -0
- plumed/_lib/include/plumed/colvar/ColvarInput.h +68 -0
- plumed/_lib/include/plumed/colvar/ColvarShortcut.h +81 -0
- plumed/_lib/include/plumed/colvar/CoordinationBase.h +52 -0
- plumed/_lib/include/plumed/colvar/MultiColvarTemplate.h +333 -0
- plumed/_lib/include/plumed/colvar/PathMSDBase.h +101 -0
- plumed/_lib/include/plumed/colvar/RMSDVector.h +78 -0
- plumed/_lib/include/plumed/config/Config.h +118 -0
- plumed/_lib/include/plumed/config/version.h +9 -0
- plumed/_lib/include/plumed/contour/ContourFindingObject.h +87 -0
- plumed/_lib/include/plumed/contour/DistanceFromContourBase.h +82 -0
- plumed/_lib/include/plumed/contour/FindContour.h +67 -0
- plumed/_lib/include/plumed/core/Action.h +540 -0
- plumed/_lib/include/plumed/core/ActionAnyorder.h +48 -0
- plumed/_lib/include/plumed/core/ActionAtomistic.h +343 -0
- plumed/_lib/include/plumed/core/ActionForInterface.h +99 -0
- plumed/_lib/include/plumed/core/ActionPilot.h +57 -0
- plumed/_lib/include/plumed/core/ActionRegister.h +124 -0
- plumed/_lib/include/plumed/core/ActionSet.h +163 -0
- plumed/_lib/include/plumed/core/ActionSetup.h +48 -0
- plumed/_lib/include/plumed/core/ActionShortcut.h +73 -0
- plumed/_lib/include/plumed/core/ActionToGetData.h +59 -0
- plumed/_lib/include/plumed/core/ActionToPutData.h +101 -0
- plumed/_lib/include/plumed/core/ActionWithArguments.h +140 -0
- plumed/_lib/include/plumed/core/ActionWithMatrix.h +87 -0
- plumed/_lib/include/plumed/core/ActionWithValue.h +258 -0
- plumed/_lib/include/plumed/core/ActionWithVector.h +94 -0
- plumed/_lib/include/plumed/core/ActionWithVirtualAtom.h +123 -0
- plumed/_lib/include/plumed/core/CLTool.h +177 -0
- plumed/_lib/include/plumed/core/CLToolMain.h +102 -0
- plumed/_lib/include/plumed/core/CLToolRegister.h +108 -0
- plumed/_lib/include/plumed/core/Colvar.h +115 -0
- plumed/_lib/include/plumed/core/DataPassingObject.h +94 -0
- plumed/_lib/include/plumed/core/DataPassingTools.h +54 -0
- plumed/_lib/include/plumed/core/DomainDecomposition.h +120 -0
- plumed/_lib/include/plumed/core/ExchangePatterns.h +47 -0
- plumed/_lib/include/plumed/core/FlexibleBin.h +63 -0
- plumed/_lib/include/plumed/core/GREX.h +61 -0
- plumed/_lib/include/plumed/core/GenericMolInfo.h +89 -0
- plumed/_lib/include/plumed/core/Group.h +41 -0
- plumed/_lib/include/plumed/core/ModuleMap.h +30 -0
- plumed/_lib/include/plumed/core/ParallelTaskManager.h +1023 -0
- plumed/_lib/include/plumed/core/PbcAction.h +61 -0
- plumed/_lib/include/plumed/core/PlumedMain.h +632 -0
- plumed/_lib/include/plumed/core/PlumedMainInitializer.h +118 -0
- plumed/_lib/include/plumed/core/RegisterBase.h +340 -0
- plumed/_lib/include/plumed/core/TargetDist.h +48 -0
- plumed/_lib/include/plumed/core/Value.h +547 -0
- plumed/_lib/include/plumed/core/WithCmd.h +93 -0
- plumed/_lib/include/plumed/dimred/SMACOF.h +55 -0
- plumed/_lib/include/plumed/drr/DRR.h +383 -0
- plumed/_lib/include/plumed/drr/colvar_UIestimator.h +777 -0
- plumed/_lib/include/plumed/fisst/legendre_rule_fast.h +44 -0
- plumed/_lib/include/plumed/function/Custom.h +54 -0
- plumed/_lib/include/plumed/function/Function.h +85 -0
- plumed/_lib/include/plumed/function/FunctionOfMatrix.h +368 -0
- plumed/_lib/include/plumed/function/FunctionOfScalar.h +135 -0
- plumed/_lib/include/plumed/function/FunctionOfVector.h +296 -0
- plumed/_lib/include/plumed/function/FunctionSetup.h +180 -0
- plumed/_lib/include/plumed/function/FunctionShortcut.h +130 -0
- plumed/_lib/include/plumed/function/FunctionWithSingleArgument.h +165 -0
- plumed/_lib/include/plumed/gridtools/ActionWithGrid.h +43 -0
- plumed/_lib/include/plumed/gridtools/EvaluateGridFunction.h +99 -0
- plumed/_lib/include/plumed/gridtools/FunctionOfGrid.h +295 -0
- plumed/_lib/include/plumed/gridtools/GridCoordinatesObject.h +179 -0
- plumed/_lib/include/plumed/gridtools/GridSearch.h +135 -0
- plumed/_lib/include/plumed/gridtools/Interpolator.h +45 -0
- plumed/_lib/include/plumed/gridtools/KDE.h +455 -0
- plumed/_lib/include/plumed/gridtools/RDF.h +40 -0
- plumed/_lib/include/plumed/gridtools/SumOfKernels.h +219 -0
- plumed/_lib/include/plumed/isdb/MetainferenceBase.h +398 -0
- plumed/_lib/include/plumed/lapack/def_external.h +207 -0
- plumed/_lib/include/plumed/lapack/def_internal.h +388 -0
- plumed/_lib/include/plumed/lapack/lapack.h +899 -0
- plumed/_lib/include/plumed/lapack/lapack_limits.h +79 -0
- plumed/_lib/include/plumed/lapack/real.h +50 -0
- plumed/_lib/include/plumed/lepton/CompiledExpression.h +164 -0
- plumed/_lib/include/plumed/lepton/CustomFunction.h +143 -0
- plumed/_lib/include/plumed/lepton/Exception.h +93 -0
- plumed/_lib/include/plumed/lepton/ExpressionProgram.h +137 -0
- plumed/_lib/include/plumed/lepton/ExpressionTreeNode.h +145 -0
- plumed/_lib/include/plumed/lepton/Lepton.h +85 -0
- plumed/_lib/include/plumed/lepton/MSVC_erfc.h +123 -0
- plumed/_lib/include/plumed/lepton/Operation.h +1302 -0
- plumed/_lib/include/plumed/lepton/ParsedExpression.h +165 -0
- plumed/_lib/include/plumed/lepton/Parser.h +111 -0
- plumed/_lib/include/plumed/lepton/windowsIncludes.h +73 -0
- plumed/_lib/include/plumed/mapping/Path.h +44 -0
- plumed/_lib/include/plumed/mapping/PathProjectionCalculator.h +57 -0
- plumed/_lib/include/plumed/matrixtools/MatrixOperationBase.h +54 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesMatrix.h +309 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesVectorBase.h +365 -0
- plumed/_lib/include/plumed/matrixtools/OuterProduct.h +238 -0
- plumed/_lib/include/plumed/maze/Core.h +65 -0
- plumed/_lib/include/plumed/maze/Loss.h +86 -0
- plumed/_lib/include/plumed/maze/Member.h +66 -0
- plumed/_lib/include/plumed/maze/Memetic.h +799 -0
- plumed/_lib/include/plumed/maze/Optimizer.h +357 -0
- plumed/_lib/include/plumed/maze/Random_MT.h +156 -0
- plumed/_lib/include/plumed/maze/Tools.h +183 -0
- plumed/_lib/include/plumed/metatomic/vesin.h +188 -0
- plumed/_lib/include/plumed/molfile/Gromacs.h +2013 -0
- plumed/_lib/include/plumed/molfile/endianswap.h +217 -0
- plumed/_lib/include/plumed/molfile/fastio.h +683 -0
- plumed/_lib/include/plumed/molfile/largefiles.h +78 -0
- plumed/_lib/include/plumed/molfile/libmolfile_plugin.h +77 -0
- plumed/_lib/include/plumed/molfile/molfile_plugin.h +1034 -0
- plumed/_lib/include/plumed/molfile/periodic_table.h +248 -0
- plumed/_lib/include/plumed/molfile/readpdb.h +447 -0
- plumed/_lib/include/plumed/molfile/vmdplugin.h +236 -0
- plumed/_lib/include/plumed/multicolvar/MultiColvarShortcuts.h +45 -0
- plumed/_lib/include/plumed/opes/ExpansionCVs.h +79 -0
- plumed/_lib/include/plumed/sasa/Sasa.h +32 -0
- plumed/_lib/include/plumed/secondarystructure/SecondaryStructureBase.h +372 -0
- plumed/_lib/include/plumed/setup/ActionSetup.h +25 -0
- plumed/_lib/include/plumed/small_vector/small_vector.h +6114 -0
- plumed/_lib/include/plumed/symfunc/CoordinationNumbers.h +41 -0
- plumed/_lib/include/plumed/tools/Angle.h +52 -0
- plumed/_lib/include/plumed/tools/AtomDistribution.h +138 -0
- plumed/_lib/include/plumed/tools/AtomNumber.h +152 -0
- plumed/_lib/include/plumed/tools/BiasRepresentation.h +106 -0
- plumed/_lib/include/plumed/tools/BitmaskEnum.h +167 -0
- plumed/_lib/include/plumed/tools/Brent1DRootSearch.h +159 -0
- plumed/_lib/include/plumed/tools/CheckInRange.h +44 -0
- plumed/_lib/include/plumed/tools/Citations.h +74 -0
- plumed/_lib/include/plumed/tools/ColvarOutput.h +118 -0
- plumed/_lib/include/plumed/tools/Communicator.h +316 -0
- plumed/_lib/include/plumed/tools/ConjugateGradient.h +80 -0
- plumed/_lib/include/plumed/tools/DLLoader.h +79 -0
- plumed/_lib/include/plumed/tools/ERMSD.h +73 -0
- plumed/_lib/include/plumed/tools/Exception.h +406 -0
- plumed/_lib/include/plumed/tools/File.h +28 -0
- plumed/_lib/include/plumed/tools/FileBase.h +153 -0
- plumed/_lib/include/plumed/tools/FileTools.h +37 -0
- plumed/_lib/include/plumed/tools/ForwardDecl.h +54 -0
- plumed/_lib/include/plumed/tools/Grid.h +638 -0
- plumed/_lib/include/plumed/tools/HistogramBead.h +136 -0
- plumed/_lib/include/plumed/tools/IFile.h +117 -0
- plumed/_lib/include/plumed/tools/KernelFunctions.h +113 -0
- plumed/_lib/include/plumed/tools/Keywords.h +380 -0
- plumed/_lib/include/plumed/tools/LatticeReduction.h +66 -0
- plumed/_lib/include/plumed/tools/LeptonCall.h +64 -0
- plumed/_lib/include/plumed/tools/LinkCells.h +126 -0
- plumed/_lib/include/plumed/tools/Log.h +41 -0
- plumed/_lib/include/plumed/tools/LoopUnroller.h +163 -0
- plumed/_lib/include/plumed/tools/Matrix.h +721 -0
- plumed/_lib/include/plumed/tools/MatrixSquareBracketsAccess.h +138 -0
- plumed/_lib/include/plumed/tools/MergeVectorTools.h +153 -0
- plumed/_lib/include/plumed/tools/Minimise1DBrent.h +244 -0
- plumed/_lib/include/plumed/tools/MinimiseBase.h +120 -0
- plumed/_lib/include/plumed/tools/MolDataClass.h +51 -0
- plumed/_lib/include/plumed/tools/NeighborList.h +112 -0
- plumed/_lib/include/plumed/tools/OFile.h +286 -0
- plumed/_lib/include/plumed/tools/OpenACC.h +180 -0
- plumed/_lib/include/plumed/tools/OpenMP.h +75 -0
- plumed/_lib/include/plumed/tools/PDB.h +154 -0
- plumed/_lib/include/plumed/tools/Pbc.h +139 -0
- plumed/_lib/include/plumed/tools/PlumedHandle.h +105 -0
- plumed/_lib/include/plumed/tools/RMSD.h +493 -0
- plumed/_lib/include/plumed/tools/Random.h +80 -0
- plumed/_lib/include/plumed/tools/RootFindingBase.h +79 -0
- plumed/_lib/include/plumed/tools/Stopwatch.h +475 -0
- plumed/_lib/include/plumed/tools/Subprocess.h +142 -0
- plumed/_lib/include/plumed/tools/SwitchingFunction.h +208 -0
- plumed/_lib/include/plumed/tools/Tensor.h +724 -0
- plumed/_lib/include/plumed/tools/TokenizedLine.h +123 -0
- plumed/_lib/include/plumed/tools/Tools.h +638 -0
- plumed/_lib/include/plumed/tools/Torsion.h +55 -0
- plumed/_lib/include/plumed/tools/TrajectoryParser.h +118 -0
- plumed/_lib/include/plumed/tools/Tree.h +61 -0
- plumed/_lib/include/plumed/tools/TypesafePtr.h +463 -0
- plumed/_lib/include/plumed/tools/Units.h +167 -0
- plumed/_lib/include/plumed/tools/Vector.h +433 -0
- plumed/_lib/include/plumed/tools/View.h +296 -0
- plumed/_lib/include/plumed/tools/View2D.h +100 -0
- plumed/_lib/include/plumed/tools/h36.h +39 -0
- plumed/_lib/include/plumed/vatom/ActionWithVirtualAtom.h +32 -0
- plumed/_lib/include/plumed/ves/BasisFunctions.h +380 -0
- plumed/_lib/include/plumed/ves/CoeffsBase.h +310 -0
- plumed/_lib/include/plumed/ves/CoeffsMatrix.h +220 -0
- plumed/_lib/include/plumed/ves/CoeffsVector.h +251 -0
- plumed/_lib/include/plumed/ves/FermiSwitchingFunction.h +74 -0
- plumed/_lib/include/plumed/ves/GridIntegrationWeights.h +50 -0
- plumed/_lib/include/plumed/ves/GridLinearInterpolation.h +81 -0
- plumed/_lib/include/plumed/ves/GridProjWeights.h +61 -0
- plumed/_lib/include/plumed/ves/LinearBasisSetExpansion.h +303 -0
- plumed/_lib/include/plumed/ves/Optimizer.h +444 -0
- plumed/_lib/include/plumed/ves/TargetDistModifer.h +53 -0
- plumed/_lib/include/plumed/ves/TargetDistribution.h +266 -0
- plumed/_lib/include/plumed/ves/VesBias.h +545 -0
- plumed/_lib/include/plumed/ves/VesTools.h +142 -0
- plumed/_lib/include/plumed/ves/WaveletGrid.h +75 -0
- plumed/_lib/include/plumed/volumes/ActionVolume.h +268 -0
- plumed/_lib/include/plumed/volumes/VolumeShortcut.h +147 -0
- plumed/_lib/include/plumed/wrapper/Plumed.h +5025 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile.h +663 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_trr.h +89 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_xtc.h +90 -0
- plumed/_lib/lib/PythonCVInterface.dylib +0 -0
- plumed/_lib/lib/libplumed.dylib +0 -0
- plumed/_lib/lib/libplumedKernel.dylib +0 -0
- plumed/_lib/lib/libplumedWrapper.a +0 -0
- plumed/_lib/lib/pkgconfig/plumed.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedInternals.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedWrapper.pc +13 -0
- plumed/_lib/lib/plumed/fortran/plumed.f90 +879 -0
- plumed/_lib/lib/plumed/fortran/plumed_f08.f90 +2625 -0
- plumed/_lib/lib/plumed/modulefile +69 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt +543 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt.preplumed +540 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp +1628 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1590 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h +103 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp +2527 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +408 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +394 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp +2348 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2091 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp +3573 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3495 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1506 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1402 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp +997 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +906 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp +2780 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2738 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt +549 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt.preplumed +546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp +2624 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2610 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +395 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp +2419 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2164 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp +3546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3468 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp +991 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +900 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp +2895 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2849 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp +886 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +880 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +347 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +345 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt +575 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt.preplumed +572 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp +2564 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2550 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h +410 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +396 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp +2435 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp.preplumed +2187 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp +3592 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3514 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp +958 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp.preplumed +929 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp +2987 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp.preplumed +2941 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp +904 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +898 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +353 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +351 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.config +39 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake.preplumed +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp +162 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp.preplumed +154 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp +107 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h +120 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h.preplumed +111 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp +215 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp.preplumed +197 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h +87 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h.preplumed +86 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp +2971 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp.preplumed +2970 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h +430 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h.preplumed +429 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.diff +268 -0
- plumed/_lib/lib/plumed/patches/patch.sh +500 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.config +25 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90 +368 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90.preplumed +366 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90 +71 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90.preplumed +24 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90 +189 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90.preplumed +185 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.config +26 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90 +422 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90.preplumed +420 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90 +70 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90 +233 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90.preplumed +230 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile +175 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile.preplumed +171 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90 +486 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90.preplumed +484 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90.preplumed +518 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile +249 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile.preplumed +244 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90.preplumed +535 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90 +569 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90.preplumed +560 -0
- plumed/_lib/lib/plumed/plumed-config +9 -0
- plumed/_lib/lib/plumed/plumed-mklib +9 -0
- plumed/_lib/lib/plumed/plumed-newcv +9 -0
- plumed/_lib/lib/plumed/plumed-partial_tempering +9 -0
- plumed/_lib/lib/plumed/plumed-patch +9 -0
- plumed/_lib/lib/plumed/plumed-runtime +0 -0
- plumed/_lib/lib/plumed/plumed-selector +9 -0
- plumed/_lib/lib/plumed/plumed-vim2html +9 -0
- plumed/_lib/lib/plumed/scripts/config.sh +126 -0
- plumed/_lib/lib/plumed/scripts/mklib.sh +175 -0
- plumed/_lib/lib/plumed/scripts/newcv.sh +26 -0
- plumed/_lib/lib/plumed/scripts/partial_tempering.sh +319 -0
- plumed/_lib/lib/plumed/scripts/patch.sh +4 -0
- plumed/_lib/lib/plumed/scripts/selector.sh +234 -0
- plumed/_lib/lib/plumed/scripts/vim2html.sh +190 -0
- plumed/_lib/lib/plumed/src/colvar/Template.cpp +116 -0
- plumed/_lib/lib/plumed/src/config/compile_options.sh +3 -0
- plumed/_lib/lib/plumed/src/config/config.txt +181 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.static +3 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.static +3 -0
- plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
- plumed/_plumed_core.cpython-311-darwin.so +0 -0
- plumed/_plumed_core.cpython-312-darwin.so +0 -0
- plumed/_plumed_core.cpython-313-darwin.so +0 -0
- plumed/_plumed_core.cpython-314-darwin.so +0 -0
- plumedCommunications.cpython-311-darwin.so +0 -0
- plumedCommunications.cpython-312-darwin.so +0 -0
- plumedCommunications.cpython-313-darwin.so +0 -0
- plumedCommunications.cpython-314-darwin.so +0 -0
- plumedCommunications.pyi +431 -0
plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed
ADDED
|
@@ -0,0 +1,1402 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the GROMACS molecular simulation package.
|
|
3
|
+
*
|
|
4
|
+
* Copyright 1991- The GROMACS Authors
|
|
5
|
+
* and the project initiators Erik Lindahl, Berk Hess and David van der Spoel.
|
|
6
|
+
* Consult the AUTHORS/COPYING files and https://www.gromacs.org for details.
|
|
7
|
+
*
|
|
8
|
+
* GROMACS is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public License
|
|
10
|
+
* as published by the Free Software Foundation; either version 2.1
|
|
11
|
+
* of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* GROMACS is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with GROMACS; if not, see
|
|
20
|
+
* https://www.gnu.org/licenses, or write to the Free Software Foundation,
|
|
21
|
+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
22
|
+
*
|
|
23
|
+
* If you want to redistribute modifications to GROMACS, please
|
|
24
|
+
* consider that scientific software is very special. Version
|
|
25
|
+
* control is crucial - bugs must be traceable. We will be happy to
|
|
26
|
+
* consider code for inclusion in the official distribution, but
|
|
27
|
+
* derived work must not be called official GROMACS. Details are found
|
|
28
|
+
* in the README & COPYING files - if they are missing, get the
|
|
29
|
+
* official version at https://www.gromacs.org.
|
|
30
|
+
*
|
|
31
|
+
* To help us fund GROMACS development, we humbly ask that you cite
|
|
32
|
+
* the research papers on the package. Check out https://www.gromacs.org.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/*! \internal \file
|
|
36
|
+
*
|
|
37
|
+
* \brief Implements the replica exchange routines.
|
|
38
|
+
*
|
|
39
|
+
* \author David van der Spoel <david.vanderspoel@icm.uu.se>
|
|
40
|
+
* \author Mark Abraham <mark.j.abraham@gmail.com>
|
|
41
|
+
* \ingroup module_mdrun
|
|
42
|
+
*/
|
|
43
|
+
#include "gmxpre.h"
|
|
44
|
+
|
|
45
|
+
#include "gromacs/utility/enumerationhelpers.h"
|
|
46
|
+
#include "replicaexchange.h"
|
|
47
|
+
|
|
48
|
+
#include "config.h"
|
|
49
|
+
|
|
50
|
+
#include <cmath>
|
|
51
|
+
|
|
52
|
+
#include <random>
|
|
53
|
+
|
|
54
|
+
#include "gromacs/domdec/collect.h"
|
|
55
|
+
#include "gromacs/gmxlib/network.h"
|
|
56
|
+
#include "gromacs/math/units.h"
|
|
57
|
+
#include "gromacs/math/vec.h"
|
|
58
|
+
#include "gromacs/mdrunutility/multisim.h"
|
|
59
|
+
#include "gromacs/mdtypes/commrec.h"
|
|
60
|
+
#include "gromacs/mdtypes/enerdata.h"
|
|
61
|
+
#include "gromacs/mdtypes/inputrec.h"
|
|
62
|
+
#include "gromacs/mdtypes/md_enums.h"
|
|
63
|
+
#include "gromacs/mdtypes/state.h"
|
|
64
|
+
#include "gromacs/random/threefry.h"
|
|
65
|
+
#include "gromacs/random/uniformintdistribution.h"
|
|
66
|
+
#include "gromacs/random/uniformrealdistribution.h"
|
|
67
|
+
#include "gromacs/utility/enumerationhelpers.h"
|
|
68
|
+
#include "gromacs/utility/fatalerror.h"
|
|
69
|
+
#include "gromacs/utility/pleasecite.h"
|
|
70
|
+
#include "gromacs/utility/smalloc.h"
|
|
71
|
+
|
|
72
|
+
//! Helps cut off probability values.
|
|
73
|
+
constexpr int c_probabilityCutoff = 100;
|
|
74
|
+
|
|
75
|
+
/* we don't bother evaluating if events are more rare than exp(-100) = 3.7x10^-44 */
|
|
76
|
+
|
|
77
|
+
//! Rank in the multisimulation
|
|
78
|
+
#define MSRANK(ms, nodeid) (nodeid)
|
|
79
|
+
|
|
80
|
+
//! Enum for replica exchange flavours
|
|
81
|
+
enum class ReplicaExchangeType : int
|
|
82
|
+
{
|
|
83
|
+
Temperature,
|
|
84
|
+
Lambda,
|
|
85
|
+
EndSingle,
|
|
86
|
+
TemperatureLambda,
|
|
87
|
+
Count
|
|
88
|
+
};
|
|
89
|
+
/*! \brief Strings describing replica exchange flavours.
|
|
90
|
+
*
|
|
91
|
+
* end_single_marker merely notes the end of single variable replica
|
|
92
|
+
* exchange. All types higher than it are multiple replica exchange
|
|
93
|
+
* methods.
|
|
94
|
+
*
|
|
95
|
+
* Eventually, should add 'pressure', 'temperature and pressure',
|
|
96
|
+
* 'lambda_and_pressure', 'temperature_lambda_pressure'?; Let's wait
|
|
97
|
+
* until we feel better about the pressure control methods giving
|
|
98
|
+
* exact ensembles. Right now, we assume constant pressure */
|
|
99
|
+
static const char* enumValueToString(ReplicaExchangeType enumValue)
|
|
100
|
+
{
|
|
101
|
+
constexpr gmx::EnumerationArray<ReplicaExchangeType, const char*> replicateExchangeTypeNames = {
|
|
102
|
+
"temperature", "lambda", "end_single_marker", "temperature and lambda"
|
|
103
|
+
};
|
|
104
|
+
return replicateExchangeTypeNames[enumValue];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//! Working data for replica exchange.
|
|
108
|
+
struct gmx_repl_ex
|
|
109
|
+
{
|
|
110
|
+
//! Replica ID
|
|
111
|
+
int repl;
|
|
112
|
+
//! Total number of replica
|
|
113
|
+
int nrepl;
|
|
114
|
+
//! Temperature
|
|
115
|
+
real temp;
|
|
116
|
+
//! Replica exchange type from ReplicaExchangeType enum
|
|
117
|
+
ReplicaExchangeType type;
|
|
118
|
+
//! Quantity, e.g. temperature or lambda; first index is ere, second index is replica ID
|
|
119
|
+
gmx::EnumerationArray<ReplicaExchangeType, real*> q;
|
|
120
|
+
//! Use constant pressure and temperature
|
|
121
|
+
gmx_bool bNPT;
|
|
122
|
+
//! Replica pressures
|
|
123
|
+
real* pres;
|
|
124
|
+
//! Replica indices
|
|
125
|
+
int* ind;
|
|
126
|
+
//! Used for keeping track of all the replica swaps
|
|
127
|
+
int* allswaps;
|
|
128
|
+
//! Replica exchange interval (number of steps)
|
|
129
|
+
int nst;
|
|
130
|
+
//! Number of exchanges per interval
|
|
131
|
+
int nex;
|
|
132
|
+
//! Random seed
|
|
133
|
+
int seed;
|
|
134
|
+
//! Number of even and odd replica change attempts
|
|
135
|
+
int nattempt[2];
|
|
136
|
+
//! Sum of probabilities
|
|
137
|
+
real* prob_sum;
|
|
138
|
+
//! Number of moves between replicas i and j
|
|
139
|
+
int** nmoves;
|
|
140
|
+
//! i-th element of the array is the number of exchanges between replica i-1 and i
|
|
141
|
+
int* nexchange;
|
|
142
|
+
|
|
143
|
+
/*! \brief Helper arrays for replica exchange; allocated here
|
|
144
|
+
* so they don't have to be allocated each time */
|
|
145
|
+
//! \{
|
|
146
|
+
int* destinations;
|
|
147
|
+
int** cyclic;
|
|
148
|
+
int** order;
|
|
149
|
+
int* tmpswap;
|
|
150
|
+
gmx_bool* incycle;
|
|
151
|
+
gmx_bool* bEx;
|
|
152
|
+
//! \}
|
|
153
|
+
|
|
154
|
+
//! Helper arrays to hold the quantities that are exchanged.
|
|
155
|
+
//! \{
|
|
156
|
+
real* prob;
|
|
157
|
+
real* Epot;
|
|
158
|
+
real* beta;
|
|
159
|
+
real* Vol;
|
|
160
|
+
real** de;
|
|
161
|
+
//! \}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// TODO We should add Doxygen here some time.
|
|
165
|
+
//! \cond
|
|
166
|
+
|
|
167
|
+
static gmx_bool repl_quantity(const gmx_multisim_t* ms, struct gmx_repl_ex* re, ReplicaExchangeType ere, real q)
|
|
168
|
+
{
|
|
169
|
+
real* qall;
|
|
170
|
+
gmx_bool bDiff;
|
|
171
|
+
int s;
|
|
172
|
+
|
|
173
|
+
snew(qall, ms->numSimulations_);
|
|
174
|
+
qall[re->repl] = q;
|
|
175
|
+
gmx_sum_sim(ms->numSimulations_, qall, ms);
|
|
176
|
+
|
|
177
|
+
bDiff = FALSE;
|
|
178
|
+
for (s = 1; s < ms->numSimulations_; s++)
|
|
179
|
+
{
|
|
180
|
+
if (fabs(qall[s] - qall[0]) > 1e-5) /* Each quantity normally has 2-4 significant digits */
|
|
181
|
+
{
|
|
182
|
+
bDiff = TRUE;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (bDiff)
|
|
187
|
+
{
|
|
188
|
+
/* Set the replica exchange type and quantities */
|
|
189
|
+
re->type = ere;
|
|
190
|
+
|
|
191
|
+
snew(re->q[ere], re->nrepl);
|
|
192
|
+
for (s = 0; s < ms->numSimulations_; s++)
|
|
193
|
+
{
|
|
194
|
+
re->q[ere][s] = qall[s];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
sfree(qall);
|
|
198
|
+
return bDiff;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
gmx_repl_ex_t init_replica_exchange(FILE* fplog,
|
|
202
|
+
const gmx_multisim_t* ms,
|
|
203
|
+
int numAtomsInSystem,
|
|
204
|
+
const t_inputrec* ir,
|
|
205
|
+
const ReplicaExchangeParameters& replExParams)
|
|
206
|
+
{
|
|
207
|
+
real pres;
|
|
208
|
+
int i, j;
|
|
209
|
+
struct gmx_repl_ex* re;
|
|
210
|
+
gmx_bool bTemp;
|
|
211
|
+
gmx_bool bLambda = FALSE;
|
|
212
|
+
|
|
213
|
+
fprintf(fplog, "\nInitializing Replica Exchange\n");
|
|
214
|
+
|
|
215
|
+
if (!isMultiSim(ms) || ms->numSimulations_ == 1)
|
|
216
|
+
{
|
|
217
|
+
gmx_fatal(FARGS,
|
|
218
|
+
"Nothing to exchange with only one replica, maybe you forgot to set the "
|
|
219
|
+
"-multidir option of mdrun?");
|
|
220
|
+
}
|
|
221
|
+
if (replExParams.numExchanges < 0)
|
|
222
|
+
{
|
|
223
|
+
gmx_fatal(FARGS, "Replica exchange number of exchanges needs to be positive");
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!EI_DYNAMICS(ir->eI))
|
|
227
|
+
{
|
|
228
|
+
gmx_fatal(FARGS, "Replica exchange is only supported by dynamical simulations");
|
|
229
|
+
/* Note that PAR(cr) is defined by cr->nnodes > 1, which is
|
|
230
|
+
* distinct from isMultiSim(ms). A multi-simulation only runs
|
|
231
|
+
* with real MPI parallelism, but this does not imply PAR(cr)
|
|
232
|
+
* is true!
|
|
233
|
+
*
|
|
234
|
+
* Since we are using a dynamical integrator, the only
|
|
235
|
+
* decomposition is DD, so PAR(cr) and haveDDAtomOrdering(*cr) are
|
|
236
|
+
* synonymous. The only way for cr->nnodes > 1 to be true is
|
|
237
|
+
* if we are using DD. */
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
snew(re, 1);
|
|
241
|
+
|
|
242
|
+
re->repl = ms->simulationIndex_;
|
|
243
|
+
re->nrepl = ms->numSimulations_;
|
|
244
|
+
|
|
245
|
+
fprintf(fplog, "Repl There are %d replicas:\n", re->nrepl);
|
|
246
|
+
|
|
247
|
+
/* We only check that the number of atoms in the systms match.
|
|
248
|
+
* This, of course, do not guarantee that the systems are the same,
|
|
249
|
+
* but it does guarantee that we can perform replica exchange.
|
|
250
|
+
*/
|
|
251
|
+
check_multi_int(fplog, ms, numAtomsInSystem, "the number of atoms", FALSE);
|
|
252
|
+
check_multi_int(fplog, ms, static_cast<int>(ir->eI), "the integrator", FALSE);
|
|
253
|
+
check_multi_int64(fplog, ms, ir->init_step + ir->nsteps, "init_step+nsteps", FALSE);
|
|
254
|
+
const int nst = replExParams.exchangeInterval;
|
|
255
|
+
check_multi_int64(
|
|
256
|
+
fplog, ms, (ir->init_step + nst - 1) / nst, "first exchange step: init_step/-replex", FALSE);
|
|
257
|
+
check_multi_int(fplog, ms, static_cast<int>(ir->etc), "the temperature coupling", FALSE);
|
|
258
|
+
check_multi_int(fplog, ms, ir->opts.ngtc, "the number of temperature coupling groups", FALSE);
|
|
259
|
+
check_multi_int(fplog, ms, static_cast<int>(ir->epc), "the pressure coupling", FALSE);
|
|
260
|
+
check_multi_int(fplog, ms, static_cast<int>(ir->efep), "free energy", FALSE);
|
|
261
|
+
check_multi_int(fplog, ms, ir->fepvals->n_lambda, "number of lambda states", FALSE);
|
|
262
|
+
|
|
263
|
+
re->temp = ir->opts.ref_t[0];
|
|
264
|
+
for (i = 1; (i < ir->opts.ngtc); i++)
|
|
265
|
+
{
|
|
266
|
+
if (ir->opts.ref_t[i] != re->temp)
|
|
267
|
+
{
|
|
268
|
+
fprintf(fplog,
|
|
269
|
+
"\nWARNING: The temperatures of the different temperature coupling groups are "
|
|
270
|
+
"not identical\n\n");
|
|
271
|
+
fprintf(stderr,
|
|
272
|
+
"\nWARNING: The temperatures of the different temperature coupling groups are "
|
|
273
|
+
"not identical\n\n");
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
re->type = ReplicaExchangeType::Count;
|
|
278
|
+
bTemp = repl_quantity(ms, re, ReplicaExchangeType::Temperature, re->temp);
|
|
279
|
+
if (ir->efep != FreeEnergyPerturbationType::No)
|
|
280
|
+
{
|
|
281
|
+
bLambda = repl_quantity(
|
|
282
|
+
ms, re, ReplicaExchangeType::Lambda, static_cast<real>(ir->fepvals->init_fep_state));
|
|
283
|
+
}
|
|
284
|
+
if (re->type == ReplicaExchangeType::Count) /* nothing was assigned */
|
|
285
|
+
{
|
|
286
|
+
gmx_fatal(FARGS,
|
|
287
|
+
"The properties of the %d systems are all the same, there is nothing to exchange",
|
|
288
|
+
re->nrepl);
|
|
289
|
+
}
|
|
290
|
+
if (bLambda && bTemp)
|
|
291
|
+
{
|
|
292
|
+
re->type = ReplicaExchangeType::TemperatureLambda;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (bTemp)
|
|
296
|
+
{
|
|
297
|
+
please_cite(fplog, "Sugita1999a");
|
|
298
|
+
if (ir->epc != PressureCoupling::No)
|
|
299
|
+
{
|
|
300
|
+
re->bNPT = TRUE;
|
|
301
|
+
fprintf(fplog, "Repl Using Constant Pressure REMD.\n");
|
|
302
|
+
please_cite(fplog, "Okabe2001a");
|
|
303
|
+
}
|
|
304
|
+
if (ir->etc == TemperatureCoupling::Berendsen)
|
|
305
|
+
{
|
|
306
|
+
gmx_fatal(FARGS,
|
|
307
|
+
"REMD with the %s thermostat does not produce correct potential energy "
|
|
308
|
+
"distributions, consider using the %s thermostat instead",
|
|
309
|
+
enumValueToString(ir->etc),
|
|
310
|
+
enumValueToString(TemperatureCoupling::VRescale));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (bLambda)
|
|
314
|
+
{
|
|
315
|
+
if (ir->fepvals->delta_lambda != 0) /* check this? */
|
|
316
|
+
{
|
|
317
|
+
gmx_fatal(FARGS, "delta_lambda is not zero");
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (re->bNPT)
|
|
321
|
+
{
|
|
322
|
+
snew(re->pres, re->nrepl);
|
|
323
|
+
if (ir->epct == PressureCouplingType::SurfaceTension)
|
|
324
|
+
{
|
|
325
|
+
pres = ir->ref_p[ZZ][ZZ];
|
|
326
|
+
}
|
|
327
|
+
else
|
|
328
|
+
{
|
|
329
|
+
pres = 0;
|
|
330
|
+
j = 0;
|
|
331
|
+
for (i = 0; i < DIM; i++)
|
|
332
|
+
{
|
|
333
|
+
if (ir->compress[i][i] != 0)
|
|
334
|
+
{
|
|
335
|
+
pres += ir->ref_p[i][i];
|
|
336
|
+
j++;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
pres /= j;
|
|
340
|
+
}
|
|
341
|
+
re->pres[re->repl] = pres;
|
|
342
|
+
gmx_sum_sim(re->nrepl, re->pres, ms);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* Make an index for increasing replica order */
|
|
346
|
+
/* only makes sense if one or the other is varying, not both!
|
|
347
|
+
if both are varying, we trust the order the person gave. */
|
|
348
|
+
snew(re->ind, re->nrepl);
|
|
349
|
+
for (i = 0; i < re->nrepl; i++)
|
|
350
|
+
{
|
|
351
|
+
re->ind[i] = i;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (re->type < ReplicaExchangeType::EndSingle)
|
|
355
|
+
{
|
|
356
|
+
|
|
357
|
+
for (i = 0; i < re->nrepl; i++)
|
|
358
|
+
{
|
|
359
|
+
for (j = i + 1; j < re->nrepl; j++)
|
|
360
|
+
{
|
|
361
|
+
if (re->q[re->type][re->ind[j]] < re->q[re->type][re->ind[i]])
|
|
362
|
+
{
|
|
363
|
+
/* Unordered replicas are supposed to work, but there
|
|
364
|
+
* is still an issues somewhere.
|
|
365
|
+
* Note that at this point still re->ind[i]=i.
|
|
366
|
+
*/
|
|
367
|
+
gmx_fatal(FARGS,
|
|
368
|
+
"Replicas with indices %d < %d have %ss %g > %g, please order your "
|
|
369
|
+
"replicas on increasing %s",
|
|
370
|
+
i,
|
|
371
|
+
j,
|
|
372
|
+
enumValueToString(re->type),
|
|
373
|
+
re->q[re->type][i],
|
|
374
|
+
re->q[re->type][j],
|
|
375
|
+
enumValueToString(re->type));
|
|
376
|
+
}
|
|
377
|
+
else if (re->q[re->type][re->ind[j]] == re->q[re->type][re->ind[i]])
|
|
378
|
+
{
|
|
379
|
+
gmx_fatal(FARGS, "Two replicas have identical %ss", enumValueToString(re->type));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* keep track of all the swaps, starting with the initial placement. */
|
|
386
|
+
snew(re->allswaps, re->nrepl);
|
|
387
|
+
for (i = 0; i < re->nrepl; i++)
|
|
388
|
+
{
|
|
389
|
+
re->allswaps[i] = re->ind[i];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
switch (re->type)
|
|
393
|
+
{
|
|
394
|
+
case ReplicaExchangeType::Temperature:
|
|
395
|
+
fprintf(fplog, "\nReplica exchange in temperature\n");
|
|
396
|
+
for (i = 0; i < re->nrepl; i++)
|
|
397
|
+
{
|
|
398
|
+
fprintf(fplog, " %5.1f", re->q[re->type][re->ind[i]]);
|
|
399
|
+
}
|
|
400
|
+
fprintf(fplog, "\n");
|
|
401
|
+
break;
|
|
402
|
+
case ReplicaExchangeType::Lambda:
|
|
403
|
+
fprintf(fplog, "\nReplica exchange in lambda\n");
|
|
404
|
+
for (i = 0; i < re->nrepl; i++)
|
|
405
|
+
{
|
|
406
|
+
fprintf(fplog, " %3d", static_cast<int>(re->q[re->type][re->ind[i]]));
|
|
407
|
+
}
|
|
408
|
+
fprintf(fplog, "\n");
|
|
409
|
+
break;
|
|
410
|
+
case ReplicaExchangeType::TemperatureLambda:
|
|
411
|
+
fprintf(fplog, "\nReplica exchange in temperature and lambda state\n");
|
|
412
|
+
for (i = 0; i < re->nrepl; i++)
|
|
413
|
+
{
|
|
414
|
+
fprintf(fplog, " %5.1f", re->q[ReplicaExchangeType::Temperature][re->ind[i]]);
|
|
415
|
+
}
|
|
416
|
+
fprintf(fplog, "\n");
|
|
417
|
+
for (i = 0; i < re->nrepl; i++)
|
|
418
|
+
{
|
|
419
|
+
fprintf(fplog, " %5d", static_cast<int>(re->q[ReplicaExchangeType::Lambda][re->ind[i]]));
|
|
420
|
+
}
|
|
421
|
+
fprintf(fplog, "\n");
|
|
422
|
+
break;
|
|
423
|
+
default: gmx_incons("Unknown replica exchange quantity");
|
|
424
|
+
}
|
|
425
|
+
if (re->bNPT)
|
|
426
|
+
{
|
|
427
|
+
fprintf(fplog, "\nRepl p");
|
|
428
|
+
for (i = 0; i < re->nrepl; i++)
|
|
429
|
+
{
|
|
430
|
+
fprintf(fplog, " %5.2f", re->pres[re->ind[i]]);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
for (i = 0; i < re->nrepl; i++)
|
|
434
|
+
{
|
|
435
|
+
if ((i > 0) && (re->pres[re->ind[i]] < re->pres[re->ind[i - 1]]))
|
|
436
|
+
{
|
|
437
|
+
fprintf(fplog,
|
|
438
|
+
"\nWARNING: The reference pressures decrease with increasing "
|
|
439
|
+
"temperatures\n\n");
|
|
440
|
+
fprintf(stderr,
|
|
441
|
+
"\nWARNING: The reference pressures decrease with increasing "
|
|
442
|
+
"temperatures\n\n");
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
re->nst = nst;
|
|
447
|
+
if (replExParams.randomSeed == -1)
|
|
448
|
+
{
|
|
449
|
+
if (isMasterSim(ms))
|
|
450
|
+
{
|
|
451
|
+
re->seed = static_cast<int>(gmx::makeRandomSeed());
|
|
452
|
+
}
|
|
453
|
+
else
|
|
454
|
+
{
|
|
455
|
+
re->seed = 0;
|
|
456
|
+
}
|
|
457
|
+
gmx_sumi_sim(1, &(re->seed), ms);
|
|
458
|
+
}
|
|
459
|
+
else
|
|
460
|
+
{
|
|
461
|
+
re->seed = replExParams.randomSeed;
|
|
462
|
+
}
|
|
463
|
+
fprintf(fplog, "\nReplica exchange interval: %d\n", re->nst);
|
|
464
|
+
fprintf(fplog, "\nReplica random seed: %d\n", re->seed);
|
|
465
|
+
|
|
466
|
+
re->nattempt[0] = 0;
|
|
467
|
+
re->nattempt[1] = 0;
|
|
468
|
+
|
|
469
|
+
snew(re->prob_sum, re->nrepl);
|
|
470
|
+
snew(re->nexchange, re->nrepl);
|
|
471
|
+
snew(re->nmoves, re->nrepl);
|
|
472
|
+
for (i = 0; i < re->nrepl; i++)
|
|
473
|
+
{
|
|
474
|
+
snew(re->nmoves[i], re->nrepl);
|
|
475
|
+
}
|
|
476
|
+
fprintf(fplog, "Replica exchange information below: ex and x = exchange, pr = probability\n");
|
|
477
|
+
|
|
478
|
+
/* generate space for the helper functions so we don't have to snew each time */
|
|
479
|
+
|
|
480
|
+
snew(re->destinations, re->nrepl);
|
|
481
|
+
snew(re->incycle, re->nrepl);
|
|
482
|
+
snew(re->tmpswap, re->nrepl);
|
|
483
|
+
snew(re->cyclic, re->nrepl);
|
|
484
|
+
snew(re->order, re->nrepl);
|
|
485
|
+
for (i = 0; i < re->nrepl; i++)
|
|
486
|
+
{
|
|
487
|
+
snew(re->cyclic[i], re->nrepl + 1);
|
|
488
|
+
snew(re->order[i], re->nrepl);
|
|
489
|
+
}
|
|
490
|
+
/* allocate space for the functions storing the data for the replicas */
|
|
491
|
+
/* not all of these arrays needed in all cases, but they don't take
|
|
492
|
+
up much space, since the max size is nrepl**2 */
|
|
493
|
+
snew(re->prob, re->nrepl);
|
|
494
|
+
snew(re->bEx, re->nrepl);
|
|
495
|
+
snew(re->beta, re->nrepl);
|
|
496
|
+
snew(re->Vol, re->nrepl);
|
|
497
|
+
snew(re->Epot, re->nrepl);
|
|
498
|
+
snew(re->de, re->nrepl);
|
|
499
|
+
for (i = 0; i < re->nrepl; i++)
|
|
500
|
+
{
|
|
501
|
+
snew(re->de[i], re->nrepl);
|
|
502
|
+
}
|
|
503
|
+
re->nex = replExParams.numExchanges;
|
|
504
|
+
return re;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
static void exchange_reals(const gmx_multisim_t gmx_unused* ms, int gmx_unused b, real* v, int n)
|
|
508
|
+
{
|
|
509
|
+
real* buf;
|
|
510
|
+
int i;
|
|
511
|
+
|
|
512
|
+
if (v)
|
|
513
|
+
{
|
|
514
|
+
snew(buf, n);
|
|
515
|
+
#if GMX_MPI
|
|
516
|
+
/*
|
|
517
|
+
MPI_Sendrecv(v, n*sizeof(real),MPI_BYTE,MSRANK(ms,b),0,
|
|
518
|
+
buf,n*sizeof(real),MPI_BYTE,MSRANK(ms,b),0,
|
|
519
|
+
ms->mastersComm_,MPI_STATUS_IGNORE);
|
|
520
|
+
*/
|
|
521
|
+
{
|
|
522
|
+
MPI_Request mpi_req;
|
|
523
|
+
|
|
524
|
+
MPI_Isend(v, n * sizeof(real), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, &mpi_req);
|
|
525
|
+
MPI_Recv(buf, n * sizeof(real), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, MPI_STATUS_IGNORE);
|
|
526
|
+
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
|
|
527
|
+
}
|
|
528
|
+
#endif
|
|
529
|
+
for (i = 0; i < n; i++)
|
|
530
|
+
{
|
|
531
|
+
v[i] = buf[i];
|
|
532
|
+
}
|
|
533
|
+
sfree(buf);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
static void exchange_doubles(const gmx_multisim_t gmx_unused* ms, int gmx_unused b, double* v, int n)
|
|
539
|
+
{
|
|
540
|
+
double* buf;
|
|
541
|
+
int i;
|
|
542
|
+
|
|
543
|
+
if (v)
|
|
544
|
+
{
|
|
545
|
+
snew(buf, n);
|
|
546
|
+
#if GMX_MPI
|
|
547
|
+
/*
|
|
548
|
+
MPI_Sendrecv(v, n*sizeof(double),MPI_BYTE,MSRANK(ms,b),0,
|
|
549
|
+
buf,n*sizeof(double),MPI_BYTE,MSRANK(ms,b),0,
|
|
550
|
+
ms->mastersComm_,MPI_STATUS_IGNORE);
|
|
551
|
+
*/
|
|
552
|
+
{
|
|
553
|
+
MPI_Request mpi_req;
|
|
554
|
+
|
|
555
|
+
MPI_Isend(v, n * sizeof(double), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, &mpi_req);
|
|
556
|
+
MPI_Recv(buf, n * sizeof(double), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, MPI_STATUS_IGNORE);
|
|
557
|
+
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
|
|
558
|
+
}
|
|
559
|
+
#endif
|
|
560
|
+
for (i = 0; i < n; i++)
|
|
561
|
+
{
|
|
562
|
+
v[i] = buf[i];
|
|
563
|
+
}
|
|
564
|
+
sfree(buf);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
static void exchange_rvecs(const gmx_multisim_t gmx_unused* ms, int gmx_unused b, rvec* v, int n)
|
|
569
|
+
{
|
|
570
|
+
rvec* buf;
|
|
571
|
+
int i;
|
|
572
|
+
|
|
573
|
+
if (v)
|
|
574
|
+
{
|
|
575
|
+
snew(buf, n);
|
|
576
|
+
#if GMX_MPI
|
|
577
|
+
/*
|
|
578
|
+
MPI_Sendrecv(v[0], n*sizeof(rvec),MPI_BYTE,MSRANK(ms,b),0,
|
|
579
|
+
buf[0],n*sizeof(rvec),MPI_BYTE,MSRANK(ms,b),0,
|
|
580
|
+
ms->mastersComm_,MPI_STATUS_IGNORE);
|
|
581
|
+
*/
|
|
582
|
+
{
|
|
583
|
+
MPI_Request mpi_req;
|
|
584
|
+
|
|
585
|
+
MPI_Isend(v[0], n * sizeof(rvec), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, &mpi_req);
|
|
586
|
+
MPI_Recv(buf[0], n * sizeof(rvec), MPI_BYTE, MSRANK(ms, b), 0, ms->mastersComm_, MPI_STATUS_IGNORE);
|
|
587
|
+
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
|
|
588
|
+
}
|
|
589
|
+
#endif
|
|
590
|
+
for (i = 0; i < n; i++)
|
|
591
|
+
{
|
|
592
|
+
copy_rvec(buf[i], v[i]);
|
|
593
|
+
}
|
|
594
|
+
sfree(buf);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
static void exchange_state(const gmx_multisim_t* ms, int b, t_state* state)
|
|
599
|
+
{
|
|
600
|
+
/* When t_state changes, this code should be updated. */
|
|
601
|
+
int ngtc, nnhpres;
|
|
602
|
+
ngtc = state->ngtc * state->nhchainlength;
|
|
603
|
+
nnhpres = state->nnhpres * state->nhchainlength;
|
|
604
|
+
exchange_rvecs(ms, b, state->box, DIM);
|
|
605
|
+
exchange_rvecs(ms, b, state->box_rel, DIM);
|
|
606
|
+
exchange_rvecs(ms, b, state->boxv, DIM);
|
|
607
|
+
exchange_reals(ms, b, &(state->veta), 1);
|
|
608
|
+
exchange_reals(ms, b, &(state->vol0), 1);
|
|
609
|
+
exchange_rvecs(ms, b, state->svir_prev, DIM);
|
|
610
|
+
exchange_rvecs(ms, b, state->fvir_prev, DIM);
|
|
611
|
+
exchange_rvecs(ms, b, state->pres_prev, DIM);
|
|
612
|
+
exchange_doubles(ms, b, state->nosehoover_xi.data(), ngtc);
|
|
613
|
+
exchange_doubles(ms, b, state->nosehoover_vxi.data(), ngtc);
|
|
614
|
+
exchange_doubles(ms, b, state->nhpres_xi.data(), nnhpres);
|
|
615
|
+
exchange_doubles(ms, b, state->nhpres_vxi.data(), nnhpres);
|
|
616
|
+
exchange_doubles(ms, b, state->therm_integral.data(), state->ngtc);
|
|
617
|
+
exchange_doubles(ms, b, &state->baros_integral, 1);
|
|
618
|
+
exchange_rvecs(ms, b, state->x.rvec_array(), state->natoms);
|
|
619
|
+
exchange_rvecs(ms, b, state->v.rvec_array(), state->natoms);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
static void copy_state_serial(const t_state* src, t_state* dest)
|
|
623
|
+
{
|
|
624
|
+
if (dest != src)
|
|
625
|
+
{
|
|
626
|
+
/* Currently the local state is always a pointer to the global
|
|
627
|
+
* in serial, so we should never end up here.
|
|
628
|
+
* TODO: Implement a (trivial) t_state copy once converted to C++.
|
|
629
|
+
*/
|
|
630
|
+
GMX_RELEASE_ASSERT(false, "State copying is currently not implemented in replica exchange");
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
static void scale_velocities(gmx::ArrayRef<gmx::RVec> velocities, real fac)
|
|
635
|
+
{
|
|
636
|
+
for (auto& v : velocities)
|
|
637
|
+
{
|
|
638
|
+
v *= fac;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
static void print_transition_matrix(FILE* fplog, int n, int** nmoves, const int* nattempt)
|
|
643
|
+
{
|
|
644
|
+
int i, j, ntot;
|
|
645
|
+
float Tprint;
|
|
646
|
+
|
|
647
|
+
ntot = nattempt[0] + nattempt[1];
|
|
648
|
+
fprintf(fplog, "\n");
|
|
649
|
+
fprintf(fplog, "Repl");
|
|
650
|
+
for (i = 0; i < n; i++)
|
|
651
|
+
{
|
|
652
|
+
fprintf(fplog, " "); /* put the title closer to the center */
|
|
653
|
+
}
|
|
654
|
+
fprintf(fplog, "Empirical Transition Matrix\n");
|
|
655
|
+
|
|
656
|
+
fprintf(fplog, "Repl");
|
|
657
|
+
for (i = 0; i < n; i++)
|
|
658
|
+
{
|
|
659
|
+
fprintf(fplog, "%8d", (i + 1));
|
|
660
|
+
}
|
|
661
|
+
fprintf(fplog, "\n");
|
|
662
|
+
|
|
663
|
+
for (i = 0; i < n; i++)
|
|
664
|
+
{
|
|
665
|
+
fprintf(fplog, "Repl");
|
|
666
|
+
for (j = 0; j < n; j++)
|
|
667
|
+
{
|
|
668
|
+
Tprint = 0.0;
|
|
669
|
+
if (nmoves[i][j] > 0)
|
|
670
|
+
{
|
|
671
|
+
Tprint = nmoves[i][j] / (2.0 * ntot);
|
|
672
|
+
}
|
|
673
|
+
fprintf(fplog, "%8.4f", Tprint);
|
|
674
|
+
}
|
|
675
|
+
fprintf(fplog, "%3d\n", i);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
static void print_ind(FILE* fplog, const char* leg, int n, int* ind, const gmx_bool* bEx)
|
|
680
|
+
{
|
|
681
|
+
int i;
|
|
682
|
+
|
|
683
|
+
fprintf(fplog, "Repl %2s %2d", leg, ind[0]);
|
|
684
|
+
for (i = 1; i < n; i++)
|
|
685
|
+
{
|
|
686
|
+
fprintf(fplog, " %c %2d", (bEx != nullptr && bEx[i]) ? 'x' : ' ', ind[i]);
|
|
687
|
+
}
|
|
688
|
+
fprintf(fplog, "\n");
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
static void print_allswitchind(FILE* fplog, int n, int* pind, int* allswaps, int* tmpswap)
|
|
692
|
+
{
|
|
693
|
+
int i;
|
|
694
|
+
|
|
695
|
+
for (i = 0; i < n; i++)
|
|
696
|
+
{
|
|
697
|
+
tmpswap[i] = allswaps[i];
|
|
698
|
+
}
|
|
699
|
+
for (i = 0; i < n; i++)
|
|
700
|
+
{
|
|
701
|
+
allswaps[i] = tmpswap[pind[i]];
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
fprintf(fplog, "\nAccepted Exchanges: ");
|
|
705
|
+
for (i = 0; i < n; i++)
|
|
706
|
+
{
|
|
707
|
+
fprintf(fplog, "%d ", pind[i]);
|
|
708
|
+
}
|
|
709
|
+
fprintf(fplog, "\n");
|
|
710
|
+
|
|
711
|
+
/* the "Order After Exchange" is the state label corresponding to the configuration that
|
|
712
|
+
started in state listed in order, i.e.
|
|
713
|
+
|
|
714
|
+
3 0 1 2
|
|
715
|
+
|
|
716
|
+
means that the:
|
|
717
|
+
configuration starting in simulation 3 is now in simulation 0,
|
|
718
|
+
configuration starting in simulation 0 is now in simulation 1,
|
|
719
|
+
configuration starting in simulation 1 is now in simulation 2,
|
|
720
|
+
configuration starting in simulation 2 is now in simulation 3
|
|
721
|
+
*/
|
|
722
|
+
fprintf(fplog, "Order After Exchange: ");
|
|
723
|
+
for (i = 0; i < n; i++)
|
|
724
|
+
{
|
|
725
|
+
fprintf(fplog, "%d ", allswaps[i]);
|
|
726
|
+
}
|
|
727
|
+
fprintf(fplog, "\n\n");
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
static void print_prob(FILE* fplog, const char* leg, int n, real* prob)
|
|
731
|
+
{
|
|
732
|
+
int i;
|
|
733
|
+
char buf[8];
|
|
734
|
+
|
|
735
|
+
fprintf(fplog, "Repl %2s ", leg);
|
|
736
|
+
for (i = 1; i < n; i++)
|
|
737
|
+
{
|
|
738
|
+
if (prob[i] >= 0)
|
|
739
|
+
{
|
|
740
|
+
sprintf(buf, "%4.2f", prob[i]);
|
|
741
|
+
fprintf(fplog, " %3s", buf[0] == '1' ? "1.0" : buf + 1);
|
|
742
|
+
}
|
|
743
|
+
else
|
|
744
|
+
{
|
|
745
|
+
fprintf(fplog, " ");
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
fprintf(fplog, "\n");
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
static void print_count(FILE* fplog, const char* leg, int n, int* count)
|
|
752
|
+
{
|
|
753
|
+
int i;
|
|
754
|
+
|
|
755
|
+
fprintf(fplog, "Repl %2s ", leg);
|
|
756
|
+
for (i = 1; i < n; i++)
|
|
757
|
+
{
|
|
758
|
+
fprintf(fplog, " %4d", count[i]);
|
|
759
|
+
}
|
|
760
|
+
fprintf(fplog, "\n");
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
static real calc_delta(FILE* fplog, gmx_bool bPrint, struct gmx_repl_ex* re, int a, int b, int ap, int bp)
|
|
764
|
+
{
|
|
765
|
+
|
|
766
|
+
real ediff, dpV, delta = 0;
|
|
767
|
+
real* Epot = re->Epot;
|
|
768
|
+
real* Vol = re->Vol;
|
|
769
|
+
real** de = re->de;
|
|
770
|
+
real* beta = re->beta;
|
|
771
|
+
|
|
772
|
+
/* Two cases; we are permuted and not. In all cases, setting ap = a and bp = b will reduce
|
|
773
|
+
to the non permuted case */
|
|
774
|
+
|
|
775
|
+
switch (re->type)
|
|
776
|
+
{
|
|
777
|
+
case ReplicaExchangeType::Temperature:
|
|
778
|
+
/*
|
|
779
|
+
* Okabe et. al. Chem. Phys. Lett. 335 (2001) 435-439
|
|
780
|
+
*/
|
|
781
|
+
ediff = Epot[b] - Epot[a];
|
|
782
|
+
delta = -(beta[bp] - beta[ap]) * ediff;
|
|
783
|
+
break;
|
|
784
|
+
case ReplicaExchangeType::Lambda:
|
|
785
|
+
/* two cases: when we are permuted, and not. */
|
|
786
|
+
/* non-permuted:
|
|
787
|
+
ediff = E_new - E_old
|
|
788
|
+
= [H_b(x_a) + H_a(x_b)] - [H_b(x_b) + H_a(x_a)]
|
|
789
|
+
= [H_b(x_a) - H_a(x_a)] + [H_a(x_b) - H_b(x_b)]
|
|
790
|
+
= de[b][a] + de[a][b] */
|
|
791
|
+
|
|
792
|
+
/* permuted:
|
|
793
|
+
ediff = E_new - E_old
|
|
794
|
+
= [H_bp(x_a) + H_ap(x_b)] - [H_bp(x_b) + H_ap(x_a)]
|
|
795
|
+
= [H_bp(x_a) - H_ap(x_a)] + [H_ap(x_b) - H_bp(x_b)]
|
|
796
|
+
= [H_bp(x_a) - H_a(x_a) + H_a(x_a) - H_ap(x_a)] + [H_ap(x_b) - H_b(x_b) + H_b(x_b) - H_bp(x_b)]
|
|
797
|
+
= [H_bp(x_a) - H_a(x_a)] - [H_ap(x_a) - H_a(x_a)] + [H_ap(x_b) - H_b(x_b)] - H_bp(x_b) - H_b(x_b)]
|
|
798
|
+
= (de[bp][a] - de[ap][a]) + (de[ap][b] - de[bp][b]) */
|
|
799
|
+
/* but, in the current code implementation, we flip configurations, not indices . . .
|
|
800
|
+
So let's examine that.
|
|
801
|
+
= [H_b(x_ap) - H_a(x_a)] - [H_a(x_ap) - H_a(x_a)] + [H_a(x_bp) - H_b(x_b)] - H_b(x_bp) - H_b(x_b)]
|
|
802
|
+
= [H_b(x_ap) - H_a(x_ap)] + [H_a(x_bp) - H_b(x_pb)]
|
|
803
|
+
= (de[b][ap] - de[a][ap]) + (de[a][bp] - de[b][bp]
|
|
804
|
+
So, if we exchange b<=> bp and a<=> ap, we return to the same result.
|
|
805
|
+
So the simple solution is to flip the
|
|
806
|
+
position of perturbed and original indices in the tests.
|
|
807
|
+
*/
|
|
808
|
+
|
|
809
|
+
ediff = (de[bp][a] - de[ap][a]) + (de[ap][b] - de[bp][b]);
|
|
810
|
+
delta = ediff * beta[a]; /* assume all same temperature in this case */
|
|
811
|
+
break;
|
|
812
|
+
case ReplicaExchangeType::TemperatureLambda:
|
|
813
|
+
/* not permuted: */
|
|
814
|
+
/* delta = reduced E_new - reduced E_old
|
|
815
|
+
= [beta_b H_b(x_a) + beta_a H_a(x_b)] - [beta_b H_b(x_b) + beta_a H_a(x_a)]
|
|
816
|
+
= [beta_b H_b(x_a) - beta_a H_a(x_a)] + [beta_a H_a(x_b) - beta_b H_b(x_b)]
|
|
817
|
+
= [beta_b dH_b(x_a) + beta_b H_a(x_a) - beta_a H_a(x_a)] +
|
|
818
|
+
[beta_a dH_a(x_b) + beta_a H_b(x_b) - beta_b H_b(x_b)]
|
|
819
|
+
= [beta_b dH_b(x_a) + [beta_a dH_a(x_b) +
|
|
820
|
+
beta_b (H_a(x_a) - H_b(x_b)]) - beta_a (H_a(x_a) - H_b(x_b))
|
|
821
|
+
= beta_b dH_b(x_a) + beta_a dH_a(x_b) - (beta_b - beta_a)(H_b(x_b) - H_a(x_a) */
|
|
822
|
+
/* delta = beta[b]*de[b][a] + beta[a]*de[a][b] - (beta[b] - beta[a])*(Epot[b] - Epot[a]; */
|
|
823
|
+
/* permuted (big breath!) */
|
|
824
|
+
/* delta = reduced E_new - reduced E_old
|
|
825
|
+
= [beta_bp H_bp(x_a) + beta_ap H_ap(x_b)] - [beta_bp H_bp(x_b) + beta_ap H_ap(x_a)]
|
|
826
|
+
= [beta_bp H_bp(x_a) - beta_ap H_ap(x_a)] + [beta_ap H_ap(x_b) - beta_bp H_bp(x_b)]
|
|
827
|
+
= [beta_bp H_bp(x_a) - beta_ap H_ap(x_a)] + [beta_ap H_ap(x_b) - beta_bp H_bp(x_b)]
|
|
828
|
+
- beta_pb H_a(x_a) + beta_ap H_a(x_a) + beta_pb H_a(x_a) - beta_ap H_a(x_a)
|
|
829
|
+
- beta_ap H_b(x_b) + beta_bp H_b(x_b) + beta_ap H_b(x_b) - beta_bp H_b(x_b)
|
|
830
|
+
= [(beta_bp H_bp(x_a) - beta_bp H_a(x_a)) - (beta_ap H_ap(x_a) - beta_ap H_a(x_a))] +
|
|
831
|
+
[(beta_ap H_ap(x_b) - beta_ap H_b(x_b)) - (beta_bp H_bp(x_b) - beta_bp H_b(x_b))]
|
|
832
|
+
+ beta_pb H_a(x_a) - beta_ap H_a(x_a) + beta_ap H_b(x_b) - beta_bp H_b(x_b)
|
|
833
|
+
= [beta_bp (H_bp(x_a) - H_a(x_a)) - beta_ap (H_ap(x_a) - H_a(x_a))] +
|
|
834
|
+
[beta_ap (H_ap(x_b) - H_b(x_b)) - beta_bp (H_bp(x_b) - H_b(x_b))]
|
|
835
|
+
+ beta_pb (H_a(x_a) - H_b(x_b)) - beta_ap (H_a(x_a) - H_b(x_b))
|
|
836
|
+
= ([beta_bp de[bp][a] - beta_ap de[ap][a]) + beta_ap de[ap][b] - beta_bp de[bp][b])
|
|
837
|
+
+ (beta_pb-beta_ap)(H_a(x_a) - H_b(x_b)) */
|
|
838
|
+
delta = beta[bp] * (de[bp][a] - de[bp][b]) + beta[ap] * (de[ap][b] - de[ap][a])
|
|
839
|
+
- (beta[bp] - beta[ap]) * (Epot[b] - Epot[a]);
|
|
840
|
+
break;
|
|
841
|
+
default: gmx_incons("Unknown replica exchange quantity");
|
|
842
|
+
}
|
|
843
|
+
if (bPrint)
|
|
844
|
+
{
|
|
845
|
+
fprintf(fplog, "Repl %d <-> %d dE_term = %10.3e (kT)\n", a, b, delta);
|
|
846
|
+
}
|
|
847
|
+
if (re->bNPT)
|
|
848
|
+
{
|
|
849
|
+
/* revist the calculation for 5.0. Might be some improvements. */
|
|
850
|
+
dpV = (beta[ap] * re->pres[ap] - beta[bp] * re->pres[bp]) * (Vol[b] - Vol[a]) / gmx::c_presfac;
|
|
851
|
+
if (bPrint)
|
|
852
|
+
{
|
|
853
|
+
fprintf(fplog, " dpV = %10.3e d = %10.3e\n", dpV, delta + dpV);
|
|
854
|
+
}
|
|
855
|
+
delta += dpV;
|
|
856
|
+
}
|
|
857
|
+
return delta;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
static void test_for_replica_exchange(FILE* fplog,
|
|
861
|
+
const gmx_multisim_t* ms,
|
|
862
|
+
struct gmx_repl_ex* re,
|
|
863
|
+
const gmx_enerdata_t* enerd,
|
|
864
|
+
real vol,
|
|
865
|
+
int64_t step,
|
|
866
|
+
real time)
|
|
867
|
+
{
|
|
868
|
+
int m, i, j, a, b, ap, bp, i0, i1, tmp;
|
|
869
|
+
real delta = 0;
|
|
870
|
+
gmx_bool bPrint, bMultiEx;
|
|
871
|
+
gmx_bool* bEx = re->bEx;
|
|
872
|
+
real* prob = re->prob;
|
|
873
|
+
int* pind = re->destinations; /* permuted index */
|
|
874
|
+
gmx_bool bEpot = FALSE;
|
|
875
|
+
gmx_bool bDLambda = FALSE;
|
|
876
|
+
gmx_bool bVol = FALSE;
|
|
877
|
+
gmx::ThreeFry2x64<64> rng(re->seed, gmx::RandomDomain::ReplicaExchange);
|
|
878
|
+
gmx::UniformRealDistribution<real> uniformRealDist;
|
|
879
|
+
gmx::UniformIntDistribution<int> uniformNreplDist(0, re->nrepl - 1);
|
|
880
|
+
|
|
881
|
+
bMultiEx = (re->nex > 1); /* multiple exchanges at each state */
|
|
882
|
+
fprintf(fplog, "Replica exchange at step %" PRId64 " time %.5f\n", step, time);
|
|
883
|
+
|
|
884
|
+
if (re->bNPT)
|
|
885
|
+
{
|
|
886
|
+
for (i = 0; i < re->nrepl; i++)
|
|
887
|
+
{
|
|
888
|
+
re->Vol[i] = 0;
|
|
889
|
+
}
|
|
890
|
+
bVol = TRUE;
|
|
891
|
+
re->Vol[re->repl] = vol;
|
|
892
|
+
}
|
|
893
|
+
if ((re->type == ReplicaExchangeType::Temperature || re->type == ReplicaExchangeType::TemperatureLambda))
|
|
894
|
+
{
|
|
895
|
+
for (i = 0; i < re->nrepl; i++)
|
|
896
|
+
{
|
|
897
|
+
re->Epot[i] = 0;
|
|
898
|
+
}
|
|
899
|
+
bEpot = TRUE;
|
|
900
|
+
re->Epot[re->repl] = enerd->term[F_EPOT];
|
|
901
|
+
/* temperatures of different states*/
|
|
902
|
+
for (i = 0; i < re->nrepl; i++)
|
|
903
|
+
{
|
|
904
|
+
re->beta[i] = 1.0 / (re->q[ReplicaExchangeType::Temperature][i] * gmx::c_boltz);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
else
|
|
908
|
+
{
|
|
909
|
+
for (i = 0; i < re->nrepl; i++)
|
|
910
|
+
{
|
|
911
|
+
re->beta[i] = 1.0 / (re->temp * gmx::c_boltz); /* we have a single temperature */
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
if (re->type == ReplicaExchangeType::Lambda || re->type == ReplicaExchangeType::TemperatureLambda)
|
|
915
|
+
{
|
|
916
|
+
bDLambda = TRUE;
|
|
917
|
+
/* lambda differences. */
|
|
918
|
+
/* de[i][j] is the energy of the jth simulation in the ith Hamiltonian
|
|
919
|
+
minus the energy of the jth simulation in the jth Hamiltonian */
|
|
920
|
+
for (i = 0; i < re->nrepl; i++)
|
|
921
|
+
{
|
|
922
|
+
for (j = 0; j < re->nrepl; j++)
|
|
923
|
+
{
|
|
924
|
+
re->de[i][j] = 0;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
for (i = 0; i < re->nrepl; i++)
|
|
928
|
+
{
|
|
929
|
+
re->de[i][re->repl] =
|
|
930
|
+
enerd->foreignLambdaTerms.deltaH(re->q[ReplicaExchangeType::Lambda][i]);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/* now actually do the communication */
|
|
935
|
+
if (bVol)
|
|
936
|
+
{
|
|
937
|
+
gmx_sum_sim(re->nrepl, re->Vol, ms);
|
|
938
|
+
}
|
|
939
|
+
if (bEpot)
|
|
940
|
+
{
|
|
941
|
+
gmx_sum_sim(re->nrepl, re->Epot, ms);
|
|
942
|
+
}
|
|
943
|
+
if (bDLambda)
|
|
944
|
+
{
|
|
945
|
+
for (i = 0; i < re->nrepl; i++)
|
|
946
|
+
{
|
|
947
|
+
gmx_sum_sim(re->nrepl, re->de[i], ms);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/* make a duplicate set of indices for shuffling */
|
|
952
|
+
for (i = 0; i < re->nrepl; i++)
|
|
953
|
+
{
|
|
954
|
+
pind[i] = re->ind[i];
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
rng.restart(step, 0);
|
|
958
|
+
|
|
959
|
+
if (bMultiEx)
|
|
960
|
+
{
|
|
961
|
+
/* multiple random switch exchange */
|
|
962
|
+
int nself = 0;
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
for (i = 0; i < re->nex + nself; i++)
|
|
966
|
+
{
|
|
967
|
+
// For now this is superfluous, but just in case we ever add more
|
|
968
|
+
// calls in different branches it is safer to always reset the distribution.
|
|
969
|
+
uniformNreplDist.reset();
|
|
970
|
+
|
|
971
|
+
/* randomly select a pair */
|
|
972
|
+
/* in theory, could reduce this by identifying only which switches had a nonneglibible
|
|
973
|
+
probability of occurring (log p > -100) and only operate on those switches */
|
|
974
|
+
/* find out which state it is from, and what label that state currently has. Likely
|
|
975
|
+
more work that useful. */
|
|
976
|
+
i0 = uniformNreplDist(rng);
|
|
977
|
+
i1 = uniformNreplDist(rng);
|
|
978
|
+
if (i0 == i1)
|
|
979
|
+
{
|
|
980
|
+
nself++;
|
|
981
|
+
continue; /* self-exchange, back up and do it again */
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
a = re->ind[i0]; /* what are the indices of these states? */
|
|
985
|
+
b = re->ind[i1];
|
|
986
|
+
ap = pind[i0];
|
|
987
|
+
bp = pind[i1];
|
|
988
|
+
|
|
989
|
+
bPrint = FALSE; /* too noisy */
|
|
990
|
+
/* calculate the energy difference */
|
|
991
|
+
/* if the code changes to flip the STATES, rather than the configurations,
|
|
992
|
+
use the commented version of the code */
|
|
993
|
+
/* delta = calc_delta(fplog,bPrint,re,a,b,ap,bp); */
|
|
994
|
+
delta = calc_delta(fplog, bPrint, re, ap, bp, a, b);
|
|
995
|
+
|
|
996
|
+
/* we actually only use the first space in the prob and bEx array,
|
|
997
|
+
since there are actually many switches between pairs. */
|
|
998
|
+
|
|
999
|
+
if (delta <= 0)
|
|
1000
|
+
{
|
|
1001
|
+
/* accepted */
|
|
1002
|
+
prob[0] = 1;
|
|
1003
|
+
bEx[0] = TRUE;
|
|
1004
|
+
}
|
|
1005
|
+
else
|
|
1006
|
+
{
|
|
1007
|
+
if (delta > c_probabilityCutoff)
|
|
1008
|
+
{
|
|
1009
|
+
prob[0] = 0;
|
|
1010
|
+
}
|
|
1011
|
+
else
|
|
1012
|
+
{
|
|
1013
|
+
prob[0] = exp(-delta);
|
|
1014
|
+
}
|
|
1015
|
+
// roll a number to determine if accepted. For now it is superfluous to
|
|
1016
|
+
// reset, but just in case we ever add more calls in different branches
|
|
1017
|
+
// it is safer to always reset the distribution.
|
|
1018
|
+
uniformRealDist.reset();
|
|
1019
|
+
bEx[0] = uniformRealDist(rng) < prob[0];
|
|
1020
|
+
}
|
|
1021
|
+
re->prob_sum[0] += prob[0];
|
|
1022
|
+
|
|
1023
|
+
if (bEx[0])
|
|
1024
|
+
{
|
|
1025
|
+
/* swap the states */
|
|
1026
|
+
tmp = pind[i0];
|
|
1027
|
+
pind[i0] = pind[i1];
|
|
1028
|
+
pind[i1] = tmp;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
re->nattempt[0]++; /* keep track of total permutation trials here */
|
|
1032
|
+
print_allswitchind(fplog, re->nrepl, pind, re->allswaps, re->tmpswap);
|
|
1033
|
+
}
|
|
1034
|
+
else
|
|
1035
|
+
{
|
|
1036
|
+
/* standard nearest neighbor replica exchange */
|
|
1037
|
+
|
|
1038
|
+
m = (step / re->nst) % 2;
|
|
1039
|
+
for (i = 1; i < re->nrepl; i++)
|
|
1040
|
+
{
|
|
1041
|
+
a = re->ind[i - 1];
|
|
1042
|
+
b = re->ind[i];
|
|
1043
|
+
|
|
1044
|
+
bPrint = (re->repl == a || re->repl == b);
|
|
1045
|
+
if (i % 2 == m)
|
|
1046
|
+
{
|
|
1047
|
+
delta = calc_delta(fplog, bPrint, re, a, b, a, b);
|
|
1048
|
+
if (delta <= 0)
|
|
1049
|
+
{
|
|
1050
|
+
/* accepted */
|
|
1051
|
+
prob[i] = 1;
|
|
1052
|
+
bEx[i] = TRUE;
|
|
1053
|
+
}
|
|
1054
|
+
else
|
|
1055
|
+
{
|
|
1056
|
+
if (delta > c_probabilityCutoff)
|
|
1057
|
+
{
|
|
1058
|
+
prob[i] = 0;
|
|
1059
|
+
}
|
|
1060
|
+
else
|
|
1061
|
+
{
|
|
1062
|
+
prob[i] = exp(-delta);
|
|
1063
|
+
}
|
|
1064
|
+
// roll a number to determine if accepted. For now it is superfluous to
|
|
1065
|
+
// reset, but just in case we ever add more calls in different branches
|
|
1066
|
+
// it is safer to always reset the distribution.
|
|
1067
|
+
uniformRealDist.reset();
|
|
1068
|
+
bEx[i] = uniformRealDist(rng) < prob[i];
|
|
1069
|
+
}
|
|
1070
|
+
re->prob_sum[i] += prob[i];
|
|
1071
|
+
|
|
1072
|
+
if (bEx[i])
|
|
1073
|
+
{
|
|
1074
|
+
/* swap these two */
|
|
1075
|
+
tmp = pind[i - 1];
|
|
1076
|
+
pind[i - 1] = pind[i];
|
|
1077
|
+
pind[i] = tmp;
|
|
1078
|
+
re->nexchange[i]++; /* statistics for back compatibility */
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
else
|
|
1082
|
+
{
|
|
1083
|
+
prob[i] = -1;
|
|
1084
|
+
bEx[i] = FALSE;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
/* print some statistics */
|
|
1088
|
+
print_ind(fplog, "ex", re->nrepl, re->ind, bEx);
|
|
1089
|
+
print_prob(fplog, "pr", re->nrepl, prob);
|
|
1090
|
+
fprintf(fplog, "\n");
|
|
1091
|
+
re->nattempt[m]++;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/* record which moves were made and accepted */
|
|
1095
|
+
for (i = 0; i < re->nrepl; i++)
|
|
1096
|
+
{
|
|
1097
|
+
re->nmoves[re->ind[i]][pind[i]] += 1;
|
|
1098
|
+
re->nmoves[pind[i]][re->ind[i]] += 1;
|
|
1099
|
+
}
|
|
1100
|
+
fflush(fplog); /* make sure we can see what the last exchange was */
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
static void cyclic_decomposition(const int* destinations, int** cyclic, gmx_bool* incycle, const int nrepl, int* nswap)
|
|
1104
|
+
{
|
|
1105
|
+
|
|
1106
|
+
int i, j, c, p;
|
|
1107
|
+
int maxlen = 1;
|
|
1108
|
+
for (i = 0; i < nrepl; i++)
|
|
1109
|
+
{
|
|
1110
|
+
incycle[i] = FALSE;
|
|
1111
|
+
}
|
|
1112
|
+
for (i = 0; i < nrepl; i++) /* one cycle for each replica */
|
|
1113
|
+
{
|
|
1114
|
+
if (incycle[i])
|
|
1115
|
+
{
|
|
1116
|
+
cyclic[i][0] = -1;
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
cyclic[i][0] = i;
|
|
1120
|
+
incycle[i] = TRUE;
|
|
1121
|
+
c = 1;
|
|
1122
|
+
p = i;
|
|
1123
|
+
for (j = 0; j < nrepl; j++) /* potentially all cycles are part, but we will break first */
|
|
1124
|
+
{
|
|
1125
|
+
p = destinations[p]; /* start permuting */
|
|
1126
|
+
if (p == i)
|
|
1127
|
+
{
|
|
1128
|
+
cyclic[i][c] = -1;
|
|
1129
|
+
if (c > maxlen)
|
|
1130
|
+
{
|
|
1131
|
+
maxlen = c;
|
|
1132
|
+
}
|
|
1133
|
+
break; /* we've reached the original element, the cycle is complete, and we marked the end. */
|
|
1134
|
+
}
|
|
1135
|
+
else
|
|
1136
|
+
{
|
|
1137
|
+
cyclic[i][c] = p; /* each permutation gives a new member of the cycle */
|
|
1138
|
+
incycle[p] = TRUE;
|
|
1139
|
+
c++;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
*nswap = maxlen - 1;
|
|
1144
|
+
|
|
1145
|
+
if (debug)
|
|
1146
|
+
{
|
|
1147
|
+
for (i = 0; i < nrepl; i++)
|
|
1148
|
+
{
|
|
1149
|
+
fprintf(debug, "Cycle %d:", i);
|
|
1150
|
+
for (j = 0; j < nrepl; j++)
|
|
1151
|
+
{
|
|
1152
|
+
if (cyclic[i][j] < 0)
|
|
1153
|
+
{
|
|
1154
|
+
break;
|
|
1155
|
+
}
|
|
1156
|
+
fprintf(debug, "%2d", cyclic[i][j]);
|
|
1157
|
+
}
|
|
1158
|
+
fprintf(debug, "\n");
|
|
1159
|
+
}
|
|
1160
|
+
fflush(debug);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
static void compute_exchange_order(int** cyclic, int** order, const int nrepl, const int maxswap)
|
|
1165
|
+
{
|
|
1166
|
+
int i, j;
|
|
1167
|
+
|
|
1168
|
+
for (j = 0; j < maxswap; j++)
|
|
1169
|
+
{
|
|
1170
|
+
for (i = 0; i < nrepl; i++)
|
|
1171
|
+
{
|
|
1172
|
+
if (cyclic[i][j + 1] >= 0)
|
|
1173
|
+
{
|
|
1174
|
+
order[cyclic[i][j + 1]][j] = cyclic[i][j];
|
|
1175
|
+
order[cyclic[i][j]][j] = cyclic[i][j + 1];
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
for (i = 0; i < nrepl; i++)
|
|
1179
|
+
{
|
|
1180
|
+
if (order[i][j] < 0)
|
|
1181
|
+
{
|
|
1182
|
+
order[i][j] = i; /* if it's not exchanging, it should stay this round*/
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
if (debug)
|
|
1188
|
+
{
|
|
1189
|
+
fprintf(debug, "Replica Exchange Order\n");
|
|
1190
|
+
for (i = 0; i < nrepl; i++)
|
|
1191
|
+
{
|
|
1192
|
+
fprintf(debug, "Replica %d:", i);
|
|
1193
|
+
for (j = 0; j < maxswap; j++)
|
|
1194
|
+
{
|
|
1195
|
+
if (order[i][j] < 0)
|
|
1196
|
+
{
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
fprintf(debug, "%2d", order[i][j]);
|
|
1200
|
+
}
|
|
1201
|
+
fprintf(debug, "\n");
|
|
1202
|
+
}
|
|
1203
|
+
fflush(debug);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
static void prepare_to_do_exchange(struct gmx_repl_ex* re, const int replica_id, int* maxswap, gmx_bool* bThisReplicaExchanged)
|
|
1208
|
+
{
|
|
1209
|
+
int i, j;
|
|
1210
|
+
/* Hold the cyclic decomposition of the (multiple) replica
|
|
1211
|
+
* exchange. */
|
|
1212
|
+
gmx_bool bAnyReplicaExchanged = FALSE;
|
|
1213
|
+
*bThisReplicaExchanged = FALSE;
|
|
1214
|
+
|
|
1215
|
+
for (i = 0; i < re->nrepl; i++)
|
|
1216
|
+
{
|
|
1217
|
+
if (re->destinations[i] != re->ind[i])
|
|
1218
|
+
{
|
|
1219
|
+
/* only mark as exchanged if the index has been shuffled */
|
|
1220
|
+
bAnyReplicaExchanged = TRUE;
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
if (bAnyReplicaExchanged)
|
|
1225
|
+
{
|
|
1226
|
+
/* reinitialize the placeholder arrays */
|
|
1227
|
+
for (i = 0; i < re->nrepl; i++)
|
|
1228
|
+
{
|
|
1229
|
+
for (j = 0; j < re->nrepl; j++)
|
|
1230
|
+
{
|
|
1231
|
+
re->cyclic[i][j] = -1;
|
|
1232
|
+
re->order[i][j] = -1;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/* Identify the cyclic decomposition of the permutation (very
|
|
1237
|
+
* fast if neighbor replica exchange). */
|
|
1238
|
+
cyclic_decomposition(re->destinations, re->cyclic, re->incycle, re->nrepl, maxswap);
|
|
1239
|
+
|
|
1240
|
+
/* Now translate the decomposition into a replica exchange
|
|
1241
|
+
* order at each step. */
|
|
1242
|
+
compute_exchange_order(re->cyclic, re->order, re->nrepl, *maxswap);
|
|
1243
|
+
|
|
1244
|
+
/* Did this replica do any exchange at any point? */
|
|
1245
|
+
for (j = 0; j < *maxswap; j++)
|
|
1246
|
+
{
|
|
1247
|
+
if (replica_id != re->order[replica_id][j])
|
|
1248
|
+
{
|
|
1249
|
+
*bThisReplicaExchanged = TRUE;
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
gmx_bool replica_exchange(FILE* fplog,
|
|
1257
|
+
const t_commrec* cr,
|
|
1258
|
+
const gmx_multisim_t* ms,
|
|
1259
|
+
struct gmx_repl_ex* re,
|
|
1260
|
+
t_state* state,
|
|
1261
|
+
const gmx_enerdata_t* enerd,
|
|
1262
|
+
t_state* state_local,
|
|
1263
|
+
int64_t step,
|
|
1264
|
+
real time)
|
|
1265
|
+
{
|
|
1266
|
+
int j;
|
|
1267
|
+
int replica_id = 0;
|
|
1268
|
+
int exchange_partner;
|
|
1269
|
+
int maxswap = 0;
|
|
1270
|
+
/* Number of rounds of exchanges needed to deal with any multiple
|
|
1271
|
+
* exchanges. */
|
|
1272
|
+
/* Where each replica ends up after the exchange attempt(s). */
|
|
1273
|
+
/* The order in which multiple exchanges will occur. */
|
|
1274
|
+
gmx_bool bThisReplicaExchanged = FALSE;
|
|
1275
|
+
|
|
1276
|
+
if (MASTER(cr))
|
|
1277
|
+
{
|
|
1278
|
+
replica_id = re->repl;
|
|
1279
|
+
test_for_replica_exchange(fplog, ms, re, enerd, det(state_local->box), step, time);
|
|
1280
|
+
prepare_to_do_exchange(re, replica_id, &maxswap, &bThisReplicaExchanged);
|
|
1281
|
+
}
|
|
1282
|
+
/* Do intra-simulation broadcast so all processors belonging to
|
|
1283
|
+
* each simulation know whether they need to participate in
|
|
1284
|
+
* collecting the state. Otherwise, they might as well get on with
|
|
1285
|
+
* the next thing to do. */
|
|
1286
|
+
if (haveDDAtomOrdering(*cr))
|
|
1287
|
+
{
|
|
1288
|
+
#if GMX_MPI
|
|
1289
|
+
MPI_Bcast(&bThisReplicaExchanged, sizeof(gmx_bool), MPI_BYTE, MASTERRANK(cr), cr->mpi_comm_mygroup);
|
|
1290
|
+
#endif
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
if (bThisReplicaExchanged)
|
|
1294
|
+
{
|
|
1295
|
+
/* Exchange the states */
|
|
1296
|
+
/* Collect the global state on the master node */
|
|
1297
|
+
if (haveDDAtomOrdering(*cr))
|
|
1298
|
+
{
|
|
1299
|
+
dd_collect_state(cr->dd, state_local, state);
|
|
1300
|
+
}
|
|
1301
|
+
else
|
|
1302
|
+
{
|
|
1303
|
+
copy_state_serial(state_local, state);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
if (MASTER(cr))
|
|
1307
|
+
{
|
|
1308
|
+
/* There will be only one swap cycle with standard replica
|
|
1309
|
+
* exchange, but there may be multiple swap cycles if we
|
|
1310
|
+
* allow multiple swaps. */
|
|
1311
|
+
|
|
1312
|
+
for (j = 0; j < maxswap; j++)
|
|
1313
|
+
{
|
|
1314
|
+
exchange_partner = re->order[replica_id][j];
|
|
1315
|
+
|
|
1316
|
+
if (exchange_partner != replica_id)
|
|
1317
|
+
{
|
|
1318
|
+
/* Exchange the global states between the master nodes */
|
|
1319
|
+
if (debug)
|
|
1320
|
+
{
|
|
1321
|
+
fprintf(debug, "Exchanging %d with %d\n", replica_id, exchange_partner);
|
|
1322
|
+
}
|
|
1323
|
+
exchange_state(ms, exchange_partner, state);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
/* For temperature-type replica exchange, we need to scale
|
|
1327
|
+
* the velocities. */
|
|
1328
|
+
if (re->type == ReplicaExchangeType::Temperature || re->type == ReplicaExchangeType::TemperatureLambda)
|
|
1329
|
+
{
|
|
1330
|
+
scale_velocities(
|
|
1331
|
+
state->v,
|
|
1332
|
+
std::sqrt(re->q[ReplicaExchangeType::Temperature][replica_id]
|
|
1333
|
+
/ re->q[ReplicaExchangeType::Temperature][re->destinations[replica_id]]));
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/* With domain decomposition the global state is distributed later */
|
|
1338
|
+
if (!haveDDAtomOrdering(*cr))
|
|
1339
|
+
{
|
|
1340
|
+
/* Copy the global state to the local state data structure */
|
|
1341
|
+
copy_state_serial(state, state_local);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
return bThisReplicaExchanged;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
void print_replica_exchange_statistics(FILE* fplog, struct gmx_repl_ex* re)
|
|
1349
|
+
{
|
|
1350
|
+
int i;
|
|
1351
|
+
|
|
1352
|
+
fprintf(fplog, "\nReplica exchange statistics\n");
|
|
1353
|
+
|
|
1354
|
+
if (re->nex == 0)
|
|
1355
|
+
{
|
|
1356
|
+
fprintf(fplog,
|
|
1357
|
+
"Repl %d attempts, %d odd, %d even\n",
|
|
1358
|
+
re->nattempt[0] + re->nattempt[1],
|
|
1359
|
+
re->nattempt[1],
|
|
1360
|
+
re->nattempt[0]);
|
|
1361
|
+
|
|
1362
|
+
fprintf(fplog, "Repl average probabilities:\n");
|
|
1363
|
+
for (i = 1; i < re->nrepl; i++)
|
|
1364
|
+
{
|
|
1365
|
+
if (re->nattempt[i % 2] == 0)
|
|
1366
|
+
{
|
|
1367
|
+
re->prob[i] = 0;
|
|
1368
|
+
}
|
|
1369
|
+
else
|
|
1370
|
+
{
|
|
1371
|
+
re->prob[i] = re->prob_sum[i] / re->nattempt[i % 2];
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
print_ind(fplog, "", re->nrepl, re->ind, nullptr);
|
|
1375
|
+
print_prob(fplog, "", re->nrepl, re->prob);
|
|
1376
|
+
|
|
1377
|
+
fprintf(fplog, "Repl number of exchanges:\n");
|
|
1378
|
+
print_ind(fplog, "", re->nrepl, re->ind, nullptr);
|
|
1379
|
+
print_count(fplog, "", re->nrepl, re->nexchange);
|
|
1380
|
+
|
|
1381
|
+
fprintf(fplog, "Repl average number of exchanges:\n");
|
|
1382
|
+
for (i = 1; i < re->nrepl; i++)
|
|
1383
|
+
{
|
|
1384
|
+
if (re->nattempt[i % 2] == 0)
|
|
1385
|
+
{
|
|
1386
|
+
re->prob[i] = 0;
|
|
1387
|
+
}
|
|
1388
|
+
else
|
|
1389
|
+
{
|
|
1390
|
+
re->prob[i] = (static_cast<real>(re->nexchange[i])) / re->nattempt[i % 2];
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
print_ind(fplog, "", re->nrepl, re->ind, nullptr);
|
|
1394
|
+
print_prob(fplog, "", re->nrepl, re->prob);
|
|
1395
|
+
|
|
1396
|
+
fprintf(fplog, "\n");
|
|
1397
|
+
}
|
|
1398
|
+
/* print the transition matrix */
|
|
1399
|
+
print_transition_matrix(fplog, re->nrepl, re->nmoves, re->nattempt);
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
//! \endcond
|