From 8fa52dcff1c13e0285ddab18153c0f1a403ec815 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:21:51 +0000 Subject: [PATCH 01/27] CI: Minor typo --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 31a91f6..16fc313 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -8,7 +8,7 @@ on: - main jobs: - buildmamba: + buildpixi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From fba4e20755e2f6a63a7b9d091c51f5c2a2579406 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:23:48 +0000 Subject: [PATCH 02/27] BLD: Add capnp --- pixi.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pixi.toml b/pixi.toml index 7705c43..54a0ab5 100644 --- a/pixi.toml +++ b/pixi.toml @@ -24,3 +24,4 @@ cpplint = ">=1.6.0,<2" pipx = ">=1.7.1,<2" fortran-compiler = ">=1.8.0,<2" clang-format = ">=19.1.0,<20" +capnproto = ">=1.0.2,<2" From dc50e91383ad9df16aa75407baa8908e68feea07 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:24:03 +0000 Subject: [PATCH 03/27] BIN: Update lockfile --- pixi.lock | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/pixi.lock b/pixi.lock index a445892..5a36c7d 100644 --- a/pixi.lock +++ b/pixi.lock @@ -15,6 +15,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.33.1-heb4867d_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/c-compiler-1.8.0-h2b85faf_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/capnproto-1.0.2-h766bdaa_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/catch2-3.7.1-h84d6215_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/clang-format-19-19.1.0-default_hb5137d0_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/clang-format-19.1.0-default_hb5137d0_0.conda @@ -105,6 +106,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/c-ares-1.33.1-h44e7173_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/c-compiler-1.8.0-hb714fc7_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/ca-certificates-2024.8.30-h8857fd0_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-64/capnproto-1.0.2-heb0326a_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/catch2-3.7.1-h37c8870_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/cctools-1010.6-h5b2de21_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/cctools_osx-64-1010.6-h98e843e_1.conda @@ -200,6 +202,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/c-ares-1.33.1-hd74edd7_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/c-compiler-1.8.0-h2664225_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.8.30-hf0a4a13_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/capnproto-1.0.2-hcee422a_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/catch2-3.7.1-h7b3277c_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/cctools-1010.6-hf67d63f_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/cctools_osx-arm64-1010.6-h4208deb_1.conda @@ -297,6 +300,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h2466b09_7.conda - conda: https://conda.anaconda.org/conda-forge/win-64/c-compiler-1.8.0-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/ca-certificates-2024.8.30-h56e8100_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/capnproto-1.0.2-hb5d7e06_2.conda - conda: https://conda.anaconda.org/conda-forge/win-64/catch2-3.7.1-hc790b64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/clang-format-19.1.0-default_hec7ea82_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/clangdev-5.0.0-flang_3.tar.bz2 @@ -663,6 +667,76 @@ packages: license: ISC size: 158482 timestamp: 1725019034582 +- kind: conda + name: capnproto + version: 1.0.2 + build: h766bdaa_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/capnproto-1.0.2-h766bdaa_2.conda + sha256: e80d7a2a433037656284fcea237f70a29659906fef011f351960355c2542fc19 + md5: 341ff15870e42dc2ac6a660b6aeb3245 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + size: 3967795 + timestamp: 1728321274561 +- kind: conda + name: capnproto + version: 1.0.2 + build: hb5d7e06_2 + build_number: 2 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/capnproto-1.0.2-hb5d7e06_2.conda + sha256: 2b68241ce5908374786b8ffe79efa97e11410a7003b36dc74be3dd0e37b22107 + md5: 96fff88fd33194c1324ece6e94817668 + depends: + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + size: 8771194 + timestamp: 1728321975836 +- kind: conda + name: capnproto + version: 1.0.2 + build: hcee422a_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/capnproto-1.0.2-hcee422a_2.conda + sha256: 5e7fbc51f6aa4a164f47f81b1870ba93e4fdec573742f7718288203da61eb08d + md5: e1720fdfdf3dfc4a03dd7fd5f6564b9d + depends: + - __osx >=11.0 + - libcxx >=17 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + size: 2910053 + timestamp: 1728321260824 +- kind: conda + name: capnproto + version: 1.0.2 + build: heb0326a_2 + build_number: 2 + subdir: osx-64 + url: https://conda.anaconda.org/conda-forge/osx-64/capnproto-1.0.2-heb0326a_2.conda + sha256: 067493bfa390971a25e82ecfadf57891f5c63359ad49933f0f7cdd4af4925cdc + md5: f1187ef74d7f8813f8ad3df9caaa8177 + depends: + - __osx >=10.13 + - libcxx >=17 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + size: 2891123 + timestamp: 1728321264577 - kind: conda name: catch2 version: 3.7.1 From 40188d0b668e24d6ebefac8e71e61a93ddb858ac Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:43:26 +0000 Subject: [PATCH 04/27] ENH: Use a meson format hook --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52c0dd9..4856a77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,3 +26,10 @@ repos: language: system types_or: [c++, c] args: ["--filter=-whitespace/comments,-runtime/references,-whitespace/indent,-runtime/int,-build/c++11"] + - id: meson-format + name: meson format + entry: meson + language: system + types: [meson] + files: \.build$ + args: ["format", "-i"] From 996f4f12971dd3299511dd74f29bef07fdf272cf Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:44:09 +0000 Subject: [PATCH 05/27] BLD: Format with meson-format and add rpc option --- CppCore/meson.build | 5 +++++ CppCore/rgpot/CuH2/meson.build | 16 +++++++++------- CppCore/rgpot/LennardJones/meson.build | 14 ++++++++------ meson.build | 4 ++-- meson_options.txt | 1 + 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/CppCore/meson.build b/CppCore/meson.build index 5d19e90..febaf14 100644 --- a/CppCore/meson.build +++ b/CppCore/meson.build @@ -16,6 +16,11 @@ potlib = library( install: true, ) +# ------------------------ Server +if get_option('with_rpc') + subdir('rgpot/rpc') +endif + # ------------------------ Examples if get_option('with_examples') diff --git a/CppCore/rgpot/CuH2/meson.build b/CppCore/rgpot/CuH2/meson.build index 01260dc..0542772 100644 --- a/CppCore/rgpot/CuH2/meson.build +++ b/CppCore/rgpot/CuH2/meson.build @@ -1,7 +1,9 @@ -cuh2 = library('cuh2', - 'CuH2Pot.cc', - 'cuh2Utils.cc', - dependencies: _deps, - cpp_args: _args, - include_directories: _incdirs, - install : true) +cuh2 = library( + 'cuh2', + 'CuH2Pot.cc', + 'cuh2Utils.cc', + dependencies: _deps, + cpp_args: _args, + include_directories: _incdirs, + install: true, +) diff --git a/CppCore/rgpot/LennardJones/meson.build b/CppCore/rgpot/LennardJones/meson.build index 4faa050..ddc2206 100644 --- a/CppCore/rgpot/LennardJones/meson.build +++ b/CppCore/rgpot/LennardJones/meson.build @@ -1,6 +1,8 @@ -lennard_jones = library('lennard_jones', - 'LJPot.cc', - dependencies: _deps, - cpp_args: _args, - include_directories: ['../../'], - install : true) +lennard_jones = library( + 'lennard_jones', + 'LJPot.cc', + dependencies: _deps, + cpp_args: _args, + include_directories: ['../../'], + install: true, +) diff --git a/meson.build b/meson.build index 9c283e9..a46b60f 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,7 @@ _deps += m_dep _deps += [declare_dependency(link_args: '-lstdc++')] if get_option('with_examples') -# Eigen + # Eigen if not get_option('with_eigen') eigen_dep = dependency('eigen3') if not eigen_dep.found() @@ -52,7 +52,7 @@ if get_option('with_examples') fmt_dep = dependency('fmt', required: true) _deps += fmt_dep if not get_option('with_xtensor') -# These are added if not done later + # These are added if not done later _deps += dependency('xtensor') _deps += dependency('xtensor-blas') _args += ['-DWITH_XTENSOR=TRUE'] diff --git a/meson_options.txt b/meson_options.txt index 94d4299..c457309 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,4 +5,5 @@ option('with_bench', type : 'boolean', value : false) option('with_examples', type : 'boolean', value : false) option('with_xtensor', type : 'boolean', value : false) option('with_eigen', type : 'boolean', value : false) +option('with_rpc', type : 'boolean', value : false) option('pure_lib', type : 'boolean', value : true) From efc9ca0f8fcba2697b1c97b0cff64ae71482f21c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 09:51:37 +0000 Subject: [PATCH 06/27] ENH: First pass at an interface --- CppCore/rgpot/rpc/Potentials.capnp | 41 ++++++++++++++++++++++++++++++ CppCore/rgpot/rpc/meson.build | 14 ++++++++++ 2 files changed, 55 insertions(+) create mode 100644 CppCore/rgpot/rpc/Potentials.capnp create mode 100644 CppCore/rgpot/rpc/meson.build diff --git a/CppCore/rgpot/rpc/Potentials.capnp b/CppCore/rgpot/rpc/Potentials.capnp new file mode 100644 index 0000000..8c224a5 --- /dev/null +++ b/CppCore/rgpot/rpc/Potentials.capnp @@ -0,0 +1,41 @@ +@0xbd1f89fa17369103; + +struct Position { + x @0 :Float64; + y @1 :Float64; + z @2 :Float64; +} + +struct AtomMatrix { + positions @0 :List(Position); +} + +struct BoxMatrix { + box @0: List(Vector); +} + +struct Vector { + x @0: Float64; + y @1: Float64; + z @2: Float64; +} + +struct AtomTypes { + atomTypes @0: List(Int32); +} + +struct PotentialResult { + energy @0: Float64; + forces @1: List(ForceVector); +} + +struct ForceVector { + x @0: Float64; + y @1: Float64; + z @2: Float64; +} + +interface CuH2Pot { + calculate @0 (positions :AtomMatrix, atomTypes :AtomTypes, boxMatrix :BoxMatrix) + -> (result :PotentialResult); +} diff --git a/CppCore/rgpot/rpc/meson.build b/CppCore/rgpot/rpc/meson.build new file mode 100644 index 0000000..18f44c4 --- /dev/null +++ b/CppCore/rgpot/rpc/meson.build @@ -0,0 +1,14 @@ +capnp_rpc_dep = dependency('capnp-rpc') +_mbproot = meson.project_build_root() +capnpc_ = find_program('capnpc') +gen_rpc = custom_target('gen_rpc', + input : ['Potentials.capnp'], + output : ['Potentials.capnp.c++', 'Potentials.capnp.h'], + # TODO(rg): Can this be cleaner? + command : [capnpc_, f'-oc++:@_mbproot@/CppCore/rgpot/rpc', '@INPUT@', '--verbose', '--src-prefix=../CppCore/rgpot/rpc']) +ptlrpc = library('ptlrpc', + gen_rpc, + dependencies: _deps + capnp_rpc_dep, + cpp_args: _args, + include_directories: _incdirs, + install : true) From e6e4e8aa16caeedea6ccfc89d86832703a06753b Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 14:25:48 +0000 Subject: [PATCH 07/27] MAINT: Ignore generated files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ccb00a..11bd654 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.tmp subprojects/* !subprojects/*.wrap +*.capnp.* # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 39eb2794bac71f2d13d7b3abbba2533c8100a59f Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 14:26:02 +0000 Subject: [PATCH 08/27] BLD: Add some temporarily dependencies for testing --- pixi.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pixi.toml b/pixi.toml index 54a0ab5..1653d7f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -25,3 +25,6 @@ pipx = ">=1.7.1,<2" fortran-compiler = ">=1.8.0,<2" clang-format = ">=19.1.0,<20" capnproto = ">=1.0.2,<2" +pycapnp = ">=2.0.0,<3" +ipython = ">=8.28.0,<9" +pip = ">=24.2,<25" From 091fc98352a08b5fc49f95938868aeafdbfc2145 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 14:26:20 +0000 Subject: [PATCH 09/27] BUG: Do not shadow existing classes --- CppCore/rgpot/rpc/Potentials.capnp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCore/rgpot/rpc/Potentials.capnp b/CppCore/rgpot/rpc/Potentials.capnp index 8c224a5..d0c9c44 100644 --- a/CppCore/rgpot/rpc/Potentials.capnp +++ b/CppCore/rgpot/rpc/Potentials.capnp @@ -6,7 +6,7 @@ struct Position { z @2 :Float64; } -struct AtomMatrix { +struct AtomMatrixRPC { positions @0 :List(Position); } @@ -36,6 +36,6 @@ struct ForceVector { } interface CuH2Pot { - calculate @0 (positions :AtomMatrix, atomTypes :AtomTypes, boxMatrix :BoxMatrix) + calculate @0 (positions :AtomMatrixRPC, atomTypes :AtomTypes, boxMatrix :BoxMatrix) -> (result :PotentialResult); } From d3a3fcb198a0cf65799da481105ee8ae0b01d9a6 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 14:26:50 +0000 Subject: [PATCH 10/27] BIN: Update lockfile --- pixi.lock | 511 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 511 insertions(+) diff --git a/pixi.lock b/pixi.lock index 5a36c7d..360d5d7 100644 --- a/pixi.lock +++ b/pixi.lock @@ -8,6 +8,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/argcomplete-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-2.4.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.43-h4852527_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.43-h4bf12b8_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.43-h4852527_1.conda @@ -26,7 +27,10 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/cppcheck-2.15.0-py312h85ebf7f_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/cpplint-1.6.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.8.0-h1a2810e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.1.1-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/eigen-3.4.0-h00ab1b0_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/fmt-11.0.2-h434a139_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/fortran-compiler-1.8.0-h36df796_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-13.3.0-h9576a4e_1.conda @@ -39,6 +43,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.3.0-hdbfa832_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-13.3.0-h6834431_4.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-75.1-he02047a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh707e725_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-3.10.0-he073ed8_17.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda @@ -72,36 +78,52 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.12.7-he7c6b58_4.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.7-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ninja-1.12.1-h297d8ca_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/openblas-0.3.28-pthreads_hbcdf1e8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.4-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre-8.45-h9c3ff4c_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-24.2-pyh8b19718_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pipx-1.7.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pkg-config-0.29.2-h4bc722e_1009.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pkgconfig-1.5.5-pyhd8ed1ab_4.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.48-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd3deb0d_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pycapnp-2.0.0-py312hd0dd6af_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.7-hc5c86c4_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.12-5_cp312.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.4-hd590300_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-75.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/spdlog-1.14.1-hed91bc2_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.17-h4a8ded7_17.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tinyxml2-10.0.0-h59595ed_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/userpath-1.7.0-pyhd8ed1ab_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.13-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.44.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/xtensor-0.25.0-h00ab1b0_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/xtl-0.7.7-h00ab1b0_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda osx-64: - conda: https://conda.anaconda.org/conda-forge/noarch/argcomplete-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-2.4.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/bzip2-1.0.8-hfdf4475_7.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/c-ares-1.33.1-h44e7173_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/c-compiler-1.8.0-hb714fc7_0.conda @@ -128,7 +150,10 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/cppcheck-2.15.0-py312hf406c1f_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/cpplint-1.6.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-64/cxx-compiler-1.8.0-h6a1c779_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.1.1-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-64/eigen-3.4.0-h1c7c39f_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/fmt-11.0.2-h3c5361c_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/fortran-compiler-1.8.0-h33d1f46_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/gfortran-13.2.0-h2c809b3_1.conda @@ -136,7 +161,9 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/gfortran_osx-64-13.2.0-h18f7dce_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/gmp-6.3.0-hf036a51_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/icu-75.1-h120a0e1_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh707e725_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/isl-0.26-imath32_h2e86a7b_101.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/krb5-1.21.3-h37d8d59_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/ld64-951.9-h0a3eb4e_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/ld64_osx-64-951.9-h38c89e5_1.conda @@ -164,6 +191,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/libzlib-1.3.1-hd23fc13_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/llvm-openmp-19.1.0-h56322cc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/llvm-tools-17.0.6-hbedff68_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.7-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/mpc-1.3.1-h9d8efa1_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/mpfr-4.2.1-haed47dc_3.conda @@ -172,11 +200,19 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/openblas-0.3.28-openmp_hba01982_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/openssl-3.3.2-hd23fc13_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.4-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/pcre-8.45-he49afe7_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-24.2-pyh8b19718_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pipx-1.7.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/pkg-config-0.29.2-hf7e621a_1009.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pkgconfig-1.5.5-pyhd8ed1ab_4.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.48-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd3deb0d_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-64/pycapnp-2.0.0-py312he537db1_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/python-3.12.7-h8f8b54e_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/python_abi-3.12-5_cp312.conda @@ -184,13 +220,19 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/rhash-1.4.4-h0dc2134_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-75.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/sigtool-0.1.3-h88f4db0_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-64/spdlog-1.14.1-h325aa07_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tapi-1300.6.5-h390ca13_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tinyxml2-10.0.0-h73e2aa4_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tk-8.6.13-h1abcd95_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/userpath-1.7.0-pyhd8ed1ab_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.13-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.44.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/xtensor-0.25.0-h7728843_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/xtl-0.7.7-h7728843_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/xz-5.2.6-h775f41a_0.tar.bz2 @@ -198,6 +240,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/zstd-1.5.6-h915ae27_0.conda osx-arm64: - conda: https://conda.anaconda.org/conda-forge/noarch/argcomplete-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-2.4.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h99b78c6_7.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/c-ares-1.33.1-hd74edd7_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/c-compiler-1.8.0-h2664225_0.conda @@ -224,7 +267,10 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/cppcheck-2.15.0-py312h78b5aaf_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/cpplint-1.6.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/cxx-compiler-1.8.0-he8d86c4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.1.1-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/eigen-3.4.0-h1995070_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/fmt-11.0.2-h420ef59_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/fortran-compiler-1.8.0-hc3477c4_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/gfortran-13.2.0-h1ca8e4b_1.conda @@ -232,7 +278,9 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/gfortran_osx-arm64-13.2.0-h57527a5_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/gmp-6.3.0-h7bae524_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/icu-75.1-hfee45f7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh707e725_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/isl-0.26-imath32_h347afa1_101.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/krb5-1.21.3-h237132a_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ld64-951.9-h39a299f_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ld64_osx-arm64-951.9-hc81425b_1.conda @@ -262,6 +310,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.0-hba312e6_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-tools-17.0.6-h5090b49_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.7-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/mpc-1.3.1-h8f1351a_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/mpfr-4.2.1-hb693164_3.conda @@ -270,12 +319,20 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openblas-0.3.28-openmp_h1f0b1b2_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.2-h8359307_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.4-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre-8.45-hbdafb3b_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.44-h297a79d_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-24.2-pyh8b19718_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pipx-1.7.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pkg-config-0.29.2-hde07d2e_1009.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pkgconfig-1.5.5-pyhd8ed1ab_4.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.48-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd3deb0d_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pycapnp-2.0.0-py312h9aaef94_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.12.7-h739c21a_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python_abi-3.12-5_cp312.conda @@ -283,13 +340,19 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/rhash-1.4.4-hb547adb_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-75.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/sigtool-0.1.3-h44b9a77_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/spdlog-1.14.1-h6d8af72_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tapi-1300.6.5-h03f4b80_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tinyxml2-10.0.0-hebf3989_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h5083fa2_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/userpath-1.7.0-pyhd8ed1ab_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.13-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.44.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xtensor-0.25.0-h2ffa867_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xtl-0.7.7-h2ffa867_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2 @@ -297,6 +360,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.6-hb46c0d2_0.conda win-64: - conda: https://conda.anaconda.org/conda-forge/noarch/argcomplete-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-2.4.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h2466b09_7.conda - conda: https://conda.anaconda.org/conda-forge/win-64/c-compiler-1.8.0-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/ca-certificates-2024.8.30-h56e8100_0.conda @@ -311,11 +375,16 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/cppcheck-2.15.0-py312h6f9174a_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/cpplint-1.6.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/cxx-compiler-1.8.0-h91493d7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.1.1-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/eigen-3.4.0-h91493d7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.1.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/flang-5.0.0-he025d50_20180525.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/flang_win-64-5.0.0-h13ae965_20180526.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/fmt-11.0.2-h7f575de_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/fortran-compiler-1.8.0-h9655429_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh7428d3b_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/krb5-1.21.3-hdf4eb48_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libcurl-8.10.1-h1ee3ff0_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.6.3-he0c23c2_0.conda @@ -330,26 +399,37 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/libuv-1.49.0-h2466b09_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.1-h2466b09_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/llvm-meta-5.0.0-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.7-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/ninja-1.12.1-hc790b64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/openblas-0.3.28-pthreads_h29161c6_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/openmp-5.0.0-vc14_1.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.3.2-h2466b09_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.4-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/pcre2-10.44-h3d7b363_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-24.2-pyh8b19718_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pipx-1.7.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/pkg-config-0.29.2-h88c491f_1009.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pkgconfig-1.5.5-pyhd8ed1ab_4.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.48-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pycapnp-2.0.0-py312h6759c7f_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.7-hce54a09_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/win-64/python_abi-3.12-5_cp312.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-75.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/spdlog-1.14.1-h9f2357e_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/tinyxml2-10.0.0-h63175ca_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h5226925_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/userpath-1.7.0-pyhd8ed1ab_0.tar.bz2 @@ -358,6 +438,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.40.33810-h3bf8584_21.conda - conda: https://conda.anaconda.org/conda-forge/win-64/vs2019_win-64-19.29.30139-he1865b1_21.conda - conda: https://conda.anaconda.org/conda-forge/win-64/vswhere-3.1.7-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.13-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.44.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/xtensor-0.25.0-h181d51b_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/xtl-0.7.7-h181d51b_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/xz-5.2.6-h8d14728_0.tar.bz2 @@ -407,6 +489,22 @@ packages: license_family: Apache size: 41268 timestamp: 1728339105769 +- kind: conda + name: asttokens + version: 2.4.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/asttokens-2.4.1-pyhd8ed1ab_0.conda + sha256: 708168f026df19a0344983754d27d1f7b28bb21afc7b97a82f02c4798a3d2111 + md5: 5f25798dcefd8252ce5f9dc494d5f571 + depends: + - python >=3.5 + - six >=1.12.0 + license: Apache-2.0 + license_family: Apache + size: 28922 + timestamp: 1698341257884 - kind: conda name: binutils version: '2.43' @@ -1702,6 +1800,21 @@ packages: license_family: BSD size: 6202 timestamp: 1725746590277 +- kind: conda + name: decorator + version: 5.1.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/decorator-5.1.1-pyhd8ed1ab_0.tar.bz2 + sha256: 328a6a379f9bdfd0230e51de291ce858e6479411ea4b0545fb377c71662ef3e2 + md5: 43afe5ab04e35e17ba28649471dd7364 + depends: + - python >=3.5 + license: BSD-2-Clause + license_family: BSD + size: 12072 + timestamp: 1641555714315 - kind: conda name: eigen version: 3.4.0 @@ -1761,6 +1874,35 @@ packages: license_family: MOZILLA size: 1089706 timestamp: 1690273089254 +- kind: conda + name: exceptiongroup + version: 1.2.2 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + sha256: e0edd30c4b7144406bb4da975e6bb97d6bc9c0e999aa4efe66ae108cada5d5b5 + md5: d02ae936e42063ca46af6cdad2dbd1e0 + depends: + - python >=3.7 + license: MIT and PSF-2.0 + size: 20418 + timestamp: 1720869435725 +- kind: conda + name: executing + version: 2.1.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/executing-2.1.0-pyhd8ed1ab_0.conda + sha256: a52d7516e2e11d3eb10908e10d3eb3f8ef267fea99ed9b09d52d96c4db3441b8 + md5: d0441db20c827c11721889a241df1220 + depends: + - python >=2.7 + license: MIT + license_family: MIT + size: 28337 + timestamp: 1725214501850 - kind: conda name: flang version: 5.0.0 @@ -2287,6 +2429,60 @@ packages: license_family: MIT size: 11857802 timestamp: 1720853997952 +- kind: conda + name: ipython + version: 8.28.0 + build: pyh707e725_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh707e725_0.conda + sha256: b18adc659d43fc8eef026312a74cd39944ffe9d8decee71ec60a1974fb8ec86c + md5: 7142a7dff2a47e40b55d304decadd78a + depends: + - __unix + - decorator + - exceptiongroup + - jedi >=0.16 + - matplotlib-inline + - pexpect >4.3 + - pickleshare + - prompt-toolkit >=3.0.41,<3.1.0 + - pygments >=2.4.0 + - python >=3.10 + - stack_data + - traitlets >=5.13.0 + - typing_extensions >=4.6 + license: BSD-3-Clause + license_family: BSD + size: 600094 + timestamp: 1727944801855 +- kind: conda + name: ipython + version: 8.28.0 + build: pyh7428d3b_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/ipython-8.28.0-pyh7428d3b_0.conda + sha256: 8d2480d5593854e6bd994329a0b1819d39b35c5ee9e85043737df962f236a948 + md5: 4df2592ebe3672f282a02c557db209ee + depends: + - __win + - colorama + - decorator + - exceptiongroup + - jedi >=0.16 + - matplotlib-inline + - pickleshare + - prompt-toolkit >=3.0.41,<3.1.0 + - pygments >=2.4.0 + - python >=3.10 + - stack_data + - traitlets >=5.13.0 + - typing_extensions >=4.6 + license: BSD-3-Clause + license_family: BSD + size: 599622 + timestamp: 1727945272442 - kind: conda name: isl version: '0.26' @@ -2321,6 +2517,22 @@ packages: license_family: MIT size: 819937 timestamp: 1680649567633 +- kind: conda + name: jedi + version: 0.19.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.1-pyhd8ed1ab_0.conda + sha256: 362f0936ef37dfd1eaa860190e42a6ebf8faa094eaa3be6aa4d9ace95f40047a + md5: 81a3be0b2023e1ea8555781f0ad904a2 + depends: + - parso >=0.8.3,<0.9.0 + - python >=3.6 + license: MIT + license_family: MIT + size: 841312 + timestamp: 1696326218364 - kind: conda name: kernel-headers_linux-64 version: 3.10.0 @@ -4043,6 +4255,22 @@ packages: license_family: Apache size: 23219165 timestamp: 1701378990823 +- kind: conda + name: matplotlib-inline + version: 0.1.7 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.1.7-pyhd8ed1ab_0.conda + sha256: 7ea68676ea35fbb095420bbcc1c82c4767b8be7bb56abb6989b7f89d957a3bab + md5: 779345c95648be40d22aaa89de7d4254 + depends: + - python >=3.6 + - traitlets + license: BSD-3-Clause + license_family: BSD + size: 14599 + timestamp: 1713250613726 - kind: conda name: meson version: 1.5.2 @@ -4396,6 +4624,21 @@ packages: license_family: APACHE size: 50290 timestamp: 1718189540074 +- kind: conda + name: parso + version: 0.8.4 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.4-pyhd8ed1ab_0.conda + sha256: bfe404eebb930cc41782d34f8fc04c0388ea692eeebe2c5fc28df8ec8d4d61ae + md5: 81534b420deb77da8833f2289b8d47ac + depends: + - python >=3.6 + license: MIT + license_family: MIT + size: 75191 + timestamp: 1712320447201 - kind: conda name: pcre version: '8.45' @@ -4490,6 +4733,55 @@ packages: license_family: BSD size: 820831 timestamp: 1723489427046 +- kind: conda + name: pexpect + version: 4.9.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_0.conda + sha256: 90a09d134a4a43911b716d4d6eb9d169238aff2349056f7323d9db613812667e + md5: 629f3203c99b32e0988910c93e77f3b6 + depends: + - ptyprocess >=0.5 + - python >=3.7 + license: ISC + size: 53600 + timestamp: 1706113273252 +- kind: conda + name: pickleshare + version: 0.7.5 + build: py_1003 + build_number: 1003 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pickleshare-0.7.5-py_1003.tar.bz2 + sha256: a1ed1a094dd0d1b94a09ed85c283a0eb28943f2e6f22161fb45e128d35229738 + md5: 415f0ebb6198cc2801c73438a9fb5761 + depends: + - python >=3 + license: MIT + license_family: MIT + size: 9332 + timestamp: 1602536313357 +- kind: conda + name: pip + version: '24.2' + build: pyh8b19718_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pip-24.2-pyh8b19718_1.conda + sha256: d820e5358bcb117fa6286e55d4550c60b0332443df62121df839eab2d11c890b + md5: 6c78fbb8ddfd64bcb55b5cbafd2d2c43 + depends: + - python >=3.8,<3.13.0a0 + - setuptools + - wheel + license: MIT + license_family: MIT + size: 1237976 + timestamp: 1724954490262 - kind: conda name: pipx version: 1.7.1 @@ -4610,6 +4902,132 @@ packages: license_family: MIT size: 20625 timestamp: 1726613611845 +- kind: conda + name: prompt-toolkit + version: 3.0.48 + build: pyha770c72_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.48-pyha770c72_0.conda + sha256: 44e4e6108d425a666856a52d1523e5d70890256a8920bb0dcd3d55cc750f3207 + md5: 4c05134c48b6a74f33bbb9938e4a115e + depends: + - python >=3.7 + - wcwidth + constrains: + - prompt_toolkit 3.0.48 + license: BSD-3-Clause + license_family: BSD + size: 270271 + timestamp: 1727341744544 +- kind: conda + name: ptyprocess + version: 0.7.0 + build: pyhd3deb0d_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd3deb0d_0.tar.bz2 + sha256: fb31e006a25eb2e18f3440eb8d17be44c8ccfae559499199f73584566d0a444a + md5: 359eeb6536da0e687af562ed265ec263 + depends: + - python + license: ISC + size: 16546 + timestamp: 1609419417991 +- kind: conda + name: pure_eval + version: 0.2.3 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_0.conda + sha256: dcfcb3cee1ae0a89729601582cc3edea20ba13c9493967a03a693c67567af0c8 + md5: 0f051f09d992e0d08941706ad519ee0e + depends: + - python >=3.5 + license: MIT + license_family: MIT + size: 16551 + timestamp: 1721585805256 +- kind: conda + name: pycapnp + version: 2.0.0 + build: py312h6759c7f_1 + build_number: 1 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/pycapnp-2.0.0-py312h6759c7f_1.conda + sha256: efcd0cf5f76924e0a75f5d043870b732685401f628a0f568c2de8cbe8f3dd3ff + md5: ec2186021277d1c7e8593ec2dbec6ad7 + depends: + - capnproto >=1.0.2,<1.0.3.0a0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: BSD-2-Clause + license_family: BSD + size: 951183 + timestamp: 1720569709066 +- kind: conda + name: pycapnp + version: 2.0.0 + build: py312h9aaef94_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pycapnp-2.0.0-py312h9aaef94_1.conda + sha256: fe016d2ad9596ea37f7e1ffdfbcdd988fba71f80dec406a5a35bebc7d4d26507 + md5: 767adf44baa3824ed0acb3fa0f7eee2d + depends: + - __osx >=11.0 + - capnproto >=1.0.2,<1.0.3.0a0 + - libcxx >=16 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: BSD-2-Clause + license_family: BSD + size: 464880 + timestamp: 1720569546235 +- kind: conda + name: pycapnp + version: 2.0.0 + build: py312hd0dd6af_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/pycapnp-2.0.0-py312hd0dd6af_1.conda + sha256: 8f802eb49775b413c190cc3b8c80d6e39b4ba3faacbeeb53b73635aa9a56c2e5 + md5: bf102e8a0ebc01bab5141b277114a3ed + depends: + - __glibc >=2.17,<3.0.a0 + - capnproto >=1.0.2,<1.0.3.0a0 + - libgcc-ng >=12 + - libstdcxx-ng >=12 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-2-Clause + license_family: BSD + size: 553797 + timestamp: 1720569190748 +- kind: conda + name: pycapnp + version: 2.0.0 + build: py312he537db1_1 + build_number: 1 + subdir: osx-64 + url: https://conda.anaconda.org/conda-forge/osx-64/pycapnp-2.0.0-py312he537db1_1.conda + sha256: 67b614cfe7915ddc96f5f1005012e4891bd6efbffd98615f166b57dd0d26a5d5 + md5: 01c83c38b20b696bcdf545b330d29c08 + depends: + - __osx >=10.13 + - capnproto >=1.0.2,<1.0.3.0a0 + - libcxx >=16 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-2-Clause + license_family: BSD + size: 1284218 + timestamp: 1720569389209 - kind: conda name: pygments version: 2.18.0 @@ -4921,6 +5339,21 @@ packages: license_family: MIT size: 213817 timestamp: 1643442169866 +- kind: conda + name: six + version: 1.16.0 + build: pyh6c4a22f_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 + sha256: a85c38227b446f42c5b90d9b642f2c0567880c15d72492d8da074a59c8f91dd6 + md5: e5f25f8dbc060e9a8d912e432202afc2 + depends: + - python + license: MIT + license_family: MIT + size: 14259 + timestamp: 1620240338595 - kind: conda name: spdlog version: 1.14.1 @@ -4991,6 +5424,24 @@ packages: license_family: MIT size: 195665 timestamp: 1722238295031 +- kind: conda + name: stack_data + version: 0.6.2 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda + sha256: a58433e75229bec39f3be50c02efbe9b7083e53a1f31d8ee247564f370191eec + md5: e7df0fdd404616638df5ece6e69ba7af + depends: + - asttokens + - executing + - pure_eval + - python >=3.5 + license: MIT + license_family: MIT + size: 26205 + timestamp: 1669632203115 - kind: conda name: sysroot_linux-64 version: '2.17' @@ -5173,6 +5624,36 @@ packages: license_family: MIT size: 18203 timestamp: 1727974767524 +- kind: conda + name: traitlets + version: 5.14.3 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + sha256: 8a64fa0f19022828513667c2c7176cfd125001f3f4b9bc00d33732e627dd2592 + md5: 3df84416a021220d8b5700c613af2dc5 + depends: + - python >=3.8 + license: BSD-3-Clause + license_family: BSD + size: 110187 + timestamp: 1713535244513 +- kind: conda + name: typing_extensions + version: 4.12.2 + build: pyha770c72_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda + sha256: 0fce54f8ec3e59f5ef3bb7641863be4e1bf1279623e5af3d3fa726e8f7628ddb + md5: ebe6952715e1d5eb567eeebf25250fa7 + depends: + - python >=3.8 + license: PSF-2.0 + license_family: PSF + size: 39888 + timestamp: 1717802653893 - kind: conda name: tzdata version: 2024b @@ -5295,6 +5776,36 @@ packages: license_family: MIT size: 219013 timestamp: 1719460515960 +- kind: conda + name: wcwidth + version: 0.2.13 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.13-pyhd8ed1ab_0.conda + sha256: b6cd2fee7e728e620ec736d8dfee29c6c9e2adbd4e695a31f1d8f834a83e57e3 + md5: 68f0738df502a14213624b288c60c9ad + depends: + - python >=3.8 + license: MIT + license_family: MIT + size: 32709 + timestamp: 1704731373922 +- kind: conda + name: wheel + version: 0.44.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/wheel-0.44.0-pyhd8ed1ab_0.conda + sha256: d828764736babb4322b8102094de38074dedfc71f5ff405c9dfee89191c14ebc + md5: d44e3b085abcaef02983c6305b84b584 + depends: + - python >=3.8 + license: MIT + license_family: MIT + size: 58585 + timestamp: 1722797131787 - kind: conda name: xtensor version: 0.25.0 From 10a534e69d3fae14f133b9db67df5cac19fc0985 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:43:34 +0000 Subject: [PATCH 11/27] ENH: Add a basic client and server --- CppCore/rgpot/rpc/pyclient.py | 77 ++++++++++++++++++++++++++++++++ CppCore/rgpot/rpc/server.cpp | 84 +++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 CppCore/rgpot/rpc/pyclient.py create mode 100644 CppCore/rgpot/rpc/server.cpp diff --git a/CppCore/rgpot/rpc/pyclient.py b/CppCore/rgpot/rpc/pyclient.py new file mode 100644 index 0000000..9ae6b42 --- /dev/null +++ b/CppCore/rgpot/rpc/pyclient.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 + +import argparse +import asyncio +import capnp +import numpy as np + +import Potentials_capnp + + +def parse_args(): + parser = argparse.ArgumentParser( + usage="Connects to the Calculator server at the given address and does some RPCs" + ) + parser.add_argument("host", help="HOST:PORT") + + return parser.parse_args() + + +async def main(connection): + client = capnp.TwoPartyClient(connection) + + calculator = client.bootstrap().cast_as(Potentials_capnp.CuH2Pot) + print("Connection made ", end="") + # Create a request to call the calculate method + positions = [ + {"x": 0.63940268750835, "y": 0.90484742551374, "z": 6.97516498544584}, # Cu + {"x": 3.19652040936288, "y": 0.90417430354811, "z": 6.97547796369474}, # Cu + {"x": 8.98363230369760, "y": 9.94703496017833, "z": 7.83556854923689}, # H + {"x": 7.64080177576300, "y": 9.94703114803832, "z": 7.83556986121272}, # H + ] + + atom_types = [29, 29, 1, 1] # Atomic types for Cu and H + box_matrix = [ + {"x": 15.0, "y": 0.0, "z": 0.0}, + {"x": 0.0, "y": 20.0, "z": 0.0}, + {"x": 0.0, "y": 0.0, "z": 30.0}, + ] + # Prepare the request + pos = Potentials_capnp.AtomMatrixRPC.new_message() + pos.init("positions", 4) + for idx, item in enumerate(positions): + pos_ = Potentials_capnp.Position.new_message() + pos_.x = positions[idx]["x"] + pos_.y = positions[idx]["y"] + pos_.z = positions[idx]["z"] + pos.positions[idx] = pos_ + + # Prepare the request for AtomTypes + atom_types_msg = Potentials_capnp.AtomTypes.new_message() + atom_types_list = atom_types_msg.init("atomTypes", len(atom_types)) + for idx, atom in enumerate(atom_types): + atom_types_list[idx] = atom + + # Prepare the request for BoxMatrix + box_matrix_msg = Potentials_capnp.BoxMatrix.new_message() + box_matrix_list = box_matrix_msg.init("box", len(box_matrix)) + for idx, box in enumerate(box_matrix): + box_matrix_list[idx].x = box["x"] + box_matrix_list[idx].y = box["y"] + box_matrix_list[idx].z = box["z"] + + # Call the CuH2Pot.calculate method + response = calculator.calculate(pos, atom_types_msg, box_matrix_msg) + + # Extract the result from the response + result = await response + print(result.to_dict()) + + +async def cmd_main(host): + host, port = host.split(":") + await main(await capnp.AsyncIoStream.create_connection(host=host, port=port)) + + +if __name__ == "__main__": + asyncio.run(capnp.run(cmd_main(parse_args().host))) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp new file mode 100644 index 0000000..da5916c --- /dev/null +++ b/CppCore/rgpot/rpc/server.cpp @@ -0,0 +1,84 @@ +#include "Potentials.capnp.h" // Cap'n Proto schema header +#include "rgpot/CuH2/CuH2Pot.hpp" +#include "rgpot/types/AtomMatrix.hpp" +#include +#include +#include + +// Fully define CuH2PotImpl before use +class CuH2PotImpl final : public CuH2Pot::Server { +public: + kj::Promise calculate(CalculateContext context) override { + // Extract params directly from Cap'n Proto + auto atomMatrixReader = context.getParams().getPositions(); + auto atomTypesReader = context.getParams().getAtomTypes(); + auto boxMatrixReader = context.getParams().getBoxMatrix(); + + // Get number of atoms (rows in positions) + const auto numAtoms = atomMatrixReader.getPositions().size(); + + // Use positions directly from Cap'n Proto (zero-copy) + auto positionsReader = atomMatrixReader.getPositions(); + + // Access atom types directly from Cap'n Proto (zero-copy) + auto atomTypes = atomTypesReader.getAtomTypes(); + + // Access box matrix directly (zero-copy) + auto boxMatrix = boxMatrixReader.getBox(); + + // Prepare input in the format expected by CuH2Pot + rgpot::types::AtomMatrix nativePositions(numAtoms, 3); + for (size_t i = 0; i < numAtoms; ++i) { + nativePositions(i, 0) = positionsReader[i].getX(); + nativePositions(i, 1) = positionsReader[i].getY(); + nativePositions(i, 2) = positionsReader[i].getZ(); + } + + std::vector nativeAtomTypes(atomTypes.size()); + for (size_t i = 0; i < atomTypes.size(); ++i) { + nativeAtomTypes[i] = atomTypes[i]; + } + + std::array, 3> nativeBoxMatrix; + for (size_t i = 0; i < 3; ++i) { + nativeBoxMatrix[i] = {boxMatrix[i].getX(), boxMatrix[i].getY(), + boxMatrix[i].getZ()}; + } + + // Call CuH2Pot with the AtomMatrix and other parameters + auto cuh2pot = rgpot::CuH2Pot(); + auto [energy, forces] = + cuh2pot(nativePositions, nativeAtomTypes, nativeBoxMatrix); + + // Set up the result in Cap'n Proto + auto result = context.getResults(); + ::capnp::MallocMessageBuilder message; + PotentialResult::Builder pres = message.initRoot(); + pres.setEnergy(energy); + pres.initForces(numAtoms); + + for (int i = 0; i < forces.rows(); ++i) { + auto force = ::capnp::MallocMessageBuilder().initRoot(); + force.setX(forces(i, 0)); + force.setY(forces(i, 1)); + force.setZ(forces(i, 2)); + } + result.setResult(pres); + + return kj::READY_NOW; + } +}; + +// Main server setup +int main(int argc, char *argv[]) { + CuH2PotImpl cuh2potImpl; + + // Set up the Cap'n Proto RPC server on a specific address and port + capnp::EzRpcServer server(kj::heap(), "localhost", 12345); + + // Keep the server running indefinitely + auto &waitScope = server.getWaitScope(); + kj::NEVER_DONE.wait(waitScope); + + return 0; +} From e136f0e10376a7e7fe4aef4b6e7432c7107df6bd Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:45:27 +0000 Subject: [PATCH 12/27] BLD: Setup basic build, bump cpp version --- CppCore/rgpot/rpc/meson.build | 6 ++++++ meson.build | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CppCore/rgpot/rpc/meson.build b/CppCore/rgpot/rpc/meson.build index 18f44c4..042faa9 100644 --- a/CppCore/rgpot/rpc/meson.build +++ b/CppCore/rgpot/rpc/meson.build @@ -12,3 +12,9 @@ ptlrpc = library('ptlrpc', cpp_args: _args, include_directories: _incdirs, install : true) +server = executable('potserv', [ 'server.cpp', gen_rpc ], + link_with: [ptlrpc, _linkto], + dependencies: _deps + capnp_rpc_dep, + cpp_args: _args, + include_directories: _incdirs, + install : true) diff --git a/meson.build b/meson.build index a46b60f..0d27b7d 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'pot', 'cpp', version: '0.1.0', - default_options: ['warning_level=2', 'cpp_std=c++17'], + default_options: ['warning_level=2', 'cpp_std=c++20'], ) # IMPORTANT!! warning_level=3 passes -fimplicit-none # Many of the older Fortran codes need implicit typing From 4e420bf96a5c22d56b33a661a8cae359a345b4aa Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:46:45 +0000 Subject: [PATCH 13/27] MAINT: Simplify and lint Since pycapnp uses dictionaries --- CppCore/rgpot/rpc/pyclient.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/CppCore/rgpot/rpc/pyclient.py b/CppCore/rgpot/rpc/pyclient.py index 9ae6b42..e6276d7 100644 --- a/CppCore/rgpot/rpc/pyclient.py +++ b/CppCore/rgpot/rpc/pyclient.py @@ -7,7 +7,6 @@ import Potentials_capnp - def parse_args(): parser = argparse.ArgumentParser( usage="Connects to the Calculator server at the given address and does some RPCs" @@ -24,37 +23,35 @@ async def main(connection): print("Connection made ", end="") # Create a request to call the calculate method positions = [ - {"x": 0.63940268750835, "y": 0.90484742551374, "z": 6.97516498544584}, # Cu - {"x": 3.19652040936288, "y": 0.90417430354811, "z": 6.97547796369474}, # Cu - {"x": 8.98363230369760, "y": 9.94703496017833, "z": 7.83556854923689}, # H - {"x": 7.64080177576300, "y": 9.94703114803832, "z": 7.83556986121272}, # H + {'x': 0.63940268750835, 'y': 0.90484742551374, 'z': 6.97516498544584}, # Cu + {'x': 3.19652040936288, 'y': 0.90417430354811, 'z': 6.97547796369474}, # Cu + {'x': 8.98363230369760, 'y': 9.94703496017833, 'z': 7.83556854923689}, # H + {'x': 7.64080177576300, 'y': 9.94703114803832, 'z': 7.83556986121272}, # H ] atom_types = [29, 29, 1, 1] # Atomic types for Cu and H box_matrix = [ - {"x": 15.0, "y": 0.0, "z": 0.0}, - {"x": 0.0, "y": 20.0, "z": 0.0}, - {"x": 0.0, "y": 0.0, "z": 30.0}, + {'x': 15.0, 'y': 0.0, 'z': 0.0}, + {'x': 0.0, 'y': 20.0, 'z': 0.0}, + {'x': 0.0, 'y': 0.0, 'z': 30.0} ] - # Prepare the request + # Prepare AtomMatrixRPC pos = Potentials_capnp.AtomMatrixRPC.new_message() - pos.init("positions", 4) + pos_positions = pos.init('positions', len(positions)) for idx, item in enumerate(positions): - pos_ = Potentials_capnp.Position.new_message() - pos_.x = positions[idx]["x"] - pos_.y = positions[idx]["y"] - pos_.z = positions[idx]["z"] - pos.positions[idx] = pos_ + pos_positions[idx].x = item["x"] + pos_positions[idx].y = item["y"] + pos_positions[idx].z = item["z"] # Prepare the request for AtomTypes atom_types_msg = Potentials_capnp.AtomTypes.new_message() - atom_types_list = atom_types_msg.init("atomTypes", len(atom_types)) + atom_types_list = atom_types_msg.init('atomTypes', len(atom_types)) for idx, atom in enumerate(atom_types): atom_types_list[idx] = atom # Prepare the request for BoxMatrix box_matrix_msg = Potentials_capnp.BoxMatrix.new_message() - box_matrix_list = box_matrix_msg.init("box", len(box_matrix)) + box_matrix_list = box_matrix_msg.init('box', len(box_matrix)) for idx, box in enumerate(box_matrix): box_matrix_list[idx].x = box["x"] box_matrix_list[idx].y = box["y"] @@ -64,10 +61,9 @@ async def main(connection): response = calculator.calculate(pos, atom_types_msg, box_matrix_msg) # Extract the result from the response - result = await response + result = (await response) print(result.to_dict()) - async def cmd_main(host): host, port = host.split(":") await main(await capnp.AsyncIoStream.create_connection(host=host, port=port)) From ba9bcd2ddeb3908ff2b69412ec79e6381d6be09c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:49:11 +0000 Subject: [PATCH 14/27] BUG: Ensure correct lifetime for server forces --- CppCore/rgpot/rpc/server.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index da5916c..f4d0397 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -57,8 +57,10 @@ class CuH2PotImpl final : public CuH2Pot::Server { pres.setEnergy(energy); pres.initForces(numAtoms); - for (int i = 0; i < forces.rows(); ++i) { - auto force = ::capnp::MallocMessageBuilder().initRoot(); + // Initialize the forces field in the result + auto forcesList = pres.initForces(numAtoms); + for (size_t i = 0; i < numAtoms; ++i) { + auto force = forcesList[i]; force.setX(forces(i, 0)); force.setY(forces(i, 1)); force.setZ(forces(i, 2)); From 58e45987c088ff8cdb4028e6c1dd434343bf528c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:50:39 +0000 Subject: [PATCH 15/27] MAINT: Minor lint and less variables --- CppCore/rgpot/rpc/server.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index f4d0397..419655e 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -52,10 +52,9 @@ class CuH2PotImpl final : public CuH2Pot::Server { // Set up the result in Cap'n Proto auto result = context.getResults(); - ::capnp::MallocMessageBuilder message; - PotentialResult::Builder pres = message.initRoot(); + PotentialResult::Builder pres = + ::capnp::MallocMessageBuilder().initRoot(); pres.setEnergy(energy); - pres.initForces(numAtoms); // Initialize the forces field in the result auto forcesList = pres.initForces(numAtoms); From 88bd069b3d9222316c8b2f0634258ea87307180d Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:52:20 +0000 Subject: [PATCH 16/27] MAINT: Fix linting issues --- CppCore/rgpot/rpc/server.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index 419655e..713fb5d 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -1,15 +1,18 @@ -#include "Potentials.capnp.h" // Cap'n Proto schema header -#include "rgpot/CuH2/CuH2Pot.hpp" -#include "rgpot/types/AtomMatrix.hpp" +// MIT License +// Copyright 2023--present Rohit Goswami +#include "Potentials.capnp.h" #include #include -#include + +#include "rgpot/CuH2/CuH2Pot.hpp" +#include "rgpot/types/AtomMatrix.hpp" // Fully define CuH2PotImpl before use class CuH2PotImpl final : public CuH2Pot::Server { public: kj::Promise calculate(CalculateContext context) override { // Extract params directly from Cap'n Proto + // (zero-copy) is a suggestion, not now auto atomMatrixReader = context.getParams().getPositions(); auto atomTypesReader = context.getParams().getAtomTypes(); auto boxMatrixReader = context.getParams().getBoxMatrix(); From 0e3d99c9306aa21c843d19e60b9c0f97292146f3 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 15:53:17 +0000 Subject: [PATCH 17/27] BLD: More lint --- CppCore/rgpot/rpc/meson.build | 47 ++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/CppCore/rgpot/rpc/meson.build b/CppCore/rgpot/rpc/meson.build index 042faa9..0224969 100644 --- a/CppCore/rgpot/rpc/meson.build +++ b/CppCore/rgpot/rpc/meson.build @@ -1,20 +1,33 @@ capnp_rpc_dep = dependency('capnp-rpc') _mbproot = meson.project_build_root() capnpc_ = find_program('capnpc') -gen_rpc = custom_target('gen_rpc', - input : ['Potentials.capnp'], - output : ['Potentials.capnp.c++', 'Potentials.capnp.h'], - # TODO(rg): Can this be cleaner? - command : [capnpc_, f'-oc++:@_mbproot@/CppCore/rgpot/rpc', '@INPUT@', '--verbose', '--src-prefix=../CppCore/rgpot/rpc']) -ptlrpc = library('ptlrpc', - gen_rpc, - dependencies: _deps + capnp_rpc_dep, - cpp_args: _args, - include_directories: _incdirs, - install : true) -server = executable('potserv', [ 'server.cpp', gen_rpc ], - link_with: [ptlrpc, _linkto], - dependencies: _deps + capnp_rpc_dep, - cpp_args: _args, - include_directories: _incdirs, - install : true) +gen_rpc = custom_target( + 'gen_rpc', + input: ['Potentials.capnp'], + output: ['Potentials.capnp.c++', 'Potentials.capnp.h'], + # TODO(rg): Can this be cleaner? + command: [ + capnpc_, + f'-oc++:@_mbproot@/CppCore/rgpot/rpc', + '@INPUT@', + '--verbose', + '--src-prefix=../CppCore/rgpot/rpc', + ], +) +ptlrpc = library( + 'ptlrpc', + gen_rpc, + dependencies: _deps + capnp_rpc_dep, + cpp_args: _args, + include_directories: _incdirs, + install: true, +) +server = executable( + 'potserv', + ['server.cpp', gen_rpc], + link_with: [ptlrpc, _linkto], + dependencies: _deps + capnp_rpc_dep, + cpp_args: _args, + include_directories: _incdirs, + install: true, +) From 1dd36ad90eedfe31feac6d669de188fa561d079e Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Tue, 8 Oct 2024 19:25:16 +0000 Subject: [PATCH 18/27] ENH: Restructure into ForceInput --- CppCore/rgpot/rpc/Potentials.capnp | 38 ++++---------- CppCore/rgpot/rpc/pyclient.py | 84 ++++++++++++++++-------------- CppCore/rgpot/rpc/server.cpp | 53 +++++++------------ 3 files changed, 75 insertions(+), 100 deletions(-) diff --git a/CppCore/rgpot/rpc/Potentials.capnp b/CppCore/rgpot/rpc/Potentials.capnp index d0c9c44..f5feaeb 100644 --- a/CppCore/rgpot/rpc/Potentials.capnp +++ b/CppCore/rgpot/rpc/Potentials.capnp @@ -1,41 +1,21 @@ @0xbd1f89fa17369103; -struct Position { - x @0 :Float64; - y @1 :Float64; - z @2 :Float64; -} - -struct AtomMatrixRPC { - positions @0 :List(Position); -} - -struct BoxMatrix { - box @0: List(Vector); -} +# Design kanged from eOn v4 C-style structs +# TODO(rg): Should be more object oriented -struct Vector { - x @0: Float64; - y @1: Float64; - z @2: Float64; -} - -struct AtomTypes { - atomTypes @0: List(Int32); +struct ForceInput { + natm @0 :Int32; # TODO(rg): Do we really need this.. + pos @1 :List(Float64); + atmnrs @2 :List(Int32); + box @3 :List(Float64); } struct PotentialResult { energy @0: Float64; - forces @1: List(ForceVector); -} - -struct ForceVector { - x @0: Float64; - y @1: Float64; - z @2: Float64; + forces @1: List(Float64); } interface CuH2Pot { - calculate @0 (positions :AtomMatrixRPC, atomTypes :AtomTypes, boxMatrix :BoxMatrix) + calculate @0 (fip :ForceInput) -> (result :PotentialResult); } diff --git a/CppCore/rgpot/rpc/pyclient.py b/CppCore/rgpot/rpc/pyclient.py index e6276d7..d7e721d 100644 --- a/CppCore/rgpot/rpc/pyclient.py +++ b/CppCore/rgpot/rpc/pyclient.py @@ -7,6 +7,7 @@ import Potentials_capnp + def parse_args(): parser = argparse.ArgumentParser( usage="Connects to the Calculator server at the given address and does some RPCs" @@ -18,51 +19,58 @@ def parse_args(): async def main(connection): client = capnp.TwoPartyClient(connection) - calculator = client.bootstrap().cast_as(Potentials_capnp.CuH2Pot) + print("Connection made ", end="") - # Create a request to call the calculate method + + # Create the atomic positions, atom types, and box matrix positions = [ - {'x': 0.63940268750835, 'y': 0.90484742551374, 'z': 6.97516498544584}, # Cu - {'x': 3.19652040936288, 'y': 0.90417430354811, 'z': 6.97547796369474}, # Cu - {'x': 8.98363230369760, 'y': 9.94703496017833, 'z': 7.83556854923689}, # H - {'x': 7.64080177576300, 'y': 9.94703114803832, 'z': 7.83556986121272}, # H + 0.63940268750835, + 0.90484742551374, + 6.97516498544584, # Cu + 3.19652040936288, + 0.90417430354811, + 6.97547796369474, # Cu + 8.98363230369760, + 9.94703496017833, + 7.83556854923689, # H + 7.64080177576300, + 9.94703114803832, + 7.83556986121272, # H ] atom_types = [29, 29, 1, 1] # Atomic types for Cu and H - box_matrix = [ - {'x': 15.0, 'y': 0.0, 'z': 0.0}, - {'x': 0.0, 'y': 20.0, 'z': 0.0}, - {'x': 0.0, 'y': 0.0, 'z': 30.0} - ] - # Prepare AtomMatrixRPC - pos = Potentials_capnp.AtomMatrixRPC.new_message() - pos_positions = pos.init('positions', len(positions)) - for idx, item in enumerate(positions): - pos_positions[idx].x = item["x"] - pos_positions[idx].y = item["y"] - pos_positions[idx].z = item["z"] - - # Prepare the request for AtomTypes - atom_types_msg = Potentials_capnp.AtomTypes.new_message() - atom_types_list = atom_types_msg.init('atomTypes', len(atom_types)) + + box_matrix = [15.0, 0.0, 0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 30.0] + + # Create the ForceInput message + force_input = Potentials_capnp.ForceInput.new_message() + force_input.natm = len(atom_types) # Number of atoms + + # Set positions + pos_list = force_input.init("pos", len(positions)) + for idx, pos in enumerate(positions): + pos_list[idx] = pos + + # Set atom types + atom_list = force_input.init("atmnrs", len(atom_types)) for idx, atom in enumerate(atom_types): - atom_types_list[idx] = atom - - # Prepare the request for BoxMatrix - box_matrix_msg = Potentials_capnp.BoxMatrix.new_message() - box_matrix_list = box_matrix_msg.init('box', len(box_matrix)) - for idx, box in enumerate(box_matrix): - box_matrix_list[idx].x = box["x"] - box_matrix_list[idx].y = box["y"] - box_matrix_list[idx].z = box["z"] - - # Call the CuH2Pot.calculate method - response = calculator.calculate(pos, atom_types_msg, box_matrix_msg) - - # Extract the result from the response - result = (await response) - print(result.to_dict()) + atom_list[idx] = atom + + # Set the box matrix + box_list = force_input.init("box", len(box_matrix)) + for idx, val in enumerate(box_matrix): + box_list[idx] = val + + # Call the CuH2Pot.calculate method with ForceInput + response = calculator.calculate(force_input) + + # Await and print the result + result = await response + result_dict = result.to_dict() + print("Energy:", result_dict["result"]["energy"]) + print("Forces:", result_dict["result"]["forces"]) + async def cmd_main(host): host, port = host.split(":") diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index 713fb5d..4938ebf 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -13,39 +13,31 @@ class CuH2PotImpl final : public CuH2Pot::Server { kj::Promise calculate(CalculateContext context) override { // Extract params directly from Cap'n Proto // (zero-copy) is a suggestion, not now - auto atomMatrixReader = context.getParams().getPositions(); - auto atomTypesReader = context.getParams().getAtomTypes(); - auto boxMatrixReader = context.getParams().getBoxMatrix(); + auto fip = context.getParams().getFip(); // Get number of atoms (rows in positions) - const auto numAtoms = atomMatrixReader.getPositions().size(); + const auto numAtoms = fip.getNatm(); - // Use positions directly from Cap'n Proto (zero-copy) - auto positionsReader = atomMatrixReader.getPositions(); - - // Access atom types directly from Cap'n Proto (zero-copy) - auto atomTypes = atomTypesReader.getAtomTypes(); - - // Access box matrix directly (zero-copy) - auto boxMatrix = boxMatrixReader.getBox(); - - // Prepare input in the format expected by CuH2Pot + // Read directly + // Read position data from Cap'n Proto and copy to std::vector rgpot::types::AtomMatrix nativePositions(numAtoms, 3); - for (size_t i = 0; i < numAtoms; ++i) { - nativePositions(i, 0) = positionsReader[i].getX(); - nativePositions(i, 1) = positionsReader[i].getY(); - nativePositions(i, 2) = positionsReader[i].getZ(); + auto posReader = fip.getPos(); + for (size_t i = 0; i < numAtoms * 3; ++i) { + nativePositions.data()[i] = posReader[i]; } - std::vector nativeAtomTypes(atomTypes.size()); - for (size_t i = 0; i < atomTypes.size(); ++i) { - nativeAtomTypes[i] = atomTypes[i]; + // Read atom numbers + auto atmnrsReader = fip.getAtmnrs(); + std::vector nativeAtomTypes(numAtoms); + for (size_t i = 0; i < numAtoms; ++i) { + nativeAtomTypes[i] = atmnrsReader[i]; } + // Read box matrix + auto boxReader = fip.getBox(); std::array, 3> nativeBoxMatrix; for (size_t i = 0; i < 3; ++i) { - nativeBoxMatrix[i] = {boxMatrix[i].getX(), boxMatrix[i].getY(), - boxMatrix[i].getZ()}; + nativeBoxMatrix[i] = {boxReader[i], boxReader[i + 1], boxReader[i + 2]}; } // Call CuH2Pot with the AtomMatrix and other parameters @@ -55,19 +47,14 @@ class CuH2PotImpl final : public CuH2Pot::Server { // Set up the result in Cap'n Proto auto result = context.getResults(); - PotentialResult::Builder pres = - ::capnp::MallocMessageBuilder().initRoot(); + auto pres = result.initResult(); pres.setEnergy(energy); - // Initialize the forces field in the result - auto forcesList = pres.initForces(numAtoms); - for (size_t i = 0; i < numAtoms; ++i) { - auto force = forcesList[i]; - force.setX(forces(i, 0)); - force.setY(forces(i, 1)); - force.setZ(forces(i, 2)); + // Initialize and set forces + auto forcesList = pres.initForces(numAtoms * 3); + for (size_t i = 0; i < numAtoms * 3; ++i) { + forcesList.set(i, forces.data()[i]); } - result.setResult(pres); return kj::READY_NOW; } From 5280115202507800ae77f888540ad85475d2a8b9 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 15:38:03 +0200 Subject: [PATCH 19/27] BUG: Fixup access pattern Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- CppCore/rgpot/rpc/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index 4938ebf..e62204f 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -37,7 +37,7 @@ class CuH2PotImpl final : public CuH2Pot::Server { auto boxReader = fip.getBox(); std::array, 3> nativeBoxMatrix; for (size_t i = 0; i < 3; ++i) { - nativeBoxMatrix[i] = {boxReader[i], boxReader[i + 1], boxReader[i + 2]}; + nativeBoxMatrix[i] = {boxReader[i*3], boxReader[i*3+1], boxReader[i*3+2]}; } // Call CuH2Pot with the AtomMatrix and other parameters From 2846942d66a57f6e61ee81da7cebfc8780f8ffb3 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 15:38:50 +0200 Subject: [PATCH 20/27] MAINT: Only match meson build files Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4856a77..39b612c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,5 +31,5 @@ repos: entry: meson language: system types: [meson] - files: \.build$ + files: meson\.build$ args: ["format", "-i"] From 57c430b65e284f34326ab521e1924a35b23649d7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 15:42:44 +0200 Subject: [PATCH 21/27] MAINT: Please linter --- CppCore/rgpot/rpc/server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index e62204f..fd5af64 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -37,7 +37,8 @@ class CuH2PotImpl final : public CuH2Pot::Server { auto boxReader = fip.getBox(); std::array, 3> nativeBoxMatrix; for (size_t i = 0; i < 3; ++i) { - nativeBoxMatrix[i] = {boxReader[i*3], boxReader[i*3+1], boxReader[i*3+2]}; + nativeBoxMatrix[i] = {boxReader[i * 3], boxReader[i * 3 + 1], + boxReader[i * 3 + 2]}; } // Call CuH2Pot with the AtomMatrix and other parameters From db8c33d35a85c55821168a2db30829e189980b11 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 15:45:11 +0200 Subject: [PATCH 22/27] DOC: Fix typo --- Readme.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.org b/Readme.org index bc179d8..652856f 100644 --- a/Readme.org +++ b/Readme.org @@ -1,8 +1,8 @@ * About This is a set of standard potentials in C++ or Fortran. The goal is to provide minimal, binding friendly interfaces for ease of usage from Python or even R. -The core library is header-only, though adapt functions are provided for interfacing -to ~Eigen~ and ~xtensor~. +The core library is header-only, though adapter functions are provided for +interfacing to ~Eigen~ and ~xtensor~. This was originally designed for interfacing easily to potentials implemented [[http://theory.cm.utexas.edu/eon/][in eOn]], but has grown to be more flexible. From 5db7dd20991063979c21429bd8d7edf64e3cfbd7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 16:11:57 +0200 Subject: [PATCH 23/27] MAINT: Cleanup unused --- CppCore/rgpot/rpc/pyclient.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CppCore/rgpot/rpc/pyclient.py b/CppCore/rgpot/rpc/pyclient.py index d7e721d..d756f99 100644 --- a/CppCore/rgpot/rpc/pyclient.py +++ b/CppCore/rgpot/rpc/pyclient.py @@ -2,9 +2,8 @@ import argparse import asyncio -import capnp -import numpy as np +import capnp import Potentials_capnp From 610c8ba6fec4b375390a5a93071bae62f4869b2e Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 17:02:20 +0200 Subject: [PATCH 24/27] MAINT: Slightly nicer Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- CppCore/rgpot/rpc/server.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index fd5af64..7b7c8e2 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -63,10 +63,20 @@ class CuH2PotImpl final : public CuH2Pot::Server { // Main server setup int main(int argc, char *argv[]) { - CuH2PotImpl cuh2potImpl; + // Set up the Cap'n Proto RPC server on a specific address and port + // Parse port from command line arguments, default to 12345 + int port = 12345; + if (argc > 1) { + try { + port = std::stoi(argv[1]); + } catch (const std::exception &e) { + std::cerr << "Invalid port argument, using default port 12345." + << std::endl; + } + } // Set up the Cap'n Proto RPC server on a specific address and port - capnp::EzRpcServer server(kj::heap(), "localhost", 12345); + capnp::EzRpcServer server(kj::heap(), "localhost", port); // Keep the server running indefinitely auto &waitScope = server.getWaitScope(); From 843d980371eef3a2aaafb72fc3f41ef82158a932 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 17:41:40 +0200 Subject: [PATCH 25/27] BLD: Rework to generate files --- CppCore/rgpot/rpc/meson.build | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/CppCore/rgpot/rpc/meson.build b/CppCore/rgpot/rpc/meson.build index 0224969..1f6334b 100644 --- a/CppCore/rgpot/rpc/meson.build +++ b/CppCore/rgpot/rpc/meson.build @@ -1,19 +1,28 @@ +# Find dependencies and tools capnp_rpc_dep = dependency('capnp-rpc') -_mbproot = meson.project_build_root() -capnpc_ = find_program('capnpc') +capnpc = find_program('capnpc') + +output_dir = meson.current_source_dir() / 'gen' + gen_rpc = custom_target( 'gen_rpc', - input: ['Potentials.capnp'], + input: 'Potentials.capnp', output: ['Potentials.capnp.c++', 'Potentials.capnp.h'], - # TODO(rg): Can this be cleaner? command: [ - capnpc_, - f'-oc++:@_mbproot@/CppCore/rgpot/rpc', - '@INPUT@', - '--verbose', - '--src-prefix=../CppCore/rgpot/rpc', + 'sh', + '-c', + 'mkdir -p @0@ && @1@ -o c++:@0@ --src-prefix=@2@ @3@'.format( + output_dir, + capnpc.path(), + meson.current_source_dir(), + '@INPUT@', + ), ], ) + +gen_inc = include_directories('gen') +_incdirs += gen_inc + ptlrpc = library( 'ptlrpc', gen_rpc, From 6440e38b2c4654c9d653ec9ac3b6adb6a9668b01 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 17:42:24 +0200 Subject: [PATCH 26/27] ENH: Generate and use a capnp adapter --- CppCore/rgpot/rpc/server.cpp | 48 +++------- .../types/adapters/capnp/capnp_adapter.hpp | 91 +++++++++++++++++++ 2 files changed, 106 insertions(+), 33 deletions(-) create mode 100644 CppCore/rgpot/types/adapters/capnp/capnp_adapter.hpp diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index 7b7c8e2..d1a7f1f 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -1,61 +1,43 @@ // MIT License // Copyright 2023--present Rohit Goswami -#include "Potentials.capnp.h" #include #include #include "rgpot/CuH2/CuH2Pot.hpp" #include "rgpot/types/AtomMatrix.hpp" +#include "rgpot/types/adapters/capnp/capnp_adapter.hpp" // Fully define CuH2PotImpl before use class CuH2PotImpl final : public CuH2Pot::Server { public: kj::Promise calculate(CalculateContext context) override { - // Extract params directly from Cap'n Proto - // (zero-copy) is a suggestion, not now + // --- Use the adapter to convert FROM Cap'n Proto --- auto fip = context.getParams().getFip(); - - // Get number of atoms (rows in positions) const auto numAtoms = fip.getNatm(); - // Read directly - // Read position data from Cap'n Proto and copy to std::vector - rgpot::types::AtomMatrix nativePositions(numAtoms, 3); - auto posReader = fip.getPos(); - for (size_t i = 0; i < numAtoms * 3; ++i) { - nativePositions.data()[i] = posReader[i]; - } - - // Read atom numbers - auto atmnrsReader = fip.getAtmnrs(); - std::vector nativeAtomTypes(numAtoms); - for (size_t i = 0; i < numAtoms; ++i) { - nativeAtomTypes[i] = atmnrsReader[i]; - } + // Use the adapter functions for cleaner conversion + rgpot::types::AtomMatrix nativePositions = + rgpot::types::adapt::capnp::convertPositionsFromCapnp(fip.getPos(), + numAtoms); + std::vector nativeAtomTypes = + rgpot::types::adapt::capnp::convertAtomNumbersFromCapnp( + fip.getAtmnrs()); + std::array, 3> nativeBoxMatrix = + rgpot::types::adapt::capnp::convertBoxMatrixFromCapnp(fip.getBox()); - // Read box matrix - auto boxReader = fip.getBox(); - std::array, 3> nativeBoxMatrix; - for (size_t i = 0; i < 3; ++i) { - nativeBoxMatrix[i] = {boxReader[i * 3], boxReader[i * 3 + 1], - boxReader[i * 3 + 2]}; - } - - // Call CuH2Pot with the AtomMatrix and other parameters + // --- Call the core library code --- auto cuh2pot = rgpot::CuH2Pot(); auto [energy, forces] = cuh2pot(nativePositions, nativeAtomTypes, nativeBoxMatrix); - // Set up the result in Cap'n Proto + // --- Use the adapter to populate TO Cap'n Proto --- auto result = context.getResults(); auto pres = result.initResult(); pres.setEnergy(energy); - // Initialize and set forces + // Initialize and use the adapter to populate forces auto forcesList = pres.initForces(numAtoms * 3); - for (size_t i = 0; i < numAtoms * 3; ++i) { - forcesList.set(i, forces.data()[i]); - } + rgpot::types::adapt::capnp::populateForcesToCapnp(forcesList, forces); return kj::READY_NOW; } diff --git a/CppCore/rgpot/types/adapters/capnp/capnp_adapter.hpp b/CppCore/rgpot/types/adapters/capnp/capnp_adapter.hpp new file mode 100644 index 0000000..0636537 --- /dev/null +++ b/CppCore/rgpot/types/adapters/capnp/capnp_adapter.hpp @@ -0,0 +1,91 @@ +#pragma once +// MIT License +// Copyright 2023--present Rohit Goswami + +#include + +#include +#include +#include "rgpot/rpc/gen/Potentials.capnp.h" +#include "rgpot/types/AtomMatrix.hpp" + +namespace rgpot { +namespace types { +namespace adapt { +namespace capnp { + +// --- Functions to convert from Cap'n Proto Readers to Native Types --- + +// Converts a Cap'n Proto List representing positions to an AtomMatrix. +inline AtomMatrix +convertPositionsFromCapnp(const ::capnp::List::Reader &capnpPos, + size_t numAtoms) { + AtomMatrix nativePositions(numAtoms, 3); + for (size_t i = 0; i < numAtoms * 3; ++i) { + nativePositions.data()[i] = capnpPos[i]; + } + return nativePositions; +} + +inline std::vector +convertAtomNumbersFromCapnp(const ::capnp::List::Reader &capnpAtmnrs) { + std::vector nativeAtomTypes(capnpAtmnrs.size()); + for (size_t i = 0; i < capnpAtmnrs.size(); ++i) { + nativeAtomTypes[i] = capnpAtmnrs[i]; + } + return nativeAtomTypes; +} + +inline std::array, 3> +convertBoxMatrixFromCapnp(const ::capnp::List::Reader &capnpBox) { + std::array, 3> nativeBoxMatrix; + for (size_t i = 0; i < 3; ++i) { + // Correctly read the flattened 3x3 matrix row by row. + nativeBoxMatrix[i] = {capnpBox[i * 3], capnpBox[i * 3 + 1], + capnpBox[i * 3 + 2]}; + } + return nativeBoxMatrix; +} + +// --- Functions to convert from Native Types to Cap'n Proto Builders --- + +// Populates a Cap'n Proto List builder with data from an AtomMatrix. +inline void populatePositionsToCapnp(::capnp::List::Builder &capnpPos, + const AtomMatrix &positions) { + for (int i = 0; i < positions.rows() * positions.cols(); ++i) { + capnpPos.set(i, positions.data()[i]); + } +} + +// Populates a Cap'n Proto List builder with forces from an AtomMatrix. +inline void populateForcesToCapnp(::capnp::List::Builder &capnpForces, + const AtomMatrix &forces) { + for (int i = 0; i < forces.rows() * forces.cols(); ++i) { + capnpForces.set(i, forces.data()[i]); + } +} + +// Populates a Cap'n Proto List builder with data from a +// std::vector. +inline void populateAtomNumbersToCapnp(::capnp::List::Builder &capnpAtmnrs, + const std::vector &atomNumbers) { + for (size_t i = 0; i < atomNumbers.size(); ++i) { + capnpAtmnrs.set(i, atomNumbers[i]); + } +} + +// Populates a Cap'n Proto List builder with data from a 3x3 matrix. +inline void populateBoxMatrixToCapnp( + ::capnp::List::Builder &capnpBox, + const std::array, 3> &boxMatrix) { + for (size_t i = 0; i < 3; ++i) { + for (size_t j = 0; j < 3; ++j) { + capnpBox.set(i * 3 + j, boxMatrix[i][j]); + } + } +} + +} // namespace capnp +} // namespace adapt +} // namespace types +} // namespace rgpot From 7bb041f8057e614b27c75b55d7e7b3ee3e474d83 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Wed, 13 Aug 2025 17:49:02 +0200 Subject: [PATCH 27/27] ENH: Be generic over potentials --- CppCore/rgpot/rpc/Potentials.capnp | 2 +- CppCore/rgpot/rpc/pyclient.py | 2 +- CppCore/rgpot/rpc/server.cpp | 63 +++++++++++++++++++++--------- 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/CppCore/rgpot/rpc/Potentials.capnp b/CppCore/rgpot/rpc/Potentials.capnp index f5feaeb..8cc3472 100644 --- a/CppCore/rgpot/rpc/Potentials.capnp +++ b/CppCore/rgpot/rpc/Potentials.capnp @@ -15,7 +15,7 @@ struct PotentialResult { forces @1: List(Float64); } -interface CuH2Pot { +interface Potential { calculate @0 (fip :ForceInput) -> (result :PotentialResult); } diff --git a/CppCore/rgpot/rpc/pyclient.py b/CppCore/rgpot/rpc/pyclient.py index d756f99..ca5e291 100644 --- a/CppCore/rgpot/rpc/pyclient.py +++ b/CppCore/rgpot/rpc/pyclient.py @@ -18,7 +18,7 @@ def parse_args(): async def main(connection): client = capnp.TwoPartyClient(connection) - calculator = client.bootstrap().cast_as(Potentials_capnp.CuH2Pot) + calculator = client.bootstrap().cast_as(Potentials_capnp.Potential) print("Connection made ", end="") diff --git a/CppCore/rgpot/rpc/server.cpp b/CppCore/rgpot/rpc/server.cpp index d1a7f1f..4936390 100644 --- a/CppCore/rgpot/rpc/server.cpp +++ b/CppCore/rgpot/rpc/server.cpp @@ -4,18 +4,24 @@ #include #include "rgpot/CuH2/CuH2Pot.hpp" +#include "rgpot/LennardJones/LJPot.hpp" #include "rgpot/types/AtomMatrix.hpp" #include "rgpot/types/adapters/capnp/capnp_adapter.hpp" -// Fully define CuH2PotImpl before use -class CuH2PotImpl final : public CuH2Pot::Server { +class GenericPotImpl final : public Potential::Server { +private: + std::unique_ptr m_potential; + public: + // The constructor takes ownership of a potential object + GenericPotImpl(std::unique_ptr pot) + : m_potential(std::move(pot)) {} + kj::Promise calculate(CalculateContext context) override { // --- Use the adapter to convert FROM Cap'n Proto --- auto fip = context.getParams().getFip(); const auto numAtoms = fip.getNatm(); - // Use the adapter functions for cleaner conversion rgpot::types::AtomMatrix nativePositions = rgpot::types::adapt::capnp::convertPositionsFromCapnp(fip.getPos(), numAtoms); @@ -25,17 +31,16 @@ class CuH2PotImpl final : public CuH2Pot::Server { std::array, 3> nativeBoxMatrix = rgpot::types::adapt::capnp::convertBoxMatrixFromCapnp(fip.getBox()); - // --- Call the core library code --- - auto cuh2pot = rgpot::CuH2Pot(); + // --- Call the potential via the polymorphic interface --- + // This is the key change: no hardcoded type! auto [energy, forces] = - cuh2pot(nativePositions, nativeAtomTypes, nativeBoxMatrix); + (*m_potential)(nativePositions, nativeAtomTypes, nativeBoxMatrix); // --- Use the adapter to populate TO Cap'n Proto --- auto result = context.getResults(); auto pres = result.initResult(); pres.setEnergy(energy); - // Initialize and use the adapter to populate forces auto forcesList = pres.initForces(numAtoms * 3); rgpot::types::adapt::capnp::populateForcesToCapnp(forcesList, forces); @@ -43,25 +48,45 @@ class CuH2PotImpl final : public CuH2Pot::Server { } }; -// Main server setup +// Main server setup now acts as a factory int main(int argc, char *argv[]) { - // Set up the Cap'n Proto RPC server on a specific address and port - // Parse port from command line arguments, default to 12345 + if (argc < 3) { + std::cerr << "Usage: " << argv[0] << " " << std::endl; + std::cerr << " Available PotentialTypes: CuH2" + << std::endl; // Add more as you implement them + return 1; + } + int port = 12345; - if (argc > 1) { - try { - port = std::stoi(argv[1]); - } catch (const std::exception &e) { - std::cerr << "Invalid port argument, using default port 12345." - << std::endl; - } + try { + port = std::stoi(argv[1]); + } catch (const std::exception &e) { + std::cerr << "Invalid port argument '" << argv[1] + << "'. Using default 12345." << std::endl; + } + + std::string pot_type = argv[2]; + std::unique_ptr potential_to_use; + + if (pot_type == "CuH2") { + std::cout << "Loading CuH2 potential..." << std::endl; + potential_to_use = std::make_unique(); + } else if (pot_type == "LJ") { + std::cout << "Loading LJ potential..." << std::endl; + potential_to_use = std::make_unique(); + } else { + std::cerr << "Error: Unknown potential type '" << pot_type << "'" + << std::endl; + return 1; } - // Set up the Cap'n Proto RPC server on a specific address and port - capnp::EzRpcServer server(kj::heap(), "localhost", port); + capnp::EzRpcServer server( + kj::heap(std::move(potential_to_use)), "localhost", port); // Keep the server running indefinitely auto &waitScope = server.getWaitScope(); + std::cout << "Server running on port " << port << " with " << pot_type + << " potential." << std::endl; kj::NEVER_DONE.wait(waitScope); return 0;