hillclimber 0.1.5a8__cp314-cp314-macosx_15_0_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. hillclimber/__init__.py +39 -0
  2. hillclimber/actions.py +53 -0
  3. hillclimber/analysis.py +590 -0
  4. hillclimber/biases.py +293 -0
  5. hillclimber/calc.py +22 -0
  6. hillclimber/cvs.py +1065 -0
  7. hillclimber/interfaces.py +133 -0
  8. hillclimber/metadynamics.py +325 -0
  9. hillclimber/nodes.py +6 -0
  10. hillclimber/opes.py +359 -0
  11. hillclimber/selectors.py +230 -0
  12. hillclimber/virtual_atoms.py +341 -0
  13. hillclimber-0.1.5a8.dist-info/METADATA +209 -0
  14. hillclimber-0.1.5a8.dist-info/RECORD +469 -0
  15. hillclimber-0.1.5a8.dist-info/WHEEL +6 -0
  16. hillclimber-0.1.5a8.dist-info/entry_points.txt +8 -0
  17. hillclimber-0.1.5a8.dist-info/licenses/LICENSE +165 -0
  18. plumed/__init__.py +104 -0
  19. plumed/_lib/bin/plumed +0 -0
  20. plumed/_lib/bin/plumed-config +9 -0
  21. plumed/_lib/bin/plumed-patch +9 -0
  22. plumed/_lib/include/plumed/adjmat/AdjacencyMatrixBase.h +659 -0
  23. plumed/_lib/include/plumed/adjmat/ContactMatrix.h +59 -0
  24. plumed/_lib/include/plumed/asmjit/arch.h +228 -0
  25. plumed/_lib/include/plumed/asmjit/arm.h +43 -0
  26. plumed/_lib/include/plumed/asmjit/asmjit.h +69 -0
  27. plumed/_lib/include/plumed/asmjit/asmjit_apibegin.h +143 -0
  28. plumed/_lib/include/plumed/asmjit/asmjit_apiend.h +93 -0
  29. plumed/_lib/include/plumed/asmjit/asmjit_build.h +971 -0
  30. plumed/_lib/include/plumed/asmjit/assembler.h +183 -0
  31. plumed/_lib/include/plumed/asmjit/base.h +56 -0
  32. plumed/_lib/include/plumed/asmjit/codebuilder.h +944 -0
  33. plumed/_lib/include/plumed/asmjit/codecompiler.h +767 -0
  34. plumed/_lib/include/plumed/asmjit/codeemitter.h +528 -0
  35. plumed/_lib/include/plumed/asmjit/codeholder.h +777 -0
  36. plumed/_lib/include/plumed/asmjit/constpool.h +286 -0
  37. plumed/_lib/include/plumed/asmjit/cpuinfo.h +402 -0
  38. plumed/_lib/include/plumed/asmjit/func.h +1327 -0
  39. plumed/_lib/include/plumed/asmjit/globals.h +370 -0
  40. plumed/_lib/include/plumed/asmjit/inst.h +137 -0
  41. plumed/_lib/include/plumed/asmjit/logging.h +317 -0
  42. plumed/_lib/include/plumed/asmjit/misc_p.h +103 -0
  43. plumed/_lib/include/plumed/asmjit/moved_string.h +318 -0
  44. plumed/_lib/include/plumed/asmjit/operand.h +1599 -0
  45. plumed/_lib/include/plumed/asmjit/osutils.h +207 -0
  46. plumed/_lib/include/plumed/asmjit/regalloc_p.h +597 -0
  47. plumed/_lib/include/plumed/asmjit/runtime.h +227 -0
  48. plumed/_lib/include/plumed/asmjit/simdtypes.h +1104 -0
  49. plumed/_lib/include/plumed/asmjit/utils.h +1387 -0
  50. plumed/_lib/include/plumed/asmjit/vmem.h +183 -0
  51. plumed/_lib/include/plumed/asmjit/x86.h +45 -0
  52. plumed/_lib/include/plumed/asmjit/x86assembler.h +125 -0
  53. plumed/_lib/include/plumed/asmjit/x86builder.h +117 -0
  54. plumed/_lib/include/plumed/asmjit/x86compiler.h +322 -0
  55. plumed/_lib/include/plumed/asmjit/x86emitter.h +5149 -0
  56. plumed/_lib/include/plumed/asmjit/x86globals.h +535 -0
  57. plumed/_lib/include/plumed/asmjit/x86inst.h +2547 -0
  58. plumed/_lib/include/plumed/asmjit/x86instimpl_p.h +74 -0
  59. plumed/_lib/include/plumed/asmjit/x86internal_p.h +108 -0
  60. plumed/_lib/include/plumed/asmjit/x86logging_p.h +92 -0
  61. plumed/_lib/include/plumed/asmjit/x86misc.h +417 -0
  62. plumed/_lib/include/plumed/asmjit/x86operand.h +1133 -0
  63. plumed/_lib/include/plumed/asmjit/x86regalloc_p.h +734 -0
  64. plumed/_lib/include/plumed/asmjit/zone.h +1157 -0
  65. plumed/_lib/include/plumed/bias/Bias.h +82 -0
  66. plumed/_lib/include/plumed/bias/ReweightBase.h +58 -0
  67. plumed/_lib/include/plumed/blas/blas.h +253 -0
  68. plumed/_lib/include/plumed/blas/def_external.h +61 -0
  69. plumed/_lib/include/plumed/blas/def_internal.h +97 -0
  70. plumed/_lib/include/plumed/blas/real.h +49 -0
  71. plumed/_lib/include/plumed/cltools/CLTool.h +32 -0
  72. plumed/_lib/include/plumed/clusters/ClusteringBase.h +70 -0
  73. plumed/_lib/include/plumed/colvar/Colvar.h +32 -0
  74. plumed/_lib/include/plumed/colvar/ColvarInput.h +68 -0
  75. plumed/_lib/include/plumed/colvar/ColvarShortcut.h +81 -0
  76. plumed/_lib/include/plumed/colvar/CoordinationBase.h +52 -0
  77. plumed/_lib/include/plumed/colvar/MultiColvarTemplate.h +333 -0
  78. plumed/_lib/include/plumed/colvar/PathMSDBase.h +101 -0
  79. plumed/_lib/include/plumed/colvar/RMSDVector.h +78 -0
  80. plumed/_lib/include/plumed/config/Config.h +118 -0
  81. plumed/_lib/include/plumed/config/version.h +9 -0
  82. plumed/_lib/include/plumed/contour/ContourFindingObject.h +87 -0
  83. plumed/_lib/include/plumed/contour/DistanceFromContourBase.h +82 -0
  84. plumed/_lib/include/plumed/contour/FindContour.h +67 -0
  85. plumed/_lib/include/plumed/core/Action.h +540 -0
  86. plumed/_lib/include/plumed/core/ActionAnyorder.h +48 -0
  87. plumed/_lib/include/plumed/core/ActionAtomistic.h +343 -0
  88. plumed/_lib/include/plumed/core/ActionForInterface.h +99 -0
  89. plumed/_lib/include/plumed/core/ActionPilot.h +57 -0
  90. plumed/_lib/include/plumed/core/ActionRegister.h +124 -0
  91. plumed/_lib/include/plumed/core/ActionSet.h +163 -0
  92. plumed/_lib/include/plumed/core/ActionSetup.h +48 -0
  93. plumed/_lib/include/plumed/core/ActionShortcut.h +73 -0
  94. plumed/_lib/include/plumed/core/ActionToGetData.h +59 -0
  95. plumed/_lib/include/plumed/core/ActionToPutData.h +101 -0
  96. plumed/_lib/include/plumed/core/ActionWithArguments.h +140 -0
  97. plumed/_lib/include/plumed/core/ActionWithMatrix.h +87 -0
  98. plumed/_lib/include/plumed/core/ActionWithValue.h +258 -0
  99. plumed/_lib/include/plumed/core/ActionWithVector.h +94 -0
  100. plumed/_lib/include/plumed/core/ActionWithVirtualAtom.h +123 -0
  101. plumed/_lib/include/plumed/core/CLTool.h +177 -0
  102. plumed/_lib/include/plumed/core/CLToolMain.h +102 -0
  103. plumed/_lib/include/plumed/core/CLToolRegister.h +108 -0
  104. plumed/_lib/include/plumed/core/Colvar.h +115 -0
  105. plumed/_lib/include/plumed/core/DataPassingObject.h +94 -0
  106. plumed/_lib/include/plumed/core/DataPassingTools.h +54 -0
  107. plumed/_lib/include/plumed/core/DomainDecomposition.h +120 -0
  108. plumed/_lib/include/plumed/core/ExchangePatterns.h +47 -0
  109. plumed/_lib/include/plumed/core/FlexibleBin.h +63 -0
  110. plumed/_lib/include/plumed/core/GREX.h +61 -0
  111. plumed/_lib/include/plumed/core/GenericMolInfo.h +89 -0
  112. plumed/_lib/include/plumed/core/Group.h +41 -0
  113. plumed/_lib/include/plumed/core/ModuleMap.h +30 -0
  114. plumed/_lib/include/plumed/core/ParallelTaskManager.h +1023 -0
  115. plumed/_lib/include/plumed/core/PbcAction.h +61 -0
  116. plumed/_lib/include/plumed/core/PlumedMain.h +632 -0
  117. plumed/_lib/include/plumed/core/PlumedMainInitializer.h +118 -0
  118. plumed/_lib/include/plumed/core/RegisterBase.h +340 -0
  119. plumed/_lib/include/plumed/core/TargetDist.h +48 -0
  120. plumed/_lib/include/plumed/core/Value.h +547 -0
  121. plumed/_lib/include/plumed/core/WithCmd.h +93 -0
  122. plumed/_lib/include/plumed/dimred/SMACOF.h +55 -0
  123. plumed/_lib/include/plumed/drr/DRR.h +383 -0
  124. plumed/_lib/include/plumed/drr/colvar_UIestimator.h +777 -0
  125. plumed/_lib/include/plumed/fisst/legendre_rule_fast.h +44 -0
  126. plumed/_lib/include/plumed/function/Custom.h +54 -0
  127. plumed/_lib/include/plumed/function/Function.h +85 -0
  128. plumed/_lib/include/plumed/function/FunctionOfMatrix.h +368 -0
  129. plumed/_lib/include/plumed/function/FunctionOfScalar.h +135 -0
  130. plumed/_lib/include/plumed/function/FunctionOfVector.h +296 -0
  131. plumed/_lib/include/plumed/function/FunctionSetup.h +180 -0
  132. plumed/_lib/include/plumed/function/FunctionShortcut.h +130 -0
  133. plumed/_lib/include/plumed/function/FunctionWithSingleArgument.h +165 -0
  134. plumed/_lib/include/plumed/gridtools/ActionWithGrid.h +43 -0
  135. plumed/_lib/include/plumed/gridtools/EvaluateGridFunction.h +99 -0
  136. plumed/_lib/include/plumed/gridtools/FunctionOfGrid.h +295 -0
  137. plumed/_lib/include/plumed/gridtools/GridCoordinatesObject.h +179 -0
  138. plumed/_lib/include/plumed/gridtools/GridSearch.h +135 -0
  139. plumed/_lib/include/plumed/gridtools/Interpolator.h +45 -0
  140. plumed/_lib/include/plumed/gridtools/KDE.h +455 -0
  141. plumed/_lib/include/plumed/gridtools/RDF.h +40 -0
  142. plumed/_lib/include/plumed/gridtools/SumOfKernels.h +219 -0
  143. plumed/_lib/include/plumed/isdb/MetainferenceBase.h +398 -0
  144. plumed/_lib/include/plumed/lapack/def_external.h +207 -0
  145. plumed/_lib/include/plumed/lapack/def_internal.h +388 -0
  146. plumed/_lib/include/plumed/lapack/lapack.h +899 -0
  147. plumed/_lib/include/plumed/lapack/lapack_limits.h +79 -0
  148. plumed/_lib/include/plumed/lapack/real.h +50 -0
  149. plumed/_lib/include/plumed/lepton/CompiledExpression.h +164 -0
  150. plumed/_lib/include/plumed/lepton/CustomFunction.h +143 -0
  151. plumed/_lib/include/plumed/lepton/Exception.h +93 -0
  152. plumed/_lib/include/plumed/lepton/ExpressionProgram.h +137 -0
  153. plumed/_lib/include/plumed/lepton/ExpressionTreeNode.h +145 -0
  154. plumed/_lib/include/plumed/lepton/Lepton.h +85 -0
  155. plumed/_lib/include/plumed/lepton/MSVC_erfc.h +123 -0
  156. plumed/_lib/include/plumed/lepton/Operation.h +1302 -0
  157. plumed/_lib/include/plumed/lepton/ParsedExpression.h +165 -0
  158. plumed/_lib/include/plumed/lepton/Parser.h +111 -0
  159. plumed/_lib/include/plumed/lepton/windowsIncludes.h +73 -0
  160. plumed/_lib/include/plumed/mapping/Path.h +44 -0
  161. plumed/_lib/include/plumed/mapping/PathProjectionCalculator.h +57 -0
  162. plumed/_lib/include/plumed/matrixtools/MatrixOperationBase.h +54 -0
  163. plumed/_lib/include/plumed/matrixtools/MatrixTimesMatrix.h +309 -0
  164. plumed/_lib/include/plumed/matrixtools/MatrixTimesVectorBase.h +365 -0
  165. plumed/_lib/include/plumed/matrixtools/OuterProduct.h +238 -0
  166. plumed/_lib/include/plumed/maze/Core.h +65 -0
  167. plumed/_lib/include/plumed/maze/Loss.h +86 -0
  168. plumed/_lib/include/plumed/maze/Member.h +66 -0
  169. plumed/_lib/include/plumed/maze/Memetic.h +799 -0
  170. plumed/_lib/include/plumed/maze/Optimizer.h +357 -0
  171. plumed/_lib/include/plumed/maze/Random_MT.h +156 -0
  172. plumed/_lib/include/plumed/maze/Tools.h +183 -0
  173. plumed/_lib/include/plumed/metatomic/vesin.h +188 -0
  174. plumed/_lib/include/plumed/molfile/Gromacs.h +2013 -0
  175. plumed/_lib/include/plumed/molfile/endianswap.h +217 -0
  176. plumed/_lib/include/plumed/molfile/fastio.h +683 -0
  177. plumed/_lib/include/plumed/molfile/largefiles.h +78 -0
  178. plumed/_lib/include/plumed/molfile/libmolfile_plugin.h +77 -0
  179. plumed/_lib/include/plumed/molfile/molfile_plugin.h +1034 -0
  180. plumed/_lib/include/plumed/molfile/periodic_table.h +248 -0
  181. plumed/_lib/include/plumed/molfile/readpdb.h +447 -0
  182. plumed/_lib/include/plumed/molfile/vmdplugin.h +236 -0
  183. plumed/_lib/include/plumed/multicolvar/MultiColvarShortcuts.h +45 -0
  184. plumed/_lib/include/plumed/opes/ExpansionCVs.h +79 -0
  185. plumed/_lib/include/plumed/sasa/Sasa.h +32 -0
  186. plumed/_lib/include/plumed/secondarystructure/SecondaryStructureBase.h +372 -0
  187. plumed/_lib/include/plumed/setup/ActionSetup.h +25 -0
  188. plumed/_lib/include/plumed/small_vector/small_vector.h +6114 -0
  189. plumed/_lib/include/plumed/symfunc/CoordinationNumbers.h +41 -0
  190. plumed/_lib/include/plumed/tools/Angle.h +52 -0
  191. plumed/_lib/include/plumed/tools/AtomDistribution.h +138 -0
  192. plumed/_lib/include/plumed/tools/AtomNumber.h +152 -0
  193. plumed/_lib/include/plumed/tools/BiasRepresentation.h +106 -0
  194. plumed/_lib/include/plumed/tools/BitmaskEnum.h +167 -0
  195. plumed/_lib/include/plumed/tools/Brent1DRootSearch.h +159 -0
  196. plumed/_lib/include/plumed/tools/CheckInRange.h +44 -0
  197. plumed/_lib/include/plumed/tools/Citations.h +74 -0
  198. plumed/_lib/include/plumed/tools/ColvarOutput.h +118 -0
  199. plumed/_lib/include/plumed/tools/Communicator.h +316 -0
  200. plumed/_lib/include/plumed/tools/ConjugateGradient.h +80 -0
  201. plumed/_lib/include/plumed/tools/DLLoader.h +79 -0
  202. plumed/_lib/include/plumed/tools/ERMSD.h +73 -0
  203. plumed/_lib/include/plumed/tools/Exception.h +406 -0
  204. plumed/_lib/include/plumed/tools/File.h +28 -0
  205. plumed/_lib/include/plumed/tools/FileBase.h +153 -0
  206. plumed/_lib/include/plumed/tools/FileTools.h +37 -0
  207. plumed/_lib/include/plumed/tools/ForwardDecl.h +54 -0
  208. plumed/_lib/include/plumed/tools/Grid.h +638 -0
  209. plumed/_lib/include/plumed/tools/HistogramBead.h +136 -0
  210. plumed/_lib/include/plumed/tools/IFile.h +117 -0
  211. plumed/_lib/include/plumed/tools/KernelFunctions.h +113 -0
  212. plumed/_lib/include/plumed/tools/Keywords.h +380 -0
  213. plumed/_lib/include/plumed/tools/LatticeReduction.h +66 -0
  214. plumed/_lib/include/plumed/tools/LeptonCall.h +64 -0
  215. plumed/_lib/include/plumed/tools/LinkCells.h +126 -0
  216. plumed/_lib/include/plumed/tools/Log.h +41 -0
  217. plumed/_lib/include/plumed/tools/LoopUnroller.h +163 -0
  218. plumed/_lib/include/plumed/tools/Matrix.h +721 -0
  219. plumed/_lib/include/plumed/tools/MatrixSquareBracketsAccess.h +138 -0
  220. plumed/_lib/include/plumed/tools/MergeVectorTools.h +153 -0
  221. plumed/_lib/include/plumed/tools/Minimise1DBrent.h +244 -0
  222. plumed/_lib/include/plumed/tools/MinimiseBase.h +120 -0
  223. plumed/_lib/include/plumed/tools/MolDataClass.h +51 -0
  224. plumed/_lib/include/plumed/tools/NeighborList.h +112 -0
  225. plumed/_lib/include/plumed/tools/OFile.h +286 -0
  226. plumed/_lib/include/plumed/tools/OpenACC.h +180 -0
  227. plumed/_lib/include/plumed/tools/OpenMP.h +75 -0
  228. plumed/_lib/include/plumed/tools/PDB.h +154 -0
  229. plumed/_lib/include/plumed/tools/Pbc.h +139 -0
  230. plumed/_lib/include/plumed/tools/PlumedHandle.h +105 -0
  231. plumed/_lib/include/plumed/tools/RMSD.h +493 -0
  232. plumed/_lib/include/plumed/tools/Random.h +80 -0
  233. plumed/_lib/include/plumed/tools/RootFindingBase.h +79 -0
  234. plumed/_lib/include/plumed/tools/Stopwatch.h +475 -0
  235. plumed/_lib/include/plumed/tools/Subprocess.h +142 -0
  236. plumed/_lib/include/plumed/tools/SwitchingFunction.h +208 -0
  237. plumed/_lib/include/plumed/tools/Tensor.h +724 -0
  238. plumed/_lib/include/plumed/tools/TokenizedLine.h +123 -0
  239. plumed/_lib/include/plumed/tools/Tools.h +638 -0
  240. plumed/_lib/include/plumed/tools/Torsion.h +55 -0
  241. plumed/_lib/include/plumed/tools/TrajectoryParser.h +118 -0
  242. plumed/_lib/include/plumed/tools/Tree.h +61 -0
  243. plumed/_lib/include/plumed/tools/TypesafePtr.h +463 -0
  244. plumed/_lib/include/plumed/tools/Units.h +167 -0
  245. plumed/_lib/include/plumed/tools/Vector.h +433 -0
  246. plumed/_lib/include/plumed/tools/View.h +296 -0
  247. plumed/_lib/include/plumed/tools/View2D.h +100 -0
  248. plumed/_lib/include/plumed/tools/h36.h +39 -0
  249. plumed/_lib/include/plumed/vatom/ActionWithVirtualAtom.h +32 -0
  250. plumed/_lib/include/plumed/ves/BasisFunctions.h +380 -0
  251. plumed/_lib/include/plumed/ves/CoeffsBase.h +310 -0
  252. plumed/_lib/include/plumed/ves/CoeffsMatrix.h +220 -0
  253. plumed/_lib/include/plumed/ves/CoeffsVector.h +251 -0
  254. plumed/_lib/include/plumed/ves/FermiSwitchingFunction.h +74 -0
  255. plumed/_lib/include/plumed/ves/GridIntegrationWeights.h +50 -0
  256. plumed/_lib/include/plumed/ves/GridLinearInterpolation.h +81 -0
  257. plumed/_lib/include/plumed/ves/GridProjWeights.h +61 -0
  258. plumed/_lib/include/plumed/ves/LinearBasisSetExpansion.h +303 -0
  259. plumed/_lib/include/plumed/ves/Optimizer.h +444 -0
  260. plumed/_lib/include/plumed/ves/TargetDistModifer.h +53 -0
  261. plumed/_lib/include/plumed/ves/TargetDistribution.h +266 -0
  262. plumed/_lib/include/plumed/ves/VesBias.h +545 -0
  263. plumed/_lib/include/plumed/ves/VesTools.h +142 -0
  264. plumed/_lib/include/plumed/ves/WaveletGrid.h +75 -0
  265. plumed/_lib/include/plumed/volumes/ActionVolume.h +268 -0
  266. plumed/_lib/include/plumed/volumes/VolumeShortcut.h +147 -0
  267. plumed/_lib/include/plumed/wrapper/Plumed.h +5025 -0
  268. plumed/_lib/include/plumed/xdrfile/xdrfile.h +663 -0
  269. plumed/_lib/include/plumed/xdrfile/xdrfile_trr.h +89 -0
  270. plumed/_lib/include/plumed/xdrfile/xdrfile_xtc.h +90 -0
  271. plumed/_lib/lib/PythonCVInterface.dylib +0 -0
  272. plumed/_lib/lib/libplumed.dylib +0 -0
  273. plumed/_lib/lib/libplumedKernel.dylib +0 -0
  274. plumed/_lib/lib/libplumedWrapper.a +0 -0
  275. plumed/_lib/lib/pkgconfig/plumed.pc +13 -0
  276. plumed/_lib/lib/pkgconfig/plumedInternals.pc +13 -0
  277. plumed/_lib/lib/pkgconfig/plumedWrapper.pc +13 -0
  278. plumed/_lib/lib/plumed/fortran/plumed.f90 +879 -0
  279. plumed/_lib/lib/plumed/fortran/plumed_f08.f90 +2625 -0
  280. plumed/_lib/lib/plumed/modulefile +69 -0
  281. plumed/_lib/lib/plumed/patches/gromacs-2022.5.config +43 -0
  282. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt +543 -0
  283. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt.preplumed +540 -0
  284. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp +1628 -0
  285. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1590 -0
  286. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h +103 -0
  287. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h.preplumed +99 -0
  288. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp +2527 -0
  289. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2513 -0
  290. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  291. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  292. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +408 -0
  293. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +394 -0
  294. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp +2348 -0
  295. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2091 -0
  296. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp +3573 -0
  297. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3495 -0
  298. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1506 -0
  299. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1402 -0
  300. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  301. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  302. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp +997 -0
  303. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +906 -0
  304. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp +2780 -0
  305. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2738 -0
  306. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  307. plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  308. plumed/_lib/lib/plumed/patches/gromacs-2023.5.config +43 -0
  309. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt +549 -0
  310. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt.preplumed +546 -0
  311. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
  312. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
  313. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h +104 -0
  314. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
  315. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp +2624 -0
  316. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2610 -0
  317. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  318. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  319. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +409 -0
  320. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +395 -0
  321. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp +2419 -0
  322. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2164 -0
  323. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp +3546 -0
  324. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3468 -0
  325. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
  326. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
  327. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  328. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  329. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp +991 -0
  330. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +900 -0
  331. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp +2895 -0
  332. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2849 -0
  333. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  334. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  335. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp +886 -0
  336. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +880 -0
  337. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +347 -0
  338. plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +345 -0
  339. plumed/_lib/lib/plumed/patches/gromacs-2024.3.config +43 -0
  340. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt +575 -0
  341. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt.preplumed +572 -0
  342. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
  343. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
  344. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h +104 -0
  345. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
  346. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp +2564 -0
  347. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2550 -0
  348. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
  349. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
  350. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h +410 -0
  351. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +396 -0
  352. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp +2435 -0
  353. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp.preplumed +2187 -0
  354. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp +3592 -0
  355. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3514 -0
  356. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
  357. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
  358. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
  359. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
  360. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp +958 -0
  361. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp.preplumed +929 -0
  362. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp +2987 -0
  363. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp.preplumed +2941 -0
  364. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
  365. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
  366. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp +904 -0
  367. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +898 -0
  368. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +353 -0
  369. plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +351 -0
  370. plumed/_lib/lib/plumed/patches/gromacs-2025.0.config +39 -0
  371. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake +82 -0
  372. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake.preplumed +82 -0
  373. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp +162 -0
  374. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp.preplumed +154 -0
  375. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp +107 -0
  376. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp.preplumed +99 -0
  377. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h +120 -0
  378. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h.preplumed +111 -0
  379. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp +215 -0
  380. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp.preplumed +197 -0
  381. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h +87 -0
  382. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h.preplumed +86 -0
  383. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp +2971 -0
  384. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp.preplumed +2970 -0
  385. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h +430 -0
  386. plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h.preplumed +429 -0
  387. plumed/_lib/lib/plumed/patches/namd-2.12.config +30 -0
  388. plumed/_lib/lib/plumed/patches/namd-2.12.diff +267 -0
  389. plumed/_lib/lib/plumed/patches/namd-2.13.config +30 -0
  390. plumed/_lib/lib/plumed/patches/namd-2.13.diff +267 -0
  391. plumed/_lib/lib/plumed/patches/namd-2.14.config +30 -0
  392. plumed/_lib/lib/plumed/patches/namd-2.14.diff +268 -0
  393. plumed/_lib/lib/plumed/patches/patch.sh +500 -0
  394. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.config +25 -0
  395. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90 +368 -0
  396. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90.preplumed +366 -0
  397. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90 +71 -0
  398. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90.preplumed +24 -0
  399. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90 +62 -0
  400. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  401. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90 +189 -0
  402. plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90.preplumed +185 -0
  403. plumed/_lib/lib/plumed/patches/qespresso-6.2.config +26 -0
  404. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90 +422 -0
  405. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90.preplumed +420 -0
  406. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90 +70 -0
  407. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  408. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90 +62 -0
  409. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  410. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90 +233 -0
  411. plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90.preplumed +230 -0
  412. plumed/_lib/lib/plumed/patches/qespresso-7.0.config +28 -0
  413. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile +175 -0
  414. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile.preplumed +171 -0
  415. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90 +486 -0
  416. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90.preplumed +484 -0
  417. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90 +74 -0
  418. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  419. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90 +64 -0
  420. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  421. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90 +532 -0
  422. plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90.preplumed +518 -0
  423. plumed/_lib/lib/plumed/patches/qespresso-7.2.config +28 -0
  424. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile +249 -0
  425. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile.preplumed +244 -0
  426. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90 +532 -0
  427. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90.preplumed +535 -0
  428. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90 +74 -0
  429. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
  430. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90 +64 -0
  431. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
  432. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90 +569 -0
  433. plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90.preplumed +560 -0
  434. plumed/_lib/lib/plumed/plumed-config +9 -0
  435. plumed/_lib/lib/plumed/plumed-mklib +9 -0
  436. plumed/_lib/lib/plumed/plumed-newcv +9 -0
  437. plumed/_lib/lib/plumed/plumed-partial_tempering +9 -0
  438. plumed/_lib/lib/plumed/plumed-patch +9 -0
  439. plumed/_lib/lib/plumed/plumed-runtime +0 -0
  440. plumed/_lib/lib/plumed/plumed-selector +9 -0
  441. plumed/_lib/lib/plumed/plumed-vim2html +9 -0
  442. plumed/_lib/lib/plumed/scripts/config.sh +126 -0
  443. plumed/_lib/lib/plumed/scripts/mklib.sh +175 -0
  444. plumed/_lib/lib/plumed/scripts/newcv.sh +26 -0
  445. plumed/_lib/lib/plumed/scripts/partial_tempering.sh +319 -0
  446. plumed/_lib/lib/plumed/scripts/patch.sh +4 -0
  447. plumed/_lib/lib/plumed/scripts/selector.sh +234 -0
  448. plumed/_lib/lib/plumed/scripts/vim2html.sh +190 -0
  449. plumed/_lib/lib/plumed/src/colvar/Template.cpp +116 -0
  450. plumed/_lib/lib/plumed/src/config/compile_options.sh +3 -0
  451. plumed/_lib/lib/plumed/src/config/config.txt +181 -0
  452. plumed/_lib/lib/plumed/src/lib/Plumed.cmake +6 -0
  453. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.runtime +5 -0
  454. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.shared +5 -0
  455. plumed/_lib/lib/plumed/src/lib/Plumed.cmake.static +3 -0
  456. plumed/_lib/lib/plumed/src/lib/Plumed.inc +6 -0
  457. plumed/_lib/lib/plumed/src/lib/Plumed.inc.runtime +5 -0
  458. plumed/_lib/lib/plumed/src/lib/Plumed.inc.shared +5 -0
  459. plumed/_lib/lib/plumed/src/lib/Plumed.inc.static +3 -0
  460. plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
  461. plumed/_plumed_core.cpython-311-darwin.so +0 -0
  462. plumed/_plumed_core.cpython-312-darwin.so +0 -0
  463. plumed/_plumed_core.cpython-313-darwin.so +0 -0
  464. plumed/_plumed_core.cpython-314-darwin.so +0 -0
  465. plumedCommunications.cpython-311-darwin.so +0 -0
  466. plumedCommunications.cpython-312-darwin.so +0 -0
  467. plumedCommunications.cpython-313-darwin.so +0 -0
  468. plumedCommunications.cpython-314-darwin.so +0 -0
  469. 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