hillclimber 0.1.6__cp313-cp313-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 +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 +468 -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
- 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
- plumedCommunications.cpython-311-darwin.so +0 -0
- plumedCommunications.cpython-312-darwin.so +0 -0
- plumedCommunications.cpython-313-darwin.so +0 -0
- plumedCommunications.pyi +431 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2011-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_NeighborList_h //{
|
|
23
|
+
#define __PLUMED_tools_NeighborList_h
|
|
24
|
+
|
|
25
|
+
#include "Vector.h"
|
|
26
|
+
#include "AtomNumber.h"
|
|
27
|
+
|
|
28
|
+
#include <vector>
|
|
29
|
+
|
|
30
|
+
namespace PLMD {
|
|
31
|
+
|
|
32
|
+
class Pbc;
|
|
33
|
+
class Communicator;
|
|
34
|
+
|
|
35
|
+
/// \ingroup TOOLBOX
|
|
36
|
+
/// A class that implements neighbor lists from two lists or a single list of atoms
|
|
37
|
+
class NeighborList {
|
|
38
|
+
public:
|
|
39
|
+
using pairIDs=std::pair<unsigned,unsigned>;
|
|
40
|
+
using pairAtomNumbers=std::pair<PLMD::AtomNumber,PLMD::AtomNumber>;
|
|
41
|
+
private:
|
|
42
|
+
enum class NNStyle {Pair,TwoList,SingleList};
|
|
43
|
+
bool reduced=false;
|
|
44
|
+
bool serial_;
|
|
45
|
+
bool do_pbc_;
|
|
46
|
+
NNStyle style_;
|
|
47
|
+
const PLMD::Pbc* pbc_;
|
|
48
|
+
Communicator& comm;
|
|
49
|
+
std::vector<PLMD::AtomNumber> fullatomlist_{};
|
|
50
|
+
std::vector<PLMD::AtomNumber> requestlist_{};
|
|
51
|
+
std::vector<pairIDs > neighbors_{};
|
|
52
|
+
double distance_;
|
|
53
|
+
size_t nlist0_=0;
|
|
54
|
+
size_t nlist1_=0;
|
|
55
|
+
size_t nallpairs_;
|
|
56
|
+
unsigned stride_=0;
|
|
57
|
+
unsigned lastupdate_=0;
|
|
58
|
+
/// Initialize the neighbor list with all possible pairs
|
|
59
|
+
void initialize();
|
|
60
|
+
/// Return the pair of indexes in the positions array
|
|
61
|
+
/// of the two atoms forming the i-th pair among all possible pairs
|
|
62
|
+
pairIDs getIndexPair(unsigned i);
|
|
63
|
+
/// Extract the list of atoms from the current list of close pairs
|
|
64
|
+
void setRequestList();
|
|
65
|
+
public:
|
|
66
|
+
NeighborList(const std::vector<PLMD::AtomNumber>& list0,
|
|
67
|
+
const std::vector<PLMD::AtomNumber>& list1,
|
|
68
|
+
bool serial,
|
|
69
|
+
bool do_pair,
|
|
70
|
+
bool do_pbc,
|
|
71
|
+
const PLMD::Pbc& pbc,
|
|
72
|
+
Communicator &cm,
|
|
73
|
+
double distance=1.0e+30,
|
|
74
|
+
unsigned stride=0);
|
|
75
|
+
NeighborList(const std::vector<PLMD::AtomNumber>& list0,
|
|
76
|
+
bool serial,
|
|
77
|
+
bool do_pbc,
|
|
78
|
+
const PLMD::Pbc& pbc,
|
|
79
|
+
Communicator &cm,
|
|
80
|
+
double distance=1.0e+30,
|
|
81
|
+
unsigned stride=0);
|
|
82
|
+
~NeighborList();
|
|
83
|
+
/// Return the list of all atoms. These are needed to rebuild the neighbor list.
|
|
84
|
+
std::vector<PLMD::AtomNumber>& getFullAtomList();
|
|
85
|
+
/// Update the indexes in the neighbor list to match the
|
|
86
|
+
/// ordering in the new positions array
|
|
87
|
+
/// and return the new list of atoms that must be requested to the main code
|
|
88
|
+
std::vector<PLMD::AtomNumber>& getReducedAtomList();
|
|
89
|
+
/// Update the neighbor list and prepare the new
|
|
90
|
+
/// list of atoms that will be requested to the main code
|
|
91
|
+
void update(const std::vector<PLMD::Vector>& positions);
|
|
92
|
+
/// Get the update stride of the neighbor list
|
|
93
|
+
unsigned getStride() const;
|
|
94
|
+
/// Get the last step in which the neighbor list was updated
|
|
95
|
+
unsigned getLastUpdate() const;
|
|
96
|
+
/// Set the step of the last update
|
|
97
|
+
void setLastUpdate(unsigned step);
|
|
98
|
+
/// Get the size of the neighbor list
|
|
99
|
+
unsigned size() const;
|
|
100
|
+
/// Get the distance used to create the neighbor list
|
|
101
|
+
double distance() const;
|
|
102
|
+
/// Get the i-th pair of the neighbor list
|
|
103
|
+
pairIDs getClosePair(unsigned i) const;
|
|
104
|
+
/// Get the list of neighbors of the i-th atom
|
|
105
|
+
std::vector<unsigned> getNeighbors(unsigned i);
|
|
106
|
+
/// Get the i-th pair of AtomNumbers from the neighbor list
|
|
107
|
+
pairAtomNumbers getClosePairAtomNumber(unsigned i) const;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
} // namespace PLMD
|
|
111
|
+
|
|
112
|
+
#endif //__PLUMED_tools_NeighborList_h }
|
|
@@ -0,0 +1,286 @@
|
|
|
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_OFile_h
|
|
23
|
+
#define __PLUMED_tools_OFile_h
|
|
24
|
+
|
|
25
|
+
#include "FileBase.h"
|
|
26
|
+
#include <vector>
|
|
27
|
+
#include <sstream>
|
|
28
|
+
#include <memory>
|
|
29
|
+
#include <cstddef>
|
|
30
|
+
|
|
31
|
+
namespace PLMD {
|
|
32
|
+
|
|
33
|
+
class Value;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
\ingroup TOOLBOX
|
|
37
|
+
Class for output files
|
|
38
|
+
|
|
39
|
+
This class provides features similar to those in the standard C "FILE*" type,
|
|
40
|
+
but only for sequential output. See IFile for sequential input.
|
|
41
|
+
|
|
42
|
+
See the example here for a possible use:
|
|
43
|
+
\verbatim
|
|
44
|
+
#include "File.h"
|
|
45
|
+
|
|
46
|
+
int main(){
|
|
47
|
+
PLMD::OFile pof;
|
|
48
|
+
pof.open("ciao");
|
|
49
|
+
pof.printf("%s\n","test1");
|
|
50
|
+
pof.setLinePrefix("plumed: ");
|
|
51
|
+
pof.printf("%s\n","test2");
|
|
52
|
+
pof.setLinePrefix("");
|
|
53
|
+
pof.addConstantField("x2").printField("x2",67.0);
|
|
54
|
+
pof.printField("x1",10.0).printField("x3",20.12345678901234567890).printField();
|
|
55
|
+
pof.printField("x1",10.0).printField("x3",-1e70*20.12345678901234567890).printField();
|
|
56
|
+
pof.printField("x3",10.0).printField("x2",777.0).printField("x1",-1e70*20.12345678901234567890).printField();
|
|
57
|
+
pof.printField("x3",67.0).printField("x1",18.0).printField();
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
\endverbatim
|
|
61
|
+
|
|
62
|
+
This program is expected to produce a file "ciao" which reads
|
|
63
|
+
\verbatim
|
|
64
|
+
test1
|
|
65
|
+
plumed: test2
|
|
66
|
+
#! FIELDS x1 x3
|
|
67
|
+
#! SET x2 67
|
|
68
|
+
10 20.12345678901234
|
|
69
|
+
10 -2.012345678901235e+71
|
|
70
|
+
#! FIELDS x1 x3
|
|
71
|
+
#! SET x2 777
|
|
72
|
+
-2.012345678901235e+71 10
|
|
73
|
+
18 67
|
|
74
|
+
\endverbatim
|
|
75
|
+
|
|
76
|
+
Notes
|
|
77
|
+
- "x2" is declared as "constant", which means that it is written using the "SET"
|
|
78
|
+
keyword. Thus, everytime it is modified, all the headers are repeated in the output file.
|
|
79
|
+
- printField() without arguments is used as a "newline".
|
|
80
|
+
- most methods return a reference to the OFile itself, to allow chaining many calls on the same line
|
|
81
|
+
(this is similar to << operator in std::ostream)
|
|
82
|
+
|
|
83
|
+
\section using-correctly-ofile Using correctly OFile in PLUMED
|
|
84
|
+
|
|
85
|
+
When a OFile object is used in PLUMED it can be convenient to link() it
|
|
86
|
+
to the Action object where it is defined, or to the PlumedMain object.
|
|
87
|
+
This will save in the OFile a pointer to the linked object and will
|
|
88
|
+
allow to have some extra information. E.g., if PLUMED is restarting,
|
|
89
|
+
files will be appended. Notice that one can enforce this behavior using
|
|
90
|
+
the enforceRestart() method before opening a file.
|
|
91
|
+
|
|
92
|
+
To have all files managed consistently, it is important to use OFile in the proper way.
|
|
93
|
+
This should allow multi-replica plumed, restart and backups to work in
|
|
94
|
+
the expected way. For this reason all the operations in OFile and IFile
|
|
95
|
+
are synchronizing all the processors of the group, so call to OFile functions
|
|
96
|
+
should always be performed by all processes; for this reason is also not useful
|
|
97
|
+
to use Log for debugging because only master threads will actually write.
|
|
98
|
+
For debugging is better to use the standard stderr.
|
|
99
|
+
|
|
100
|
+
\verbatim
|
|
101
|
+
int main(){
|
|
102
|
+
// this is a growing file, containing a full history
|
|
103
|
+
// (frames are appended, as in traditional HILLS and COLVAR)
|
|
104
|
+
OFile grw;
|
|
105
|
+
// this is a single-snapshopt file used e.g. for checkpointing
|
|
106
|
+
// (rewritten every time)
|
|
107
|
+
OFile snp;
|
|
108
|
+
|
|
109
|
+
// open both files at the beginning
|
|
110
|
+
// (will go in \ref Action constructor)
|
|
111
|
+
grw.open("growing");
|
|
112
|
+
snp.open("snapshot");
|
|
113
|
+
|
|
114
|
+
// trajectory loop
|
|
115
|
+
for(int i=0;i<nsteps;i++){
|
|
116
|
+
|
|
117
|
+
// files should be written in the update() method of an \ref Action
|
|
118
|
+
|
|
119
|
+
// write on growing file
|
|
120
|
+
grw<<"data at step "<<i<<\n";
|
|
121
|
+
|
|
122
|
+
// flushing
|
|
123
|
+
// it takes time, so do it only if data is critical
|
|
124
|
+
// better to leave this choice to the user with the FLUSH keyword
|
|
125
|
+
// grw.flush();
|
|
126
|
+
|
|
127
|
+
// write on snapshot file
|
|
128
|
+
snp.rewind();
|
|
129
|
+
snp<<"snapshot at step "<<i<<"\n";
|
|
130
|
+
snp.flush();
|
|
131
|
+
// the only difference is that snp is rewound
|
|
132
|
+
// notice that it should be rewound just before writing
|
|
133
|
+
// because rewind is going to move the file out of the way
|
|
134
|
+
// to have a safe copy of the file ("bck.last.filename")
|
|
135
|
+
// Also notice that snapshots should be flushed
|
|
136
|
+
// for this reason, it is better to write them only
|
|
137
|
+
// rarely to avoid excessive slow down
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
\notice
|
|
143
|
+
Notice that it is not necessary to explicitely close files, since they are closed implicitly
|
|
144
|
+
when the object goes out of scope. In case you need to explicitly close the file before it is
|
|
145
|
+
destroyed, please check it the procedure is exception safe and, if necessary, add some `try/catch`
|
|
146
|
+
statement.
|
|
147
|
+
|
|
148
|
+
\endverbatim
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
class OFile:
|
|
152
|
+
public virtual FileBase {
|
|
153
|
+
/// Pointer to a linked OFile.
|
|
154
|
+
/// see link(OFile&)
|
|
155
|
+
OFile* linked;
|
|
156
|
+
/// Internal buffer for printf
|
|
157
|
+
std::vector<char> buffer_string;
|
|
158
|
+
/// Internal buffer (generic use)
|
|
159
|
+
std::vector<char> buffer;
|
|
160
|
+
/// Internal buffer length
|
|
161
|
+
int buflen;
|
|
162
|
+
/// This variables stores the actual buffer length
|
|
163
|
+
int actual_buffer_length;
|
|
164
|
+
/// Class identifying a single field for fielded output
|
|
165
|
+
class Field:
|
|
166
|
+
public FieldBase {
|
|
167
|
+
};
|
|
168
|
+
/// Low-level write
|
|
169
|
+
std::size_t llwrite(const char*,std::size_t);
|
|
170
|
+
/// True if fields has changed.
|
|
171
|
+
/// This could be due to a change in the list of fields or a reset
|
|
172
|
+
/// of a nominally constant field
|
|
173
|
+
bool fieldChanged;
|
|
174
|
+
/// Format for fields writing
|
|
175
|
+
std::string fieldFmt;
|
|
176
|
+
/// All the previously defined variable fields
|
|
177
|
+
std::vector<Field> previous_fields;
|
|
178
|
+
/// All the defined variable fields
|
|
179
|
+
std::vector<Field> fields;
|
|
180
|
+
/// All the defined constant fields
|
|
181
|
+
std::vector<Field> const_fields;
|
|
182
|
+
/// Prefix for line (e.g. "PLUMED: ")
|
|
183
|
+
std::string linePrefix;
|
|
184
|
+
/// Temporary ostringstream for << output
|
|
185
|
+
std::ostringstream oss;
|
|
186
|
+
/// The string used for backing up files
|
|
187
|
+
std::string backstring;
|
|
188
|
+
/// Find field index given name
|
|
189
|
+
unsigned findField(const std::string&name)const;
|
|
190
|
+
/// check if we are restarting
|
|
191
|
+
bool checkRestart()const;
|
|
192
|
+
/// True if restart behavior should be forced
|
|
193
|
+
bool enforceRestart_;
|
|
194
|
+
/// True if backup behavior (i.e. non restart) should be forced
|
|
195
|
+
bool enforceBackup_;
|
|
196
|
+
public:
|
|
197
|
+
/// Constructor
|
|
198
|
+
OFile();
|
|
199
|
+
/// Allows overloading of link
|
|
200
|
+
using FileBase::link;
|
|
201
|
+
/// Allows overloading of open
|
|
202
|
+
using FileBase::open;
|
|
203
|
+
/// Allows linking this OFile to another one.
|
|
204
|
+
/// In this way, everything written to this OFile will be immediately
|
|
205
|
+
/// written on the linked OFile. Notice that a OFile should
|
|
206
|
+
/// be either opened explicitly, linked to a FILE or linked to a OFile
|
|
207
|
+
OFile& link(OFile&);
|
|
208
|
+
/// Set the string name to be used for automatic backup
|
|
209
|
+
void setBackupString( const std::string& );
|
|
210
|
+
/// Backup a file by giving it a different name
|
|
211
|
+
void backupFile( const std::string& bstring, const std::string& fname );
|
|
212
|
+
/// This backs up all the files that would have been created with the
|
|
213
|
+
/// name str. It is used in analysis when you are not restarting. Analysis
|
|
214
|
+
/// output files at different times, which are names analysis.0.<filename>,
|
|
215
|
+
/// analysis.1.<filename> and <filename>, are backed up to bck.0.analysis.0.<filename>,
|
|
216
|
+
/// bck.0.analysis.1.<filename> and bck.0.<filename>
|
|
217
|
+
void backupAllFiles( const std::string& str );
|
|
218
|
+
/// Opens the file using automatic append/backup
|
|
219
|
+
OFile& open(const std::string&name) override;
|
|
220
|
+
/// Set the prefix for output.
|
|
221
|
+
/// Typically "PLUMED: ". Notice that lines with a prefix cannot
|
|
222
|
+
/// be parsed using fields in a IFile.
|
|
223
|
+
OFile& setLinePrefix(const std::string&);
|
|
224
|
+
/// Set the format for writing double precision fields
|
|
225
|
+
OFile& fmtField(const std::string&);
|
|
226
|
+
/// Reset the format for writing double precision fields to its default
|
|
227
|
+
OFile& fmtField();
|
|
228
|
+
/// Set the value of a double precision field
|
|
229
|
+
OFile& printField(const std::string&,double);
|
|
230
|
+
/// Set the value of a int type field
|
|
231
|
+
OFile& printField(const std::string&,int);
|
|
232
|
+
OFile& printField(const std::string&,long int);
|
|
233
|
+
OFile& printField(const std::string&,long long int);
|
|
234
|
+
OFile& printField(const std::string&,unsigned);
|
|
235
|
+
OFile& printField(const std::string&,long unsigned);
|
|
236
|
+
OFile& printField(const std::string&,long long unsigned);
|
|
237
|
+
/// Set the value of a string field
|
|
238
|
+
OFile& printField(const std::string&,const std::string&);
|
|
239
|
+
///
|
|
240
|
+
OFile& addConstantField(const std::string&);
|
|
241
|
+
/// Used to setup printing of values
|
|
242
|
+
OFile& setupPrintValue( Value *val );
|
|
243
|
+
/// Print a value
|
|
244
|
+
OFile& printField( Value* val, const double& v );
|
|
245
|
+
/** Close a line.
|
|
246
|
+
Typically used as
|
|
247
|
+
\verbatim
|
|
248
|
+
of.printField("a",a).printField("b",b).printField();
|
|
249
|
+
\endverbatim
|
|
250
|
+
*/
|
|
251
|
+
OFile& printField();
|
|
252
|
+
/**
|
|
253
|
+
Resets the list of fields.
|
|
254
|
+
As it is only possible to add new constant fields (addConstantField()),
|
|
255
|
+
this method can be used to clean the field list.
|
|
256
|
+
*/
|
|
257
|
+
OFile& clearFields();
|
|
258
|
+
/// Formatted output with explicit format - a la printf
|
|
259
|
+
int printf(const char*fmt,...);
|
|
260
|
+
/// Formatted output with << operator
|
|
261
|
+
template <class T>
|
|
262
|
+
friend OFile& operator<<(OFile&,const T &);
|
|
263
|
+
/// Rewind a file
|
|
264
|
+
OFile&rewind();
|
|
265
|
+
/// Flush a file
|
|
266
|
+
FileBase&flush() override;
|
|
267
|
+
/// Enforce restart, also if the attached plumed object is not restarting.
|
|
268
|
+
/// Useful for tests
|
|
269
|
+
OFile&enforceRestart();
|
|
270
|
+
/// Enforce backup, even if the attached plumed object is restarting.
|
|
271
|
+
OFile&enforceBackup();
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/// Write using << syntax
|
|
275
|
+
template <class T>
|
|
276
|
+
OFile& operator<<(OFile&of,const T &t) {
|
|
277
|
+
of.oss<<t;
|
|
278
|
+
of.printf("%s",of.oss.str().c_str());
|
|
279
|
+
of.oss.str("");
|
|
280
|
+
return of;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
#endif
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2025 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_OpenACC_h
|
|
23
|
+
#define __PLUMED_tools_OpenACC_h
|
|
24
|
+
|
|
25
|
+
#include <vector>
|
|
26
|
+
#include "View.h"
|
|
27
|
+
|
|
28
|
+
#ifdef __PLUMED_HAS_OPENACC
|
|
29
|
+
#include <openacc.h>
|
|
30
|
+
#endif //__PLUMED_HAS_OPENACC
|
|
31
|
+
|
|
32
|
+
namespace PLMD {
|
|
33
|
+
|
|
34
|
+
namespace OpenACC {
|
|
35
|
+
|
|
36
|
+
/** @brief this little tool is a RAII helper to put and remove data on the device
|
|
37
|
+
|
|
38
|
+
the captured data will need to have two functions: toACCDevice() and removeFromACCDevice():
|
|
39
|
+
in toACCDevice you should declare a `#pragma acc enter data` statement with the object
|
|
40
|
+
within your structure to put on the device and eventual calls to toACCDevice of contained objects.
|
|
41
|
+
|
|
42
|
+
In the removeFromACCDevice function you should declare a `#pragma acc exit data` statement
|
|
43
|
+
to remove the object from the device but the onbject names should be delcared in the opposite order.fromToDataHelper
|
|
44
|
+
|
|
45
|
+
Remember to stat/finish with `this[0:1]`.
|
|
46
|
+
For example:
|
|
47
|
+
|
|
48
|
+
@code{c++}
|
|
49
|
+
struct dataContainer {
|
|
50
|
+
int * ptr;
|
|
51
|
+
size_t size;
|
|
52
|
+
void toACCDevice()const {
|
|
53
|
+
#pragma acc enter data copyin(this[0:1],ptr[0:size], size)
|
|
54
|
+
}
|
|
55
|
+
void removeFromACCDevice() const {
|
|
56
|
+
#pragma acc exit data delete(size,ptr[0:size],this[0:1])
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
@endcode
|
|
60
|
+
|
|
61
|
+
Or, for a slightly more complex example:
|
|
62
|
+
@code{c++}
|
|
63
|
+
struct ParallelActionsInput {
|
|
64
|
+
bool noderiv{false};
|
|
65
|
+
const Pbc* pbc;
|
|
66
|
+
unsigned ncomponents{0};
|
|
67
|
+
unsigned dataSize{0};
|
|
68
|
+
double *inputdata{nullptr};
|
|
69
|
+
ParallelActionsInput( const Pbc& box )
|
|
70
|
+
: pbc(&box) {}
|
|
71
|
+
void toACCDevice()const {
|
|
72
|
+
#pragma acc enter data copyin(this[0:1], noderiv, pbc[0:1],ncomponents, dataSize, inputdata[0:dataSize])
|
|
73
|
+
pbc->toACCDevice();
|
|
74
|
+
}
|
|
75
|
+
void removeFromACCDevice() const {
|
|
76
|
+
pbc->removeFromACCDevice();
|
|
77
|
+
// assuming dataSize is not changed
|
|
78
|
+
#pragma acc exit data delete(inputdata[0:dataSize],dataSize,ncomponents, pbc[0:1],noderiv,this[0:1])
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
@endcode
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
template<typename accData>
|
|
85
|
+
class fromToDataHelper {
|
|
86
|
+
accData &m;
|
|
87
|
+
public:
|
|
88
|
+
fromToDataHelper(accData &d) : m(d) {
|
|
89
|
+
m.toACCDevice();
|
|
90
|
+
}
|
|
91
|
+
~fromToDataHelper() {
|
|
92
|
+
m.removeFromACCDevice();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
#ifdef __PLUMED_HAS_OPENACC
|
|
96
|
+
///C++ wrapper around acc_malloc, allocates sizeof(T) bytes and return a typed pointer
|
|
97
|
+
template <typename T> T *myAccMalloc(size_t size) {
|
|
98
|
+
return reinterpret_cast<T *>(acc_malloc(size * sizeof(T)));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
///C++ wrapper around acc_free
|
|
102
|
+
template <typename T> void myAccFree(T *ptr) {
|
|
103
|
+
acc_free(ptr);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
///Memory manager for openacc
|
|
107
|
+
template <typename T> class memoryManager {
|
|
108
|
+
/// the number of T element stored by the pointer
|
|
109
|
+
size_t size_ {0};
|
|
110
|
+
/// the size of the array stored on the GPU
|
|
111
|
+
size_t stored_ {0};
|
|
112
|
+
/// the device address, not the host address!!!
|
|
113
|
+
void *ptr_ {nullptr};
|
|
114
|
+
public:
|
|
115
|
+
/// @brief Initilialize an empty placeholder
|
|
116
|
+
memoryManager()=default;
|
|
117
|
+
/// @brief allocate the memory on the device, and store the pointer
|
|
118
|
+
/// @param sz the number of T that you want to allocate
|
|
119
|
+
memoryManager(size_t sz)
|
|
120
|
+
: size_{sz},
|
|
121
|
+
stored_ {sz} {
|
|
122
|
+
if (size_ > 0) {
|
|
123
|
+
ptr_ = acc_malloc(size_ * sizeof(T));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/// @brief allocates and copies to the memory of the device the given vector
|
|
127
|
+
memoryManager(const std::vector<T>& data)
|
|
128
|
+
: size_{data.size()},
|
|
129
|
+
stored_{data.size()},
|
|
130
|
+
ptr_{acc_malloc(size_ * sizeof(T))} {
|
|
131
|
+
copyToDevice(data.data());
|
|
132
|
+
}
|
|
133
|
+
/// @brief allocates and copies to the memory of the device the given vector
|
|
134
|
+
template <size_t N>
|
|
135
|
+
memoryManager(const View<T,N>& data)
|
|
136
|
+
: size_{data.size()},
|
|
137
|
+
stored_{data.size()},
|
|
138
|
+
ptr_{acc_malloc(size_ * sizeof(T))} {
|
|
139
|
+
copyToDevice(data.data());
|
|
140
|
+
}
|
|
141
|
+
/// frees the stored memory
|
|
142
|
+
~memoryManager() {
|
|
143
|
+
acc_free(ptr_);
|
|
144
|
+
}
|
|
145
|
+
/// @brief gets the device addres
|
|
146
|
+
/// @return gets the device addres, typed
|
|
147
|
+
constexpr T *devicePtr() const {
|
|
148
|
+
return reinterpret_cast<T *>(ptr_);
|
|
149
|
+
}
|
|
150
|
+
/// Resizes the data stored on the device if the new size is smaller that the curent one, the memory will not be realocated
|
|
151
|
+
void resize(size_t sz) {
|
|
152
|
+
size_=sz;
|
|
153
|
+
if (size_ > stored_) {
|
|
154
|
+
stored_=size_;
|
|
155
|
+
acc_free(ptr_);
|
|
156
|
+
ptr_=acc_malloc(size_ * sizeof(T));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/// return the current number of elements stored on the device
|
|
160
|
+
constexpr size_t size() const {
|
|
161
|
+
return size_;
|
|
162
|
+
}
|
|
163
|
+
/// @brief Copies the data from the address to the device
|
|
164
|
+
void copyToDevice(T *data) {
|
|
165
|
+
acc_memcpy_to_device(ptr_, data, sizeof(T) * size_);
|
|
166
|
+
}
|
|
167
|
+
/// @brief Copies the data from the address to the device
|
|
168
|
+
void copyToDevice(T const *data) {
|
|
169
|
+
acc_memcpy_to_device(ptr_, const_cast<T *>(data), sizeof(T) * size_);
|
|
170
|
+
}
|
|
171
|
+
/// @brief copies the data from the device to the host
|
|
172
|
+
void copyFromDevice(T *data) {
|
|
173
|
+
acc_memcpy_from_device(data, ptr_, sizeof(T) * size_);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
#endif //__PLUMED_HAS_OPENACC
|
|
177
|
+
}//namespace OpenACC
|
|
178
|
+
}//namespace PLMD
|
|
179
|
+
|
|
180
|
+
#endif
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2014-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_OpenMP_h
|
|
23
|
+
#define __PLUMED_tools_OpenMP_h
|
|
24
|
+
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
namespace PLMD {
|
|
28
|
+
|
|
29
|
+
namespace OpenMP {
|
|
30
|
+
|
|
31
|
+
/// Set number of threads that can be used by openMP
|
|
32
|
+
void setNumThreads(const unsigned nt);
|
|
33
|
+
|
|
34
|
+
/// Get number of threads that can be used by openMP
|
|
35
|
+
unsigned getNumThreads();
|
|
36
|
+
|
|
37
|
+
/// Returns a unique thread identification number within the current team
|
|
38
|
+
unsigned getThreadNum();
|
|
39
|
+
|
|
40
|
+
/// get cacheline size
|
|
41
|
+
unsigned getCachelineSize();
|
|
42
|
+
|
|
43
|
+
/// Get a reasonable number of threads so as to access to an array of size s located at x
|
|
44
|
+
template<typename T>
|
|
45
|
+
unsigned getGoodNumThreads(const T* /*getTheType*/,unsigned n) {
|
|
46
|
+
// this is more or less the equivalent of writing "unsigned getGoodNumThreads<T>(unsigned n)"
|
|
47
|
+
|
|
48
|
+
// a factor two is necessary since there is no guarantee that x is aligned
|
|
49
|
+
// to cache line boundary
|
|
50
|
+
unsigned m=n*sizeof(T)/(2*getCachelineSize());
|
|
51
|
+
unsigned numThreads=getNumThreads();
|
|
52
|
+
if(m>=numThreads) {
|
|
53
|
+
m=numThreads;
|
|
54
|
+
} else {
|
|
55
|
+
//it is better to use either all the active threads or only one
|
|
56
|
+
//this solves a performance problem as explained in issue #415
|
|
57
|
+
m=1;
|
|
58
|
+
}
|
|
59
|
+
return m;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// Get a reasonable number of threads so as to access to vector v
|
|
63
|
+
template<typename T>
|
|
64
|
+
unsigned getGoodNumThreads(const std::vector<T> & v) {
|
|
65
|
+
if(v.size()==0) {
|
|
66
|
+
return 1;
|
|
67
|
+
} else {
|
|
68
|
+
return getGoodNumThreads(&v[0],v.size());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}//namespace OpenMP
|
|
73
|
+
}//namespace PLMD
|
|
74
|
+
|
|
75
|
+
#endif
|