hillclimber 0.1.6__cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.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 +41 -0
- hillclimber/actions.py +53 -0
- hillclimber/analysis.py +590 -0
- hillclimber/biases.py +293 -0
- hillclimber/calc.py +22 -0
- hillclimber/cvs.py +1070 -0
- hillclimber/interfaces.py +133 -0
- hillclimber/metadynamics.py +416 -0
- hillclimber/nodes.py +6 -0
- hillclimber/opes.py +359 -0
- hillclimber/pycv.py +362 -0
- hillclimber/selectors.py +230 -0
- hillclimber/virtual_atoms.py +341 -0
- hillclimber-0.1.6.dist-info/METADATA +325 -0
- hillclimber-0.1.6.dist-info/RECORD +475 -0
- hillclimber-0.1.6.dist-info/WHEEL +6 -0
- hillclimber-0.1.6.dist-info/entry_points.txt +8 -0
- hillclimber-0.1.6.dist-info/licenses/LICENSE +165 -0
- hillclimber-0.1.6.dist-info/sboms/auditwheel.cdx.json +1 -0
- hillclimber.libs/libgomp-a49a47f9.so.1.0.0 +0 -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.so +0 -0
- plumed/_lib/lib/libplumed.a +0 -0
- plumed/_lib/lib/libplumed.so +0 -0
- plumed/_lib/lib/libplumedKernel.so +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 +179 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake +8 -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 +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc +8 -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 +5 -0
- plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
- plumed/_plumed_core.cpython-311-aarch64-linux-gnu.so +0 -0
- plumed/_plumed_core.cpython-312-aarch64-linux-gnu.so +0 -0
- plumed/_plumed_core.cpython-313-aarch64-linux-gnu.so +0 -0
- plumed/_plumed_core.cpython-314-aarch64-linux-gnu.so +0 -0
- plumed/_plumed_core.cpython-314t-aarch64-linux-gnu.so +0 -0
- plumedCommunications.cpython-311-aarch64-linux-gnu.so +0 -0
- plumedCommunications.cpython-312-aarch64-linux-gnu.so +0 -0
- plumedCommunications.cpython-313-aarch64-linux-gnu.so +0 -0
- plumedCommunications.cpython-314-aarch64-linux-gnu.so +0 -0
- plumedCommunications.cpython-314t-aarch64-linux-gnu.so +0 -0
- plumedCommunications.pyi +431 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2012-2023 The plumed team
|
|
3
|
+
(see the PEOPLE file at the root of the distribution for a list of names)
|
|
4
|
+
|
|
5
|
+
See http://www.plumed.org for more information.
|
|
6
|
+
|
|
7
|
+
This file is part of plumed, version 2.
|
|
8
|
+
|
|
9
|
+
plumed is free software: you can redistribute it and/or modify
|
|
10
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
(at your option) any later version.
|
|
13
|
+
|
|
14
|
+
plumed is distributed in the hope that it will be useful,
|
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
GNU Lesser General Public License for more details.
|
|
18
|
+
|
|
19
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
20
|
+
along with plumed. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
|
22
|
+
#ifndef __PLUMED_tools_Stopwatch_h
|
|
23
|
+
#define __PLUMED_tools_Stopwatch_h
|
|
24
|
+
|
|
25
|
+
#include "Exception.h"
|
|
26
|
+
#include "Tools.h"
|
|
27
|
+
#include <string>
|
|
28
|
+
#include <iosfwd>
|
|
29
|
+
#include <chrono>
|
|
30
|
+
|
|
31
|
+
namespace PLMD {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
\ingroup TOOLBOX
|
|
35
|
+
Class implementing stopwatch to time execution.
|
|
36
|
+
|
|
37
|
+
Each instance of this class is a container which
|
|
38
|
+
can keep track of several named stopwatches at
|
|
39
|
+
the same time. Access to the stopwatches
|
|
40
|
+
is obtained using start(), stop(), pause() methods,
|
|
41
|
+
giving as a parameter the name of the specific stopwatch.
|
|
42
|
+
Also an empty string can be used (un-named stopwatch).
|
|
43
|
+
Finally, all the times can be logged using << operator
|
|
44
|
+
|
|
45
|
+
\verbatim
|
|
46
|
+
#include "Stopwatch.h"
|
|
47
|
+
|
|
48
|
+
int main(){
|
|
49
|
+
Stopwatch sw;
|
|
50
|
+
sw.start();
|
|
51
|
+
|
|
52
|
+
sw.start("initialization");
|
|
53
|
+
// do initialization ...
|
|
54
|
+
sw.stop("initialization");
|
|
55
|
+
|
|
56
|
+
for(int i=0;i<100;i++){
|
|
57
|
+
sw.start("loop");
|
|
58
|
+
// do calculation
|
|
59
|
+
sw.stop("loop");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sw.stop();
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
\endverbatim
|
|
67
|
+
|
|
68
|
+
Using pause a stopwatch can be put on hold until
|
|
69
|
+
the next start:
|
|
70
|
+
|
|
71
|
+
\verbatim
|
|
72
|
+
#include "Stopwatch.h"
|
|
73
|
+
|
|
74
|
+
int main(){
|
|
75
|
+
Stopwatch sw;
|
|
76
|
+
sw.start();
|
|
77
|
+
|
|
78
|
+
sw.start("initialization");
|
|
79
|
+
// do initialization ...
|
|
80
|
+
sw.stop("initialization");
|
|
81
|
+
|
|
82
|
+
for(int i=0;i<100;i++){
|
|
83
|
+
sw.start("loop");
|
|
84
|
+
// do calculation
|
|
85
|
+
sw.pause("loop");
|
|
86
|
+
// here goes something that we do not want to include
|
|
87
|
+
sw.start("loop");
|
|
88
|
+
// do calculation
|
|
89
|
+
sw.stop("loop");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
sw.stop();
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
\endverbatim
|
|
97
|
+
|
|
98
|
+
Notice that as of PLUMED 2.5 it is possible to use a slightly modified
|
|
99
|
+
interface that allow for exception safety. In practice,
|
|
100
|
+
one can replace a pair of calls to Stopwatch::start() and Stopwatch::stop()
|
|
101
|
+
with a single call to Stopwatch::startStop(). This call will return an object
|
|
102
|
+
that, when goes out of scope, will stop the timer.
|
|
103
|
+
|
|
104
|
+
\notice The exception safety interace is highly recommended since it allows
|
|
105
|
+
to make sure that stopwatches are started and stopped consistently.
|
|
106
|
+
|
|
107
|
+
For instance the following
|
|
108
|
+
code
|
|
109
|
+
\verbatim
|
|
110
|
+
{
|
|
111
|
+
sw.start("A");
|
|
112
|
+
// any code
|
|
113
|
+
sw.stop("A");
|
|
114
|
+
}
|
|
115
|
+
\endverbatim
|
|
116
|
+
can be replaced with
|
|
117
|
+
\verbatim
|
|
118
|
+
{
|
|
119
|
+
auto sww=sw.startStop("A");
|
|
120
|
+
// any code
|
|
121
|
+
|
|
122
|
+
// stopwatch is stopped when sww goes out of scope
|
|
123
|
+
}
|
|
124
|
+
\endverbatim
|
|
125
|
+
Similarly, Stopwatch::startPause() can be used to replace a pair of
|
|
126
|
+
Stopwatch::start() and Stopwatch::pause().
|
|
127
|
+
|
|
128
|
+
The older syntax (explicitly calling `Stopwatch::start()` and `Stopwatch::pause()`) is still
|
|
129
|
+
allowed for backward compatibility.
|
|
130
|
+
|
|
131
|
+
Notice that the returned object is of type `Stopwatch::Handler`.
|
|
132
|
+
You might be willing to explicitly declare a `Stopwatch::Handler` (instead of using `auto`)
|
|
133
|
+
when you want to conditionally start the stopwatch. For instance:
|
|
134
|
+
\verbatim
|
|
135
|
+
{
|
|
136
|
+
Stopwatch::Handler handler;
|
|
137
|
+
if(you_want_to_time_this) handler=sw.startStop();
|
|
138
|
+
... do something ...
|
|
139
|
+
}
|
|
140
|
+
// in case it was started, the stopwatch will stop here, at the end of the block
|
|
141
|
+
// in case it was not started, nothing will happen
|
|
142
|
+
\endverbatim
|
|
143
|
+
|
|
144
|
+
A `Stopwatch::Handler` can not be copied but it can be moved (it behaves like a unique_ptr).
|
|
145
|
+
Moving it explicitly allows one to transfer it to another `Stopwatch::Handler` with a different scope.
|
|
146
|
+
For instance, in case you want to conditionally stop the stopwatch you might use something like this:
|
|
147
|
+
\verbatim
|
|
148
|
+
{
|
|
149
|
+
Stopwatch::Handler handler;
|
|
150
|
+
if(you_want_to_time_this) handler=sw.startStop();
|
|
151
|
+
... do something ...
|
|
152
|
+
if(you_want_to_stop_here) auto h2=std::move(handler);
|
|
153
|
+
// the previous instruction moves handler to h2 that is then destroyed, stopping the watch
|
|
154
|
+
// notice that if the stop was not started it will not stop.
|
|
155
|
+
... do something else ...
|
|
156
|
+
}
|
|
157
|
+
// in case it is running, the stopwatch will stop here, at the end of the block
|
|
158
|
+
\endverbatim
|
|
159
|
+
|
|
160
|
+
Finally, notice that in order to write the timers on an output file when the
|
|
161
|
+
Stopwatch is destroyed, one can store a reference to a PLMD::Log by passing it
|
|
162
|
+
to the Stopwatch constructor.
|
|
163
|
+
This will make sure timers are written also in case of a premature end.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
class Log;
|
|
167
|
+
|
|
168
|
+
/// Return an empty string.
|
|
169
|
+
/// Inline static so that it can store a static variable (for quicker access)
|
|
170
|
+
/// without adding a unique global symbol to a library including this header file.
|
|
171
|
+
inline static const std::string & StopwatchEmptyString() noexcept {
|
|
172
|
+
const static std::string s;
|
|
173
|
+
return s;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
class Stopwatch {
|
|
177
|
+
|
|
178
|
+
public:
|
|
179
|
+
/// Forward declaration
|
|
180
|
+
class Watch;
|
|
181
|
+
/// Auxiliary class for handling exception-safe start/pause and start/stop.
|
|
182
|
+
class Handler {
|
|
183
|
+
Watch* watch=nullptr;
|
|
184
|
+
/// stop (true) or pause (false).
|
|
185
|
+
/// might be changed to an enum if clearer.
|
|
186
|
+
bool stop=false;
|
|
187
|
+
/// Private constructor.
|
|
188
|
+
/// This is kept private to avoid misuse. Handler objects should
|
|
189
|
+
/// only be created using startPause() or startStop().
|
|
190
|
+
/// stop is required to know if the destructor should stop or pause the watch.
|
|
191
|
+
Handler(Watch* mywatch,bool dostop);
|
|
192
|
+
/// Allows usage of private constructor
|
|
193
|
+
friend class Stopwatch;
|
|
194
|
+
public:
|
|
195
|
+
/// Default constructor
|
|
196
|
+
Handler() = default;
|
|
197
|
+
/// Default copy constructor is deleted (not copyable)
|
|
198
|
+
Handler(const Handler & handler) = delete;
|
|
199
|
+
/// Default copy assignment is deleted (not copyable)
|
|
200
|
+
Handler & operator=(const Handler & handler) = delete;
|
|
201
|
+
/// Move constructor.
|
|
202
|
+
Handler(Handler && handler) noexcept;
|
|
203
|
+
/// Move assignment.
|
|
204
|
+
Handler & operator=(Handler && handler) noexcept;
|
|
205
|
+
/// Destructor either stops or pauses the watch
|
|
206
|
+
~Handler();
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/// Class to store a single stopwatch.
|
|
210
|
+
/// Class Stopwatch contains a collection of them
|
|
211
|
+
class Watch {
|
|
212
|
+
/// Instant in time when Watch was started last time
|
|
213
|
+
std::chrono::time_point<std::chrono::high_resolution_clock> lastStart;
|
|
214
|
+
/// Total accumulated time, in nanoseconds
|
|
215
|
+
long long int total = 0;
|
|
216
|
+
/// Accumulated time for this lap, in nanoseconds
|
|
217
|
+
long long int lap = 0;
|
|
218
|
+
/// Slowest lap so far, in nanoseconds
|
|
219
|
+
long long int max = 0;
|
|
220
|
+
/// Fastest lap so far, in nanoseconds
|
|
221
|
+
long long int min = 0;
|
|
222
|
+
/// Total number of cycles
|
|
223
|
+
unsigned cycles = 0;
|
|
224
|
+
/// count how many times Watch was started (+1) or stopped/paused (-1).
|
|
225
|
+
unsigned running = 0;
|
|
226
|
+
enum class State {started, stopped, paused};
|
|
227
|
+
/// last lap
|
|
228
|
+
long long int lastLap = 0;
|
|
229
|
+
/// keep track of state
|
|
230
|
+
State state = State::stopped;
|
|
231
|
+
/// Allows access to internal data
|
|
232
|
+
friend class Stopwatch;
|
|
233
|
+
public:
|
|
234
|
+
/// start the watch
|
|
235
|
+
Watch & start();
|
|
236
|
+
/// stop the watch
|
|
237
|
+
Watch & stop();
|
|
238
|
+
/// pause the watch
|
|
239
|
+
Watch & pause();
|
|
240
|
+
/// returns a start-stop handler
|
|
241
|
+
Handler startStop();
|
|
242
|
+
/// returns a start-pause handler
|
|
243
|
+
Handler startPause();
|
|
244
|
+
/// returns the time for the last cycle
|
|
245
|
+
long long int getLastCycle() noexcept;
|
|
246
|
+
/// returns the total time
|
|
247
|
+
long long int getTotal() noexcept;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
private:
|
|
251
|
+
|
|
252
|
+
/// Pointer to a log file.
|
|
253
|
+
/// If set, the stopwatch is logged in its destructor.
|
|
254
|
+
Log*mylog=nullptr;
|
|
255
|
+
|
|
256
|
+
/// List of watches.
|
|
257
|
+
/// Each watch is labeled with a string.
|
|
258
|
+
Tools::FastStringUnorderedMap<Watch> watches;
|
|
259
|
+
|
|
260
|
+
/// Log over stream os.
|
|
261
|
+
std::ostream& log(std::ostream& os)const;
|
|
262
|
+
|
|
263
|
+
public:
|
|
264
|
+
// Constructor.
|
|
265
|
+
explicit Stopwatch() = default;
|
|
266
|
+
// Constructor.
|
|
267
|
+
// When destructing, stopwatch is logged.
|
|
268
|
+
// Make sure that log survives stopwatch. Typically, it should be declared earlier, in order
|
|
269
|
+
// to be destroyed later.
|
|
270
|
+
explicit Stopwatch(Log&log): mylog(&log) {}
|
|
271
|
+
// Destructor.
|
|
272
|
+
~Stopwatch();
|
|
273
|
+
/// Deleted copy
|
|
274
|
+
Stopwatch(const Stopwatch&) = delete;
|
|
275
|
+
/// Deleted assignment
|
|
276
|
+
Stopwatch& operator=(const Stopwatch&) = delete;
|
|
277
|
+
/// Move constructor
|
|
278
|
+
Stopwatch(Stopwatch&&) noexcept;
|
|
279
|
+
/// Move assignment
|
|
280
|
+
Stopwatch& operator=(Stopwatch&&) noexcept;
|
|
281
|
+
/// Start timer named "name"
|
|
282
|
+
Stopwatch& start(const std::string_view&name=StopwatchEmptyString());
|
|
283
|
+
/// Stop timer named "name"
|
|
284
|
+
Stopwatch& stop(const std::string_view&name=StopwatchEmptyString());
|
|
285
|
+
/// Pause timer named "name"
|
|
286
|
+
Stopwatch& pause(const std::string_view&name=StopwatchEmptyString());
|
|
287
|
+
/// Dump all timers on an ostream
|
|
288
|
+
friend std::ostream& operator<<(std::ostream&,const Stopwatch&);
|
|
289
|
+
/// Start with exception safety, then stop.
|
|
290
|
+
/// Starts the Stopwatch and returns an object that, when goes out of scope,
|
|
291
|
+
/// stops the watch. This allows Stopwatch to be started and stopped in
|
|
292
|
+
/// an exception safe manner.
|
|
293
|
+
Handler startStop(const std::string_view&name=StopwatchEmptyString());
|
|
294
|
+
/// Start with exception safety, then pause.
|
|
295
|
+
/// Starts the Stopwatch and returns an object that, when goes out of scope,
|
|
296
|
+
/// pauses the watch. This allows Stopwatch to be started and paused in
|
|
297
|
+
/// an exception safe manner.
|
|
298
|
+
Handler startPause(const std::string_view&name=StopwatchEmptyString());
|
|
299
|
+
/// Return the last completed cycle
|
|
300
|
+
long long int getLastCycle(const std::string_view&name=StopwatchEmptyString());
|
|
301
|
+
/// returns the total time
|
|
302
|
+
long long int getTotal(const std::string_view&name=StopwatchEmptyString());
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
inline
|
|
306
|
+
Stopwatch::Handler::Handler(Watch* mywatch,bool dostop) :
|
|
307
|
+
watch(mywatch),
|
|
308
|
+
stop(dostop) {
|
|
309
|
+
watch->start();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
inline
|
|
313
|
+
Stopwatch::Handler::~Handler() {
|
|
314
|
+
if(watch) {
|
|
315
|
+
if(stop) {
|
|
316
|
+
watch->stop();
|
|
317
|
+
} else {
|
|
318
|
+
watch->pause();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
inline
|
|
324
|
+
Stopwatch& Stopwatch::start(const std::string_view & name) {
|
|
325
|
+
watches[name].start();
|
|
326
|
+
return *this;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
inline
|
|
330
|
+
Stopwatch& Stopwatch::stop(const std::string_view & name) {
|
|
331
|
+
watches[name].stop();
|
|
332
|
+
return *this;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
inline
|
|
336
|
+
Stopwatch& Stopwatch::pause(const std::string_view & name) {
|
|
337
|
+
watches[name].pause();
|
|
338
|
+
return *this;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
inline
|
|
342
|
+
Stopwatch::Handler Stopwatch::startStop(const std::string_view&name) {
|
|
343
|
+
return watches[name].startStop();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
inline
|
|
347
|
+
Stopwatch::Handler Stopwatch::startPause(const std::string_view&name) {
|
|
348
|
+
return watches[name].startPause();
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
inline
|
|
352
|
+
long long int Stopwatch::getLastCycle(const std::string_view&name) {
|
|
353
|
+
return watches[name].getLastCycle();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
inline
|
|
357
|
+
long long int Stopwatch::getTotal(const std::string_view&name) {
|
|
358
|
+
return watches[name].getTotal();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
inline
|
|
362
|
+
Stopwatch::Handler::Handler(Handler && handler) noexcept :
|
|
363
|
+
watch(handler.watch),
|
|
364
|
+
stop(handler.stop) {
|
|
365
|
+
handler.watch=nullptr;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
inline
|
|
369
|
+
Stopwatch::Handler & Stopwatch::Handler::operator=(Handler && handler) noexcept {
|
|
370
|
+
if(this!=&handler) {
|
|
371
|
+
if(watch) {
|
|
372
|
+
try {
|
|
373
|
+
if(stop) {
|
|
374
|
+
watch->stop();
|
|
375
|
+
} else {
|
|
376
|
+
watch->pause();
|
|
377
|
+
}
|
|
378
|
+
} catch(...) {
|
|
379
|
+
// this is to avoid problems with cppcheck, given than this method is declared as
|
|
380
|
+
// noexcept and stop and pause might throw in case of an internal bug
|
|
381
|
+
std::terminate();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
watch=handler.watch;
|
|
385
|
+
stop=handler.stop;
|
|
386
|
+
handler.watch=nullptr;
|
|
387
|
+
}
|
|
388
|
+
return *this;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
inline
|
|
392
|
+
Stopwatch::Watch & Stopwatch::Watch::start() {
|
|
393
|
+
state=State::started;
|
|
394
|
+
running++;
|
|
395
|
+
lastStart=std::chrono::high_resolution_clock::now();
|
|
396
|
+
return *this;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
inline
|
|
400
|
+
Stopwatch::Watch & Stopwatch::Watch::stop() {
|
|
401
|
+
pause();
|
|
402
|
+
state=State::stopped;
|
|
403
|
+
cycles++;
|
|
404
|
+
total+=lap;
|
|
405
|
+
if(lap>max) {
|
|
406
|
+
max=lap;
|
|
407
|
+
}
|
|
408
|
+
if(min>lap || cycles==1) {
|
|
409
|
+
min=lap;
|
|
410
|
+
}
|
|
411
|
+
lastLap=lap;
|
|
412
|
+
lap=0;
|
|
413
|
+
return *this;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
inline
|
|
417
|
+
Stopwatch::Watch & Stopwatch::Watch::pause() {
|
|
418
|
+
state=State::paused;
|
|
419
|
+
// In case of an internal bug (non matching start stop within the startStop or startPause interface)
|
|
420
|
+
// this assertion could fail in a destructor.
|
|
421
|
+
// If this happens, the program should crash immediately
|
|
422
|
+
plumed_assert(running>0) << "Non matching start/pause or start/stop commands in a Stopwatch";
|
|
423
|
+
running--;
|
|
424
|
+
// notice: with exception safety the following might be converted to a plain error.
|
|
425
|
+
// I leave it like this for now:
|
|
426
|
+
if(running!=0) {
|
|
427
|
+
return *this;
|
|
428
|
+
}
|
|
429
|
+
auto t=std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now()-lastStart);
|
|
430
|
+
lap+=t.count();
|
|
431
|
+
return *this;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
inline
|
|
435
|
+
Stopwatch::Handler Stopwatch::Watch::startStop() {
|
|
436
|
+
return Handler( this,true );
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
inline
|
|
440
|
+
Stopwatch::Handler Stopwatch::Watch::startPause() {
|
|
441
|
+
return Handler( this,false );
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
inline
|
|
445
|
+
long long int Stopwatch::Watch::getLastCycle() noexcept {
|
|
446
|
+
return lastLap;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
inline
|
|
450
|
+
long long int Stopwatch::Watch::getTotal() noexcept {
|
|
451
|
+
return total;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
inline
|
|
455
|
+
Stopwatch::Stopwatch(Stopwatch&& other) noexcept:
|
|
456
|
+
mylog(other.mylog),
|
|
457
|
+
watches(std::move(other.watches)) {
|
|
458
|
+
other.mylog=nullptr;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
inline
|
|
462
|
+
Stopwatch& Stopwatch::operator=(Stopwatch&& other) noexcept {
|
|
463
|
+
if(this!=&other) {
|
|
464
|
+
mylog=other.mylog;
|
|
465
|
+
watches=std::move(other.watches);
|
|
466
|
+
other.mylog=nullptr;
|
|
467
|
+
}
|
|
468
|
+
return *this;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
#endif
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2019-2023 The plumed team
|
|
3
|
+
(see the PEOPLE file at the root of the distribution for a list of names)
|
|
4
|
+
|
|
5
|
+
See http://www.plumed.org for more information.
|
|
6
|
+
|
|
7
|
+
This file is part of plumed, version 2.
|
|
8
|
+
|
|
9
|
+
plumed is free software: you can redistribute it and/or modify
|
|
10
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
(at your option) any later version.
|
|
13
|
+
|
|
14
|
+
plumed is distributed in the hope that it will be useful,
|
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
GNU Lesser General Public License for more details.
|
|
18
|
+
|
|
19
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
20
|
+
along with plumed. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
|
22
|
+
#ifndef __PLUMED_tools_Subprocess_h
|
|
23
|
+
#define __PLUMED_tools_Subprocess_h
|
|
24
|
+
|
|
25
|
+
#include "OFile.h"
|
|
26
|
+
#include "IFile.h"
|
|
27
|
+
#include <string>
|
|
28
|
+
#include <cstdio>
|
|
29
|
+
#include <memory>
|
|
30
|
+
|
|
31
|
+
namespace PLMD {
|
|
32
|
+
|
|
33
|
+
/// Small class to avoid including unistd.h here
|
|
34
|
+
class SubprocessPid;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
Class managing a subprocess.
|
|
38
|
+
|
|
39
|
+
The subprocess is launched and one can interact with it through a pipe.
|
|
40
|
+
|
|
41
|
+
In order not to consume resources, it might be possible to use this syntax:
|
|
42
|
+
|
|
43
|
+
\verbatim
|
|
44
|
+
// at construction:
|
|
45
|
+
Subprocess sp;
|
|
46
|
+
sp.stop();
|
|
47
|
+
|
|
48
|
+
// when needed
|
|
49
|
+
{
|
|
50
|
+
auto h=sp.contStop();
|
|
51
|
+
sp<<"command\n";
|
|
52
|
+
sp.flush();
|
|
53
|
+
sp.getline(answer);
|
|
54
|
+
}
|
|
55
|
+
// when h goes out of scope, subprocess is stopped again.
|
|
56
|
+
// If an exception is raised in the block, the subprocess is stopped as well.
|
|
57
|
+
\endverbatim
|
|
58
|
+
|
|
59
|
+
\warning
|
|
60
|
+
Currently `stop` and `cont` are giving problems with some MPI implementation,
|
|
61
|
+
In addition, notice that the stop signal is only sent to the child process and
|
|
62
|
+
not to the subsequently spawn processes, so it might not work as intended.
|
|
63
|
+
This feature is left here but is probably no a good idea to use it.
|
|
64
|
+
It can be enabled with `export PLUMED_ENABLE_SIGNALS=1`.
|
|
65
|
+
|
|
66
|
+
*/
|
|
67
|
+
class Subprocess {
|
|
68
|
+
/// Process ID.
|
|
69
|
+
/// We store this rather than pid_t to avoid including <unistd.h> in this header file.
|
|
70
|
+
/// This remains nullptr in the child process.
|
|
71
|
+
std::unique_ptr<SubprocessPid> pid;
|
|
72
|
+
/// File descriptor, parent to child
|
|
73
|
+
int fpc=0;
|
|
74
|
+
/// File descriptor, child to parent
|
|
75
|
+
int fcp=0;
|
|
76
|
+
/// File pointer, parent to child
|
|
77
|
+
FILE* fppc=NULL;
|
|
78
|
+
/// File pointer, child to parent
|
|
79
|
+
FILE* fpcp=NULL;
|
|
80
|
+
/// PLUMED file object, parent to child.
|
|
81
|
+
/// Used to simplify formatting
|
|
82
|
+
OFile parent_to_child;
|
|
83
|
+
/// PLUMED file object, child to parent.
|
|
84
|
+
/// Used to simplify formatting
|
|
85
|
+
IFile child_to_parent;
|
|
86
|
+
public:
|
|
87
|
+
/// Class used to cont/stop a Subprocess in an exception safe manner.
|
|
88
|
+
class Handler {
|
|
89
|
+
Subprocess* sp=nullptr;
|
|
90
|
+
/// Private constructor.
|
|
91
|
+
/// Only to be called by Subprocess::contStop()
|
|
92
|
+
explicit Handler(Subprocess* sp) noexcept;
|
|
93
|
+
friend class Subprocess;
|
|
94
|
+
public:
|
|
95
|
+
/// Default constructor
|
|
96
|
+
Handler() = default;
|
|
97
|
+
/// Destructor stops the subprocess.
|
|
98
|
+
~Handler();
|
|
99
|
+
/// Default copy constructor is deleted (not copyable)
|
|
100
|
+
Handler(const Handler &) = delete;
|
|
101
|
+
/// Default copy assignment is deleted (not copyable)
|
|
102
|
+
Handler & operator=(const Handler & handler) = delete;
|
|
103
|
+
/// Move constructor.
|
|
104
|
+
Handler(Handler &&) noexcept;
|
|
105
|
+
/// Move assignment.
|
|
106
|
+
Handler & operator=(Handler && handler) noexcept;
|
|
107
|
+
};
|
|
108
|
+
/// Constructor with a command line.
|
|
109
|
+
explicit Subprocess(const std::string & cmd);
|
|
110
|
+
/// Destructor
|
|
111
|
+
~Subprocess();
|
|
112
|
+
/// Flush communication to process.
|
|
113
|
+
void flush();
|
|
114
|
+
/// Check if subprocess facilities are available.
|
|
115
|
+
/// If it returns false, any call to Subprocess constructor will raise an exception.
|
|
116
|
+
static bool available() noexcept;
|
|
117
|
+
/// Get a line from the subprocess.
|
|
118
|
+
Subprocess & getline(std::string &);
|
|
119
|
+
/// Write something to the subprocess.
|
|
120
|
+
template <class T> friend Subprocess& operator<<(Subprocess& ep,const T &t);
|
|
121
|
+
/// Send a SIGCONT to the subprocess.
|
|
122
|
+
/// Better used through contStop() method.
|
|
123
|
+
void cont() noexcept;
|
|
124
|
+
/// Send a SIGSTOP to the subprocess.
|
|
125
|
+
/// Better used through contStop() method.
|
|
126
|
+
void stop() noexcept;
|
|
127
|
+
/// Returns a handler to temporarily resume the process.
|
|
128
|
+
Handler contStop() noexcept {
|
|
129
|
+
return Handler(this);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
template <class T>
|
|
134
|
+
Subprocess& operator<<(Subprocess& ep,const T &t) {
|
|
135
|
+
ep.parent_to_child<<t;
|
|
136
|
+
return ep;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
#endif
|
|
142
|
+
|