readcon-db 0.2.2__tar.gz → 0.2.4__tar.gz

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 (203) hide show
  1. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/ci.yml +7 -0
  2. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/ci_mpi.yml +1 -1
  3. {readcon_db-0.2.2 → readcon_db-0.2.4}/CHANGELOG.md +32 -0
  4. {readcon_db-0.2.2 → readcon_db-0.2.4}/CITATION.cff +1 -1
  5. {readcon_db-0.2.2 → readcon_db-0.2.4}/CMakeLists.txt +6 -5
  6. {readcon_db-0.2.2 → readcon_db-0.2.4}/Cargo.lock +60 -3
  7. {readcon_db-0.2.2 → readcon_db-0.2.4}/Cargo.toml +23 -2
  8. {readcon_db-0.2.2 → readcon_db-0.2.4}/PKG-INFO +7 -2
  9. {readcon_db-0.2.2 → readcon_db-0.2.4}/README.md +6 -1
  10. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/explanation/architecture.org +1 -1
  11. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/explanation/design.org +6 -2
  12. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/campaign.org +10 -9
  13. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/install.org +8 -3
  14. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/mpi.org +1 -1
  15. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/streaming.org +12 -0
  16. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/c.org +11 -4
  17. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/fortran.org +2 -2
  18. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/python.org +1 -0
  19. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/rust.org +4 -0
  20. {readcon_db-0.2.2 → readcon_db-0.2.4}/fortran/README.md +1 -1
  21. {readcon_db-0.2.2 → readcon_db-0.2.4}/fortran/ReadConDb/fpm.toml +1 -1
  22. {readcon_db-0.2.2 → readcon_db-0.2.4}/fortran/ReadConDb/src/readcon_db.f90 +26 -2
  23. {readcon_db-0.2.2 → readcon_db-0.2.4}/include/readcon-db-mpi.h +1 -1
  24. {readcon_db-0.2.2 → readcon_db-0.2.4}/include/readcon-db.h +16 -3
  25. {readcon_db-0.2.2 → readcon_db-0.2.4}/meson.build +8 -1
  26. readcon_db-0.2.4/meson_options.txt +8 -0
  27. {readcon_db-0.2.2 → readcon_db-0.2.4}/pixi.toml +1 -1
  28. readcon_db-0.2.4/python/tests/test_extend_precision.py +79 -0
  29. readcon_db-0.2.4/python/tests/test_hash_con_text.py +24 -0
  30. readcon_db-0.2.4/python/tests/test_ingest_memory.py +51 -0
  31. readcon_db-0.2.4/resources/test/con_v4/README.md +56 -0
  32. readcon_db-0.2.4/resources/test/con_v4/tiny_cuh2_v4.con +17 -0
  33. readcon_db-0.2.4/resources/test/con_v4/tiny_cuh2_v4.convel +26 -0
  34. readcon_db-0.2.4/resources/test/highprec_a.con +15 -0
  35. readcon_db-0.2.4/resources/test/highprec_b.con +15 -0
  36. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/check_version_lockstep.py +2 -2
  37. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/meson_cargo_build.py +3 -2
  38. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/package-clib.sh +3 -4
  39. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/archive.rs +164 -158
  40. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/canonical.rs +1 -1
  41. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/catalog.rs +92 -14
  42. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/cooked_soa.rs +5 -4
  43. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/corpus.rs +433 -73
  44. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/export_h5md.rs +2 -1
  45. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/export_xyz.rs +4 -1
  46. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/ffi.rs +269 -4
  47. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/lib.rs +9 -2
  48. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/mpi_ingest.rs +2 -0
  49. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/python.rs +40 -7
  50. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/shard.rs +116 -46
  51. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/units_canon.rs +42 -12
  52. readcon_db-0.2.4/tests/capi_symbols.rs +137 -0
  53. readcon_db-0.2.4/tests/cdylib_static_tls.rs +163 -0
  54. readcon_db-0.2.4/tests/claims_shard.rs +203 -0
  55. readcon_db-0.2.4/tests/cmake-project/main.c +104 -0
  56. readcon_db-0.2.4/tests/con_v4_fixtures.rs +64 -0
  57. readcon_db-0.2.4/tests/hash_file.rs +63 -0
  58. readcon_db-0.2.4/tests/meson-wrap/main.c +93 -0
  59. readcon_db-0.2.2/meson_options.txt +0 -8
  60. readcon_db-0.2.2/python/tests/test_ingest_memory.py +0 -27
  61. readcon_db-0.2.2/tests/cmake-project/main.c +0 -28
  62. readcon_db-0.2.2/tests/meson-wrap/main.c +0 -17
  63. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/c_lib_tarball.yml +0 -0
  64. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/ci_cxx.yml +0 -0
  65. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/ci_docs.yml +0 -0
  66. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/ci_prek.yml +0 -0
  67. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/crates_publish.yml +0 -0
  68. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/cxx_tarball.yml +0 -0
  69. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/lint.yml +0 -0
  70. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/pages.yml +0 -0
  71. {readcon_db-0.2.2 → readcon_db-0.2.4}/.github/workflows/python-wheels.yml +0 -0
  72. {readcon_db-0.2.2 → readcon_db-0.2.4}/.gitignore +0 -0
  73. {readcon_db-0.2.2 → readcon_db-0.2.4}/CODE_OF_CONDUCT.md +0 -0
  74. {readcon_db-0.2.2 → readcon_db-0.2.4}/CONTRIBUTING.md +0 -0
  75. {readcon_db-0.2.2 → readcon_db-0.2.4}/LICENSE +0 -0
  76. {readcon_db-0.2.2 → readcon_db-0.2.4}/SECURITY.md +0 -0
  77. {readcon_db-0.2.2 → readcon_db-0.2.4}/assets/logo/BRAND.md +0 -0
  78. {readcon_db-0.2.2 → readcon_db-0.2.4}/assets/logo/readcon-db-logo-512.png +0 -0
  79. {readcon_db-0.2.2 → readcon_db-0.2.4}/assets/logo/readcon-db-logo-raster.jpg +0 -0
  80. {readcon_db-0.2.2 → readcon_db-0.2.4}/assets/logo/readcon-db-logo.svg +0 -0
  81. {readcon_db-0.2.2 → readcon_db-0.2.4}/assets/logo/readcon-db-wordmark.svg +0 -0
  82. {readcon_db-0.2.2 → readcon_db-0.2.4}/bench/gen_con.py +0 -0
  83. {readcon_db-0.2.2 → readcon_db-0.2.4}/bench/mpi_bench.sh +0 -0
  84. {readcon_db-0.2.2 → readcon_db-0.2.4}/bench/vary_con.py +0 -0
  85. {readcon_db-0.2.2 → readcon_db-0.2.4}/cmake/readcon-db-config-version.in.cmake +0 -0
  86. {readcon_db-0.2.2 → readcon_db-0.2.4}/cmake/readcon-db-config.in.cmake +0 -0
  87. {readcon_db-0.2.2 → readcon_db-0.2.4}/cmake/readcon-db.pc.in +0 -0
  88. {readcon_db-0.2.2 → readcon_db-0.2.4}/cmake/tempdir.cmake +0 -0
  89. {readcon_db-0.2.2 → readcon_db-0.2.4}/cog.toml +0 -0
  90. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/Makefile +0 -0
  91. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/_static/logo.svg +0 -0
  92. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/changelog.org +0 -0
  93. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/contributing/index.org +0 -0
  94. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/cooked-soa.org +0 -0
  95. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/explanation/faq.org +0 -0
  96. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/explanation/overview.org +0 -0
  97. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/atom-order.org +0 -0
  98. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/howto.org +0 -0
  99. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/migration.org +0 -0
  100. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/topology.org +0 -0
  101. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/howto/workflows.org +0 -0
  102. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/index.org +0 -0
  103. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/readme.org +0 -0
  104. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/citation.org +0 -0
  105. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/reference/python-api.org +0 -0
  106. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/tutorials/getting-started.org +0 -0
  107. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/tutorials/tutorial-run.log +0 -0
  108. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/tutorials/tutorial-run.sh +0 -0
  109. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/orgmode/tutorials/tutorial.org +0 -0
  110. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/requirements.txt +0 -0
  111. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/custom.css +0 -0
  112. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/favicon.svg +0 -0
  113. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/logo-nav-dark.svg +0 -0
  114. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/logo-nav-light.svg +0 -0
  115. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/logo.svg +0 -0
  116. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_static/mark.svg +0 -0
  117. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_templates/partials/extra-foot.html +0 -0
  118. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_templates/partials/extra-head.html +0 -0
  119. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_templates/partials/site-foot.html +0 -0
  120. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/_templates/partials/webfonts.html +0 -0
  121. {readcon_db-0.2.2 → readcon_db-0.2.4}/docs/source/conf.py +0 -0
  122. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/bench_corpus_ops.rs +0 -0
  123. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/bench_vs_ase_prep.py +0 -0
  124. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/ase_db_bench.json +0 -0
  125. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/ase_fair_campaign_1.json +0 -0
  126. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/bench_ase_db.py +0 -0
  127. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/db_vs_ase_table.md +0 -0
  128. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/fair_campaign.py +0 -0
  129. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/fair_db_vs_ase_table.md +0 -0
  130. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/readcon_db_bench.json +0 -0
  131. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/results_merged.json +0 -0
  132. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/benchmarks/test_fair_select_parity.py +0 -0
  133. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/ingest_select.rs +0 -0
  134. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/mpi_bcast_frame.c +0 -0
  135. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/mpi_bcast_frame.f90 +0 -0
  136. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/mpi_bcast_frame.py +0 -0
  137. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/mpi_ingest_check.rs +0 -0
  138. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/mpi_read_check.rs +0 -0
  139. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/shard_gate.rs +0 -0
  140. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/workflows/metatrain_from_con.md +0 -0
  141. {readcon_db-0.2.2 → readcon_db-0.2.4}/examples/workflows/options.metatrain.snippet.yaml +0 -0
  142. {readcon_db-0.2.2 → readcon_db-0.2.4}/lychee.toml +0 -0
  143. {readcon_db-0.2.2 → readcon_db-0.2.4}/packaging/wrapdb/README.md +0 -0
  144. {readcon_db-0.2.2 → readcon_db-0.2.4}/packaging/wrapdb/readcon-db.wrap.in +0 -0
  145. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/freeze/ase_fair_campaign_1.json +0 -0
  146. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/freeze/fair_db_vs_ase_table.md +0 -0
  147. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/readme.org +0 -0
  148. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/scripts/gen_fair_table.py +0 -0
  149. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/src/appendix-fair-campaign.org +0 -0
  150. {readcon_db-0.2.2 → readcon_db-0.2.4}/paper/cpc/src/figures/generated/fair_campaign_table.tex +0 -0
  151. {readcon_db-0.2.2 → readcon_db-0.2.4}/pixi.lock +0 -0
  152. {readcon_db-0.2.2 → readcon_db-0.2.4}/pr-text.md +0 -0
  153. {readcon_db-0.2.2 → readcon_db-0.2.4}/prek.toml +0 -0
  154. {readcon_db-0.2.2 → readcon_db-0.2.4}/pyproject.toml +0 -0
  155. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/pyproject.toml +0 -0
  156. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/tests/test_atom_order.py +0 -0
  157. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/tests/test_catalog_claims.py +0 -0
  158. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/tests/test_export_h5md.py +0 -0
  159. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/tests/test_stream_and_random.py +0 -0
  160. {readcon_db-0.2.2 → readcon_db-0.2.4}/python/tests/test_streaming_guide.py +0 -0
  161. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/eon36_lj_dimer.convel +0 -0
  162. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/sulfolene.con +0 -0
  163. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/tiny_cuh2.con +0 -0
  164. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/tiny_cuh2.convel +0 -0
  165. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/tiny_cuh2_forces.con +0 -0
  166. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/tiny_cuh2_vel_forces.con +0 -0
  167. {readcon_db-0.2.2 → readcon_db-0.2.4}/resources/test/tiny_multi_cuh2.con +0 -0
  168. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/assemble-site.sh +0 -0
  169. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/build-docs.sh +0 -0
  170. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/check-clib-dist.sh +0 -0
  171. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/check-cpc-freeze.sh +0 -0
  172. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/check-cxx-dist.sh +0 -0
  173. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/crate_version.py +0 -0
  174. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/export-landing.sh +0 -0
  175. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/package-cxx.sh +0 -0
  176. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/release-prep.sh +0 -0
  177. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/set-version.sh +0 -0
  178. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/sync-version.py +0 -0
  179. {readcon_db-0.2.2 → readcon_db-0.2.4}/scripts/test_check_version_lockstep.py +0 -0
  180. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/bin/readcon-db.rs +0 -0
  181. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/error.rs +0 -0
  182. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/frame_codec.rs +0 -0
  183. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/frame_scalars.rs +0 -0
  184. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/keys.rs +0 -0
  185. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/mpi_read.rs +0 -0
  186. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/mpi_wire.rs +0 -0
  187. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/select.rs +0 -0
  188. {readcon_db-0.2.2 → readcon_db-0.2.4}/src/topology.rs +0 -0
  189. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/atom_order.rs +0 -0
  190. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/canonical_dump.rs +0 -0
  191. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/catalog_claims.rs +0 -0
  192. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/cli_refuse.rs +0 -0
  193. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/cmake-project/CMakeLists.txt +0 -0
  194. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/cooked_soa_authority.rs +0 -0
  195. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/meson-wrap/meson.build +0 -0
  196. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/mpi-c/ingest_smoke.c +0 -0
  197. {readcon_db-0.2.2 → readcon_db-0.2.4}/tests/topology_cli.rs +0 -0
  198. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/assets/logo.svg +0 -0
  199. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/assets/wordmark.svg +0 -0
  200. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/css/site.css +0 -0
  201. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/export.el +0 -0
  202. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/index.html +0 -0
  203. {readcon_db-0.2.2 → readcon_db-0.2.4}/website/index.org +0 -0
@@ -31,10 +31,17 @@ jobs:
31
31
  components: clippy
32
32
  - name: Cache cargo
33
33
  uses: Swatinem/rust-cache@v2
34
+ - name: Install Python headers
35
+ if: runner.os == 'Linux'
36
+ run: sudo apt-get update && sudo apt-get install -y python3-dev
34
37
  - name: Test (locked)
35
38
  run: cargo test --locked --all-targets
39
+ - name: Test with the C ABI (capi)
40
+ run: cargo test --locked --all-targets --features capi
36
41
  - name: Clippy
37
42
  run: cargo clippy --locked --all-targets
43
+ - name: Clippy with the C ABI (capi)
44
+ run: cargo clippy --locked --all-targets --features capi
38
45
  - name: Docs
39
46
  run: cargo doc --locked --no-deps
40
47
  - name: Verify registry package
@@ -106,7 +106,7 @@ jobs:
106
106
  - name: C wrapper on a split communicator
107
107
  run: |
108
108
  set -euo pipefail
109
- cargo build --features mpi --lib
109
+ cargo build --features mpi,capi --lib
110
110
  ${{ matrix.cc }} -Iinclude tests/mpi-c/ingest_smoke.c -Ltarget/debug -lreadcon_db -Wl,-rpath,$PWD/target/debug -o ingest_smoke
111
111
  for p in 1 2 3 4; do
112
112
  T=$(mktemp -d)
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.4 - 2026-11-25
4
+ #### Features
5
+ - expose hash_con_text to c, fortran and python - (6704042) - *HaoZeke*
6
+ #### Bug Fixes
7
+ - free a parsed frame in this library - (c6db980) - *HaoZeke*
8
+ - compile mimalloc with local-dynamic tls - (f9c24f9) - *HaoZeke*
9
+ - hash con text over the stored source span - (7d45827) - *HaoZeke*
10
+ - rescale frame units through the column arrays - (73de882) - *HaoZeke*
11
+ - keep source spans in extend_trajectory_str - (de86b9c) - *HaoZeke*
12
+ - compile the C ABI only with the capi feature - (05bf53f) - *HaoZeke*
13
+ #### Documentation
14
+ - say that a source build needs cmake outside windows - (b7a45bb) - *HaoZeke*
15
+ - record resume of six-decimal extend frames - (fbcc627) - *HaoZeke*
16
+ - say that the C ABI needs the capi feature - (2d1ce76) - *HaoZeke*
17
+ #### Tests
18
+ - reject static tls on the linux cdylibs - (344ae77) - *HaoZeke*
19
+ - record that con major-4 files are refused at ingest - (eb12d0b) - *HaoZeke*
20
+ - cover extend text identity and six-decimal resumes - (6daef42) - *HaoZeke*
21
+ - build each capi_symbols feature set in its own target dir - (c03b56d) - *HaoZeke*
22
+ - pin rkrdb_ exports to the capi feature - (7024018) - *HaoZeke*
23
+ #### Build system
24
+ - require readcon-core 0.23.2 - (98a127d) - *HaoZeke*
25
+ - always enable the capi feature for C ABI builds - (98df81b) - *HaoZeke*
26
+ #### Refactoring
27
+ - name FloatFormat::RoundTrip for in-memory frames - (11ac25f) - *HaoZeke*
28
+ #### Style
29
+ - taplo-format Cargo.toml - (c153759) - *HaoZeke*
30
+
31
+ ## v0.2.3 - 2026-11-19
32
+ #### Bug Fixes
33
+ - join and split preserve catalog records and work claims across shards
34
+
3
35
  ## v0.2.2 - 2026-11-19
4
36
  #### Features
5
37
  - (**python**) add insert_catalog_record and list_catalog_records - (218ff19) - *HaoZeke*
@@ -10,7 +10,7 @@ authors:
10
10
  license: MIT
11
11
  repository-code: "https://github.com/lode-org/readcon-db"
12
12
  # [[[cog cog.outl(f'version: {VERSION}') ]]]
13
- version: 0.2.2
13
+ version: 0.2.4
14
14
  # [[[end]]]
15
15
  date-released: "2026-08-15"
16
16
  keywords:
@@ -53,7 +53,7 @@ endif()
53
53
 
54
54
  option(BUILD_SHARED_LIBS "Use a shared library by default instead of a static one" ON)
55
55
  option(READCON_DB_INSTALL_BOTH_STATIC_SHARED "Install both shared and static libraries" ON)
56
- set(READCON_DB_CARGO_FEATURES "" CACHE STRING "Comma-free cargo features to enable (space-separated)")
56
+ set(READCON_DB_CARGO_FEATURES "" CACHE STRING "Extra cargo features to enable (space-separated). The capi feature is always enabled.")
57
57
 
58
58
  set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install binaries/DLL")
59
59
  set(LIB_INSTALL_DIR "lib" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install libraries")
@@ -147,10 +147,11 @@ endif()
147
147
 
148
148
  set(CARGO_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}/cargo-target)
149
149
  set(CARGO_BUILD_ARG "${CARGO_BUILD_ARG};--target-dir=${CARGO_TARGET_DIR}")
150
- if (NOT "${READCON_DB_CARGO_FEATURES}" STREQUAL "")
151
- string(REPLACE " " "," _feats "${READCON_DB_CARGO_FEATURES}")
152
- set(CARGO_BUILD_ARG "${CARGO_BUILD_ARG};--features=${_feats}")
153
- endif()
150
+ # The C ABI (src/ffi.rs) is only compiled with the capi feature.
151
+ set(_cargo_features "capi ${READCON_DB_CARGO_FEATURES}")
152
+ string(STRIP "${_cargo_features}" _cargo_features)
153
+ string(REPLACE " " "," _feats "${_cargo_features}")
154
+ set(CARGO_BUILD_ARG "${CARGO_BUILD_ARG};--features=${_feats}")
154
155
 
155
156
  if ("${RUST_BUILD_TARGET}" STREQUAL "")
156
157
  if (CARGO_VERSION_RAW MATCHES "host: ([a-zA-Z0-9_\\-]*)\n")
@@ -122,6 +122,15 @@ dependencies = [
122
122
  "libloading",
123
123
  ]
124
124
 
125
+ [[package]]
126
+ name = "cmake"
127
+ version = "0.1.58"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
130
+ dependencies = [
131
+ "cc",
132
+ ]
133
+
125
134
  [[package]]
126
135
  name = "conv"
127
136
  version = "0.3.3"
@@ -180,6 +189,12 @@ dependencies = [
180
189
  "typenum",
181
190
  ]
182
191
 
192
+ [[package]]
193
+ name = "cty"
194
+ version = "0.2.2"
195
+ source = "registry+https://github.com/rust-lang/crates.io-index"
196
+ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
197
+
183
198
  [[package]]
184
199
  name = "custom_derive"
185
200
  version = "0.1.7"
@@ -267,6 +282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
267
282
  checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
268
283
  dependencies = [
269
284
  "crc32fast",
285
+ "libz-ng-sys",
270
286
  "miniz_oxide",
271
287
  ]
272
288
 
@@ -510,6 +526,26 @@ dependencies = [
510
526
  "windows-link",
511
527
  ]
512
528
 
529
+ [[package]]
530
+ name = "libmimalloc-sys"
531
+ version = "0.1.49"
532
+ source = "registry+https://github.com/rust-lang/crates.io-index"
533
+ checksum = "6a45a52f43e1c16f667ccfe4dd8c85b7f7c204fd5e3bf46c5b0db9a5c3c0b8e9"
534
+ dependencies = [
535
+ "cc",
536
+ "cty",
537
+ ]
538
+
539
+ [[package]]
540
+ name = "libz-ng-sys"
541
+ version = "1.1.33"
542
+ source = "registry+https://github.com/rust-lang/crates.io-index"
543
+ checksum = "922f69da893772fd14ea9118138d1111f89830a9753438ddf69987f24600cb63"
544
+ dependencies = [
545
+ "cmake",
546
+ "libc",
547
+ ]
548
+
513
549
  [[package]]
514
550
  name = "linux-raw-sys"
515
551
  version = "0.12.1"
@@ -558,6 +594,15 @@ dependencies = [
558
594
  "libc",
559
595
  ]
560
596
 
597
+ [[package]]
598
+ name = "mimalloc"
599
+ version = "0.1.52"
600
+ source = "registry+https://github.com/rust-lang/crates.io-index"
601
+ checksum = "2d4139bb28d14ad1facf21d5eb8825051b326e172d216b39f6d31df53cc97862"
602
+ dependencies = [
603
+ "libmimalloc-sys",
604
+ ]
605
+
561
606
  [[package]]
562
607
  name = "minimal-lexical"
563
608
  version = "0.2.1"
@@ -651,6 +696,15 @@ dependencies = [
651
696
  "autocfg",
652
697
  ]
653
698
 
699
+ [[package]]
700
+ name = "object"
701
+ version = "0.36.7"
702
+ source = "registry+https://github.com/rust-lang/crates.io-index"
703
+ checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
704
+ dependencies = [
705
+ "memchr",
706
+ ]
707
+
654
708
  [[package]]
655
709
  name = "once_cell"
656
710
  version = "1.21.4"
@@ -850,9 +904,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
850
904
 
851
905
  [[package]]
852
906
  name = "readcon-core"
853
- version = "0.21.0"
907
+ version = "0.23.2"
854
908
  source = "registry+https://github.com/rust-lang/crates.io-index"
855
- checksum = "08b9703489462ee25ce5ccc00bc357ec2a14c08a5ea2de6778ca612b64839060"
909
+ checksum = "87c32a8afef74ec96ed1a8e09e5f4ae56ae3cd982791d438a23b51eeeddce6c8"
856
910
  dependencies = [
857
911
  "dlpk",
858
912
  "fast-float2",
@@ -861,6 +915,7 @@ dependencies = [
861
915
  "libc",
862
916
  "memchr",
863
917
  "memmap2",
918
+ "mimalloc",
864
919
  "ndarray",
865
920
  "rustc-hash",
866
921
  "ryu",
@@ -869,11 +924,13 @@ dependencies = [
869
924
 
870
925
  [[package]]
871
926
  name = "readcon-db"
872
- version = "0.2.2"
927
+ version = "0.2.4"
873
928
  dependencies = [
874
929
  "heed",
875
930
  "libc",
931
+ "mimalloc",
876
932
  "mpi",
933
+ "object",
877
934
  "pyo3",
878
935
  "readcon-core",
879
936
  "serde",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "readcon-db"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  edition = "2021"
5
5
  description = "Mmap-backed CON frame corpus (Heed/LMDB), xxHash exact match, multi-language FFI"
6
6
  license = "MIT"
@@ -19,6 +19,9 @@ crate-type = ["lib", "cdylib", "staticlib"]
19
19
  [features]
20
20
  default = []
21
21
  python = ["dep:pyo3"]
22
+ # Compiles the C ABI (src/ffi.rs and the rkrdb_* exports in src/archive.rs
23
+ # and src/mpi_ingest.rs). Off by default so Rust consumers do not export
24
+ # unmangled rkrdb_* symbols. C, Fortran and cargo-c builds must enable it.
22
25
  capi = []
23
26
  # Parallel ingest over a caller-supplied communicator (rsmpi). Needs an MPI
24
27
  # implementation and libclang at build time. See src/mpi_ingest.rs.
@@ -27,7 +30,15 @@ mpi = ["dep:mpi"]
27
30
  [dependencies]
28
31
  heed = "0.21"
29
32
  # The pinned writer provides exact numeric CON and JSON round trips.
30
- readcon-core = "=0.21.0"
33
+ readcon-core = "=0.23.2"
34
+ # readcon-core installs mimalloc as the global allocator and has no
35
+ # feature to turn that off. The C objects default to initial-exec TLS,
36
+ # which sets DF_STATIC_TLS on this cdylib. Cargo unifies
37
+ # local_dynamic_tls onto that same mimalloc.
38
+ mimalloc = { version = "0.1.43", default-features = false, features = [
39
+ "extended",
40
+ "local_dynamic_tls",
41
+ ] }
31
42
  thiserror = "2"
32
43
  serde = { version = "1", features = ["derive"] }
33
44
  serde_json = "1"
@@ -41,10 +52,20 @@ mpi = { version = "0.8", optional = true, default-features = false }
41
52
  tempfile = "3"
42
53
  sha2 = "0.10"
43
54
  libc = "0.2"
55
+ object = { version = "0.36", default-features = false, features = [
56
+ "read_core",
57
+ "archive",
58
+ "elf",
59
+ "macho",
60
+ "pe",
61
+ "coff",
62
+ ] }
44
63
 
45
64
  [package.metadata.docs.rs]
46
65
  all-features = false
47
66
 
67
+ # cargo-c has no per-package default features: run
68
+ # `cargo cbuild --features capi` / `cargo cinstall --features capi`.
48
69
  [package.metadata.capi]
49
70
  min_version = "0.10.17"
50
71
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: readcon-db
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Mmap CON corpus store (LMDB/Heed) with xxHash exact match
5
5
  Home-Page: https://lode-org.github.io/readcon-db/
6
6
  License: MIT
@@ -39,11 +39,16 @@ Docs: <https://lode-org.github.io/readcon-db/> · crate: <https://crates.io/crat
39
39
 
40
40
  ## Quick start (from source)
41
41
 
42
+ Outside Windows a source build also needs CMake: readcon-core links
43
+ zlib-ng, which `libz-ng-sys` builds with CMake.
44
+
42
45
  ```bash
43
46
  git clone https://github.com/lode-org/readcon-db
44
47
  cd readcon-db
45
48
  cargo test --locked
46
- cargo build --release # libreadcon_db + CLI readcon-db
49
+ cargo test --locked --features capi
50
+ cargo build --release # CLI readcon-db; no C symbols
51
+ cargo build --release --features capi # libreadcon_db with the C ABI
47
52
  ```
48
53
 
49
54
  Optional LODE sibling checkout (edit core + db together): clone both under the same parent, then create **untracked** `.cargo/config.toml` in `readcon-db`:
@@ -26,11 +26,16 @@ Docs: <https://lode-org.github.io/readcon-db/> · crate: <https://crates.io/crat
26
26
 
27
27
  ## Quick start (from source)
28
28
 
29
+ Outside Windows a source build also needs CMake: readcon-core links
30
+ zlib-ng, which `libz-ng-sys` builds with CMake.
31
+
29
32
  ```bash
30
33
  git clone https://github.com/lode-org/readcon-db
31
34
  cd readcon-db
32
35
  cargo test --locked
33
- cargo build --release # libreadcon_db + CLI readcon-db
36
+ cargo test --locked --features capi
37
+ cargo build --release # CLI readcon-db; no C symbols
38
+ cargo build --release --features capi # libreadcon_db with the C ABI
34
39
  ```
35
40
 
36
41
  Optional LODE sibling checkout (edit core + db together): clone both under the same parent, then create **untracked** `.cargo/config.toml` in `readcon-db`:
@@ -66,7 +66,7 @@ See @@rst::doc:`/cooked-soa`@@.
66
66
  :PROPERTIES:
67
67
  :CUSTOM_ID: ingest-path
68
68
  :END:
69
- 1. Path / CON text: =ConFrameIterator::next_with_raw_span= when possible.
69
+ 1. Path / CON text: =ConFrameIterator::next_with_raw_span= for append and for extend of a file or string. In-memory frames and a units stamp use the round-trip writer. An older six-decimal row is left as stored.
70
70
  2. *In-memory* =append_trajectory_frames= / =extend_trajectory_frames= for chemfiles → corpus.
71
71
  3. Parse once for indexes (natoms, symbols, composition, energy, fmax, flags).
72
72
  4. Store blob; compute *xxHash3-128*; update secondary B-trees.
@@ -72,6 +72,10 @@ Formula encoding: sorted non-empty symbols, =Sym:count= joined by =|= (e.g. =Cu
72
72
  2. *In-memory frames* (=append_trajectory_frames= / =extend_trajectory_frames=) for chemfiles → =ConFrame= → corpus without a temp file. Python: =append_trajectory_str= / =append_trajectory_frames=. C: =rkrdb_append_trajectory_str= / =rkrdb_append_trajectory_frame= (=RKRConFrame*=).
73
73
  3. Directory ingest (=ingest_directory=).
74
74
 
75
+ =extend_trajectory_str= and =extend_trajectory_path= (no units stamp) store those same raw spans. Python =extend_trajectory= and C =rkrdb_extend_trajectory= are that path. A units stamp, and in-memory =extend_trajectory_frames=, write with readcon-core =FloatFormat::RoundTrip= because the original text is gone.
76
+
77
+ Stores already written at six decimal places are not migrated. Open and a later extend leave those rows byte for byte. A resume that hashes the original high-precision file misses and starts a new trajectory. A resume that hashes the stored six-decimal text hits the same trajectory when that text still parses. A mass near =1e-9= written at six decimals can become =0.000000=, which fails mass validation, so that stored spelling does not resume.
78
+
75
79
  ** Reindex
76
80
  :PROPERTIES:
77
81
  :CUSTOM_ID: reindex
@@ -209,7 +213,7 @@ Assign trajectory IDs so ~traj_id % n_shards == shard_id~ (CLI =shard-ingest= ad
209
213
  :END:
210
214
  *KEEP sharded LMDB (Heed).* Single-env multi-writer contradicts LMDB SWMR; HPC-scale uploads use *independent envs per shard* (MDHIM-style local backends / industry sharded-LMDB practice). Full rationale, citations (LMDB docs, MDHIM HotStorage'15, PapyrusKV, RocksDB contrast, HDF5/Zarr/ADIOS2/DAOS contrast), risks, and falsifiers: see the architecture note on sharded LMDB. Do *not* interpret “one write_txn per env” as “LMDB cannot do multi-process writes”---only that *partitioning is mandatory* for concurrent commits.
211
215
 
212
- ** Compaction: reversible join / split for analysis
216
+ ** Compaction: join / split for analysis
213
217
  :PROPERTIES:
214
218
  :CUSTOM_ID: compaction-reversible-join-split-for-analysis
215
219
  :END:
@@ -219,4 +223,4 @@ Assign trajectory IDs so ~traj_id % n_shards == shard_id~ (CLI =shard-ingest= ad
219
223
  | *single-env-lmdb* | =compact-join= / ordinary =ingest= | Laptop analysis; =ConCorpus::open_readonly= |
220
224
  | *extxyz* | =compact-export-extxyz= [--sharded] | External ML tools (non-LMDB) |
221
225
 
222
- Join copies CON blobs by traj (ids preserved; duplicate traj across shards errors). Split routes =traj_id % n_shards= into a new manifest root. Membership is reversible under that routing (indexes rebuilt via normal prepare/commit ingest).
226
+ Join copies CON blobs by traj (ids preserved; duplicate traj across shards errors). Split routes =traj_id % n_shards= into a new manifest root. Frame traj_ids round-trip under that routing (indexes rebuilt via normal prepare/commit ingest); split places catalog records and unchanged work claims in shard zero.
@@ -75,7 +75,7 @@ readcon-db join-drained /lustre/orion/proj/campaign_single \
75
75
  /lustre/orion/proj/campaign/node_*
76
76
  #+end_src
77
77
 
78
- =join-drained= requires =shards.json= on every source, refuses an existing dest, and refuses traj-id collisions *before* creating dest. Give writers disjoint traj id ranges (or disjoint shard sets) so join does not collide.
78
+ =join-drained= requires =shards.json= on every source and refuses an existing dest. Before creating dest, it refuses traj-id collisions, duplicate catalog identities (namespace, subject, fingerprint), and duplicate work-claim keys (namespace, task). Catalog records and claims use the same policy: an identity present in two sources is an error even when its stored bytes are identical. Give writers disjoint traj id ranges (or disjoint shard sets), catalog identities, and claim keys so join does not collide.
79
79
 
80
80
  =drain= to a dest that already has =shard_XXXX/data.mdb= is an error: two node-local trees that share a shard id must not last-writer-wins.
81
81
 
@@ -140,14 +140,15 @@ Same-frame MPI: do *not* open the env on every rank. Rank 0 of the *caller commu
140
140
  :PROPERTIES:
141
141
  :CUSTOM_ID: refuses-do-not-fight-them
142
142
  :END:
143
- | Command | Refuse |
144
- |----------------------------------+---------------------------------------------------------------------------------------------------|
145
- | =shard-ingest= | missing =shards.json=; =--start-id= not congruent to =--shard= |
146
- | =shard-select= / =compact-join= | missing root / missing =shards.json= (no mint) |
147
- | =drain= | missing source =shards.json=; dest =shard_XXXX/data.mdb= already exists; dest =n_shards= mismatch |
148
- | =join-drained= | dest exists; a source lacks =shards.json=; traj id appears in more than one source |
149
- | =compact-join= / =compact-split= | dest exists; source missing |
150
- | =compact-export-extxyz= | sharded root without =--sharded=; dest exists |
143
+ | Command | Refuse |
144
+ |---------------------------------+---------------------------------------------------------------------------------------------------------------------|
145
+ | =shard-ingest= | missing =shards.json=; =--start-id= not congruent to =--shard= |
146
+ | =shard-select= / =compact-join= | missing root / missing =shards.json= (no mint) |
147
+ | =drain= | missing source =shards.json=; dest =shard_XXXX/data.mdb= already exists; dest =n_shards= mismatch |
148
+ | =join-drained= | dest exists; source lacks =shards.json=; duplicate traj id, catalog identity, or work-claim key |
149
+ | =compact-join= | dest exists; source missing; duplicate traj id, catalog identity, or work-claim key across shards |
150
+ | =compact-split= | dest exists; source missing |
151
+ | =compact-export-extxyz= | sharded root without =--sharded=; dest exists; duplicate traj id, catalog identity, or work-claim key across shards |
151
152
 
152
153
  On refuse, dest is not created (or a partial dest is removed). Tests: =tests/cli_refuse.rs=, =src/shard.rs=.
153
154
 
@@ -35,10 +35,13 @@ Install [[https://pypi.org/project/readcon/][readcon]] (core) as well when you n
35
35
  git clone https://github.com/lode-org/readcon-db
36
36
  cd readcon-db
37
37
  cargo test --locked
38
- cargo build --release # libreadcon_db + CLI readcon-db
38
+ cargo test --locked --features capi
39
+ cargo build --release # CLI readcon-db; no C symbols
40
+ cargo build --release --features capi # libreadcon_db with the C ABI
39
41
  #+end_src
40
42
 
41
43
  =readcon-core= comes from crates.io (~{{{readcon-core-req}}}~).
44
+ A build from source, including =cargo install=, the Python sdist and the cxx tarball, needs CMake outside Windows: readcon-core links zlib-ng, which =libz-ng-sys= builds with CMake.
42
45
  Add an *untracked* =.cargo/config.toml= with the patch below to build against a local core tree.
43
46
 
44
47
  #+begin_src toml
@@ -57,6 +60,8 @@ maturin develop --release --features python --manifest-path python/pyproject.tom
57
60
  :PROPERTIES:
58
61
  :CUSTOM_ID: c-c-no-cbindgen
59
62
  :END:
63
+ The C ABI (=rkrdb_*=) is compiled only with the =capi= cargo feature, which is off by default so that Rust consumers do not export unmangled =rkrdb_*= symbols. The CMake and Meson builds, =scripts/package-clib.sh= and the clib tarball enable =capi= for you. A plain =cargo build --features capi=, or =cargo cbuild --features capi= with cargo-c, is needed when you drive cargo yourself. =READCON_DB_CARGO_FEATURES= (CMake) and =-Dcargo_features= (Meson) add features on top of =capi=.
64
+
60
65
  =include/readcon-db.h= is hand-written and shipped. Optional =include/readcon-db-mpi.h= takes the caller's =MPI_Comm= (not linked into the library). CMake FetchContent, Meson wrap, and =pkg-config= do *not* run cbindgen.
61
66
 
62
67
  CMake:
@@ -103,7 +108,7 @@ export READCON_DB_LIB="$PREFIX/lib/libreadcon_db.so"
103
108
  pkg-config --cflags --libs readcon-db
104
109
  #+end_src
105
110
 
106
- The cxx tarball still needs rustc/cargo. The clib tarball is the Fortran / C path that does not.
111
+ The cxx tarball still needs rustc/cargo, and CMake outside Windows. The clib tarball is the Fortran / C path that does not.
107
112
 
108
113
  ** Fortran
109
114
  :PROPERTIES:
@@ -117,7 +122,7 @@ fpm build --flag "$(pkg-config --cflags readcon-db)" \
117
122
  --link-flag "$(pkg-config --libs readcon-db) -ldl -lpthread -lm"
118
123
  #+end_src
119
124
 
120
- From a checkout (after a release build of the cdylib):
125
+ From a checkout (after =cargo build --release --features capi=):
121
126
 
122
127
  #+begin_src sh
123
128
  cd fortran/ReadConDb && fpm build --flag "-I../../include" \
@@ -4,7 +4,7 @@
4
4
  :PROPERTIES:
5
5
  :CUSTOM_ID: mpi-ingest-and-export
6
6
  :END:
7
- Build with =--features mpi= against one MPI implementation (=MPICC=mpicc.mpich= or =mpicc.openmpi=). The library never calls =MPI_Init= and only uses the communicator you pass.
7
+ Build with =--features mpi= against one MPI implementation (=MPICC=mpicc.mpich= or =mpicc.openmpi=). The library never calls =MPI_Init= and only uses the communicator you pass. The C and Fortran entry point =rkrdb_mpi_ingest_paths_f= also needs the =capi= feature (=--features mpi,capi=).
8
8
 
9
9
  ** Ingest
10
10
  :PROPERTIES:
@@ -34,8 +34,20 @@ Rust is =ConCorpus::open= and =ConCorpus::open_readonly=. The command line is =r
34
34
  :END:
35
35
  =append_trajectory_frames= commits 64 frames at a time. The first group is a new trajectory. Each later group extends it. A list returned by =read_con= is written from the frames the parser already stored, so the append does not build a Python atom for every site.
36
36
 
37
+ Each group of CON text from =readcon.write_con_string= is parsed by readcon-db and stored with readcon-core =FloatFormat::RoundTrip=, so every finite value reads back as the same binary64 and the stored spelling does not depend on the default writer of the installed =readcon= wheel. =ConCorpus.hash_con_text= of the stored text equals =frame_hash=.
38
+
37
39
  Rust =ConCorpus::append_trajectory_frames= still commits the slice you pass in one transaction. The grouping is the Python binding.
38
40
 
41
+ ** Extend a live trajectory
42
+ :PROPERTIES:
43
+ :CUSTOM_ID: extend-a-live-trajectory
44
+ :END:
45
+ Python =extend_trajectory=, C =rkrdb_extend_trajectory=, and Rust =extend_trajectory_str= / =extend_trajectory_path= append the file's own frame text. The content hash is the xxh3-128 of that text, so a later open of the same file finds the same generation.
46
+
47
+ To look a file up before a resume, hash it with Rust =ConCorpus::hash_con_text=, Python =ConCorpus.hash_con_text=, C =rkrdb_hash_con_text=, Fortran =db_hash_con_text=, or =readcon-db hash-file <file.con>=. All of them hash the first frame's source span as written, the same bytes the store hashed, and the result goes to =find_by_hash=.
48
+
49
+ A corpus written by an older extend stored those frames at six decimal places. Opening it does not rewrite the rows. Resuming from the original file misses those hashes and starts a new trajectory. Resuming from the stored six-decimal text hits when that text still parses. A mass near =1e-9= can round to =0.000000= and then fail to parse.
50
+
39
51
  ** Random access
40
52
  :PROPERTIES:
41
53
  :CUSTOM_ID: random-access
@@ -14,13 +14,13 @@ Header: [[https://github.com/lode-org/readcon-db/blob/main/include/readcon-db.h]
14
14
 
15
15
  #+begin_src C
16
16
  #define RKRDB_ABI_VERSION_MAJOR 1
17
- #define RKRDB_ABI_VERSION_MINOR 1
17
+ #define RKRDB_ABI_VERSION_MINOR 3
18
18
  #define RKRDB_ABI_LAYOUT_REVISION 1
19
19
 
20
20
  uint32_t rkrdb_abi_version_major(void);
21
21
  uint32_t rkrdb_abi_version_minor(void);
22
22
  uint32_t rkrdb_abi_layout_revision(void);
23
- const char *rkrdb_abi_stamp(void); /* "readcon-db/abi-1.1/layout-1" */
23
+ const char *rkrdb_abi_stamp(void); /* "readcon-db/abi-1.3/layout-1" */
24
24
  int rkrdb_abi_compatible(uint32_t major, uint32_t minor, uint32_t layout_revision);
25
25
  #+end_src
26
26
 
@@ -35,7 +35,7 @@ if (!rkrdb_abi_compatible(RKRDB_ABI_VERSION_MAJOR, RKRDB_ABI_VERSION_MINOR,
35
35
  }
36
36
  #+end_src
37
37
 
38
- The numbers live in =src/ffi.rs= and are repeated in =include/readcon-db.h=, which is hand-written. The =abi_header_carries_the_stamp= unit test fails when the two disagree. They do not follow the package version, and a release that changes no exported symbol leaves them where they are.
38
+ The numbers live in =src/ffi.rs= (compiled with the =capi= feature) and are repeated in =include/readcon-db.h=, which is hand-written. The =abi_header_carries_the_stamp= unit test fails when the two disagree. They do not follow the package version, and a release that changes no exported symbol leaves them where they are.
39
39
 
40
40
  - =RKRDB_ABI_VERSION_MAJOR=: increment for a change an old caller cannot survive: removing or renaming an exported function, changing a signature, or changing the meaning of an argument or status code. Reset the minor to 0.
41
41
  - =RKRDB_ABI_VERSION_MINOR=: increment for an additive change that leaves every old call valid, such as a new exported function or a new status code.
@@ -85,6 +85,9 @@ rkrdb_result_key(id, 0, &traj, &frame);
85
85
  uint8_t hash[16];
86
86
  rkrdb_frame_hash(id, traj, frame, hash);
87
87
  rkrdb_select_hash(id, hash);
88
+ /* text, len: a CON file read into memory */
89
+ rkrdb_hash_con_text(text, len, hash); /* first frame, as the corpus stores it */
90
+ rkrdb_select_hash(id, hash);
88
91
  rkrdb_close(id);
89
92
  rkrdb_open_readonly("/tmp/corpus", &id);
90
93
  rkrdb_close(id);
@@ -92,9 +95,13 @@ rkrdb_close(id);
92
95
 
93
96
  Status: =RKRDB_OK= (0), =RKRDB_ERR= (-1), =RKRDB_NOT_FOUND= (-2), =RKRDB_NULL= (-3).
94
97
 
98
+ =rkrdb_hash_con_text= hashes the first frame's source span in =len= bytes of CON text, the bytes =rkrdb_append_trajectory=, =rkrdb_append_trajectory_str= and =rkrdb_extend_trajectory= store for it. It is the hash =readcon-db hash-file= prints. It does not parse and rewrite the frame, so a high-precision file finds its stored frame. =rkrdb_xxh3_128= hashes whatever bytes it is given. Added in ABI 1.2.
99
+
100
+ =rkrdb_get_frame= returns a parsed frame allocated in =libreadcon_db=. Free that pointer with =rkrdb_free_frame=. A null pointer is a no-op. =free_rkr_frame= in =libreadcon_core= frees with that library's allocator, and each shared library has its own copy, so it is not the matching free. Added in ABI 1.3.
101
+
95
102
  =rkrdb_h5md_*= returns =RKRDB_NULL= for an invalid handle. A collect failure returns =RKRDB_ERR= and leaves the message in =rkrdb_last_error=. =rkrdb_set_units= returns that missing-=units.time= error for a v3.1 clock or velocities frame instead of assuming =fs=. v1, v2, and v3.0 clocks with no =units.time= still convert as =fs=. H5MD velocities follow D10 and are written as =Angstrom ps-1=. v1, v2, and v3.0 frames use =(amu*angstrom^2/eV)^0.5= whatever the time label says. v3.1 frames use =units.time= and fail when a velocities section has no =units.time=. =rkrdb_set_velocity_time_unit= (C++ =Corpus::set_velocity_time_unit=) overrides that rule for a file that breaks it. Pass =fs= when the file really stored Angstrom/fs. The simulation clock uses =units.time= when that key is present. A v3.1 frame with =time= or =timestep= and no =units.time= is an error, and the same override supplies that missing clock unit. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=.
96
103
 
97
- Link =libreadcon_db= from =cargo build --release= (=cdylib= / =staticlib=), or unpack the prebuilt =readcon-db-clib-$VERSION-$target.tar.gz= Release asset and =pkg-config --libs readcon-db=. See @@rst::doc:`/howto/install`@@.
104
+ Link =libreadcon_db= from =cargo build --release --features capi= (=cdylib= / =staticlib=), or unpack the prebuilt =readcon-db-clib-$VERSION-$target.tar.gz= Release asset and =pkg-config --libs readcon-db=. Without =capi= the library exports no =rkrdb_*= symbols. See @@rst::doc:`/howto/install`@@.
98
105
 
99
106
  C++ RAII:
100
107
 
@@ -6,7 +6,7 @@
6
6
  :END:
7
7
  Module: =fortran/ReadConDb/src/readcon_db.f90= (=bind(C)= to =rkrdb_*=).
8
8
 
9
- Link =libreadcon_db= from a checkout (=cargo build --release=) or from the prebuilt =readcon-db-clib-$VERSION-$target.tar.gz= Release asset (no local cargo). See @@rst::doc:`/howto/install`@@ and =fortran/README.md=.
9
+ Link =libreadcon_db= from a checkout (=cargo build --release --features capi=) or from the prebuilt =readcon-db-clib-$VERSION-$target.tar.gz= Release asset (no local cargo). See @@rst::doc:`/howto/install`@@ and =fortran/README.md=.
10
10
 
11
11
  #+begin_src fortran
12
12
  use readcon_db
@@ -22,7 +22,7 @@ call db_extend_units(id, 1_c_int64_t, "more.con", &
22
22
  call db_select_basic(id, 1_c_int64_t, "Cu", 1, 100000, 0, status)
23
23
  #+end_src
24
24
 
25
- See helpers =db_open=, =db_append=, =db_select_basic=, =db_result_count=, =db_result_key=, =db_frame_hash=, =db_xxh3_128= in the module source. Point your build system at =include/= for the C header if needed and =target/release/= (or the clib prefix =lib/= + =PKG_CONFIG_PATH=). Campaign shard/drain/join is the CLI; a Fortran rank that owns one shard opens =root/shard_XXXX= with =db_open= (@@rst::doc:`/howto/campaign`@@).
25
+ See helpers =db_open=, =db_append=, =db_select_basic=, =db_result_count=, =db_result_key=, =db_frame_hash=, =db_xxh3_128=, =db_hash_con_text= in the module source. =db_get_frame= returns a frame allocated in =libreadcon_db=; free it with =db_free_frame=. =db_hash_con_text= hashes the first frame of CON text the way the corpus stored it, so it matches =db_frame_hash= for a file appended or extended from its path. Point your build system at =include/= for the C header if needed and =target/release/= (or the clib prefix =lib/= + =PKG_CONFIG_PATH=). Campaign shard/drain/join is the CLI; a Fortran rank that owns one shard opens =root/shard_XXXX= with =db_open= (@@rst::doc:`/howto/campaign`@@).
26
26
 
27
27
  ** MPI: pack on root, Bcast on the caller INTEGER communicator
28
28
  :PROPERTIES:
@@ -37,6 +37,7 @@ hits = db.find_by_atom_order_path("product.con")
37
37
  # hits[0].permutation[i] is the query index of stored atom i
38
38
  text = db.get_frame_text(1, 0)
39
39
  raw = ConCorpus.xxh3_128(b"blob")
40
+ h = ConCorpus.hash_con_text(Path("run.con").read_text()) # == db.frame_hash(1, 0)
40
41
  frame = db.get_frame(1, 0) # StoredFrame, not a readcon.ConFrame
41
42
  #+end_src
42
43
 
@@ -96,6 +96,10 @@ ShardedConCorpus::drain_to(src, dest)?;
96
96
  join_drained_roots(&[dest_a, dest_b], joined)?;
97
97
  #+end_src
98
98
 
99
+ =extend_trajectory_str= and =extend_trajectory_path= keep the source spans. =append_trajectory_frames=, =extend_trajectory_frames= and a units-stamped path write with =FloatFormat::RoundTrip=. =append_trajectory_frames_with_float_format= and =extend_trajectory_frames_with_float_format= take the format. An older six-decimal row is not rewritten on open or on a later extend. A resume of the original spelling misses. A resume of the stored spelling hits when that text still parses.
100
+
101
+ =ConCorpus::hash_con_text= and =readcon-db hash-file <file.con>= hash the first frame's source span, the bytes =append_trajectory_str= and =extend_trajectory_str= store and hash. The text is not parsed and written back first, so a high-precision file gives the stored hash and =find_by_hash= finds its trajectory.
102
+
99
103
  =set_trajectory_units= converts stored numbers. A v3.1 clock or velocities frame with no =units.time= is an error, not a silent =fs=; v1, v2, and v3.0 clocks with no =units.time= still convert as =fs=. =append_trajectory_path_units= and =extend_trajectory_path_units= stamp incoming frames. H5MD velocities follow D10 and are written as =Angstrom ps-1=. v1, v2, and v3.0 frames use =(amu*angstrom^2/eV)^0.5= whatever the time label says. v3.1 frames use =units.time= and =collect_h5md= fails when velocities have no =units.time=. =H5mdCollectOpts.velocity_time_unit= overrides that rule for a file that breaks it. The clock (=time=, =timestep=, H5MD time) uses =units.time= when that key is present. A v3.1 frame with =time= or =timestep= and no =units.time= is an error, and the same override supplies that missing clock unit. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=.
100
104
 
101
105
  ** Cooked SoA (RCSO)
@@ -34,7 +34,7 @@ objects (`libreadcon_db.so` and `libreadcon_core.so`). Do not static-link
34
34
  ## From a checkout
35
35
 
36
36
  ```bash
37
- cargo build --release
37
+ cargo build --release --features capi
38
38
  cd fortran/ReadConDb
39
39
  fpm build --flag "-I../../include" \
40
40
  --link-flag "-L../../target/release -lreadcon_db -ldl -lpthread -lm"
@@ -1,6 +1,6 @@
1
1
  name = "ReadConDb"
2
2
  # [[[cog cog.outl(f'version = "{VERSION}"') ]]]
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  # [[[end]]]
5
5
  license = "MIT"
6
6
  [build]