[RL] FON: add optional C++ backend#400
Merged
Merged
Conversation
Collaborator
Author
Collaborator
Author
|
After cloning the C++ backend, need to recompile it locally before it will run. |
- Add FON.cpp with pybind11 bindings for FON belowground competition - Add backend_type selection in FON.py (cpp/python, auto-fallback) - Register fonzoi module in CMakeLists.txt - Add FONcpp benchmarks under Jabowa with reference files - Fix FON.xml output_dir pointing to ReferenceFiles (self-overwrite bug) - Update CppBackend.md and FON.md documentation
5fbe174 to
8f44e3f
Compare
- Default backend_type to "auto" instead of "cpp" so omitting <backend_type> triggers silent auto-selection, matching docs - Add grid shape equality check in C++ entry point - Clamp PBC index range to grid size to prevent theoretical double-counting when FON radius exceeds domain half-width
mcwimm
approved these changes
Jun 5, 2026
mcwimm
left a comment
Collaborator
There was a problem hiding this comment.
Can be merged after the small requested change 👍
| ``` | ||
|
|
||
| - FON with C++ backend on a 22x22m² mesh. | ||
| - The C++ backend requires compilation (see `CppBackend.md`). If the compiled module is not found, pyMANGA falls back to the pure Python implementation automatically. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - The C++ backend requires compilation (see `CppBackend.md`). If the compiled module is not found, pyMANGA falls back to the pure Python implementation automatically. | |
| - The C++ backend requires compilation (see `pyMANGA.ResourceLib`). If the compiled module is not found, pyMANGA falls back to the pure Python implementation automatically. |
By referencing pyMANGA.ResourceLib, users can jump directly to the documentation. Could you please check whether this needs to be changed elsewhere, too?
Per Marie's review on PR #400: linking to the package path lets users jump directly to the generated documentation.
Lgz-tud
added a commit
that referenced
this pull request
Jun 6, 2026
Match the convention applied in PR #400 (FON.md). Linking to the package path lets users jump directly to the generated documentation.
Collaborator
Author
|
Thanks for the suggestion, Marie! Done in 04908ec — I also checked elsewhere: |
Lgz-tud
added a commit
that referenced
this pull request
Jun 6, 2026
Match the convention applied in PR #400 (FON.md). Linking to the package path lets users jump directly to the generated documentation.
jvollhueter
pushed a commit
to jvollhueter/pyMANGA-1
that referenced
this pull request
Jun 7, 2026
Per Marie's review on PR pymanga#400: linking to the package path lets users jump directly to the generated documentation.
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optional C++ backend for the FON (Field of Neighborhood) below-ground resource module, following the same pattern as the AsymmetricZOI (PR #388) and SymmetricZOI (PR #390) C++ backends.
C++ Backend
FON.cpp: pybind11 kernel with OpenMP parallelization for FON belowground competition<backend_type>cpp</backend_type>XML tag (auto-selects C++ when available, falls back to Python)Benchmark
Use
Benchmarks/TestOutputs/consistent withSymmetricZOI.xmlandAsymmetricZOI.xml.Changed files
ResourceLib/BelowGround/Individual/FON/FON.cppResourceLib/BelowGround/Individual/FON/FON.pyResourceLib/BelowGround/Individual/FON/FON.mdResourceLib/CppBackend.mdCMakeLists.txtBenchmarks/BenchmarkList.xmlBenchmarks/.../Jabowa/.../FONcpp_CI.xmlBenchmarks/.../Jabowa/.../FONcpp.xmlBenchmarks/.../Jabowa/.../ReferenceFiles/FONcpp*/Benchmarks/.../Jabowa/.../FON.xmlBenchmarks/.../Bettina/.../FON.xml