Generic filters#755
Closed
alexis-pereda wants to merge 2 commits intomasterfrom
Closed
Conversation
added 2 commits
May 13, 2025 01:06
The entrypoint is in the base actor interface, using filter member. This string can be defined to a Python expression like: "particle_name == "gamma" and pre_kinetic_energy <= 20 * MeV" A Transformer will: - pre compute constants (e.g. 20 * MeV will become a direct value); - turn attribute names into function calls to acquire its value. The AST is then used as the body of a Python function. This function is given to the C++-side corresponding base actor to be used as the filter. This POC works, though it is noticeably slower than another experiment using a JIT compiled C++ function (using ROOT.gInterpreter).
tbaudier
reviewed
May 14, 2025
Contributor
There was a problem hiding this comment.
binary file to move to data
Contributor
There was a problem hiding this comment.
binary file to move to data
Contributor
There was a problem hiding this comment.
binary file to move to data
Author
There was a problem hiding this comment.
(for all) yes, no problem. These files probably won't exist in a few commits anyway, but I will follow this for the files that will be produced by the actual test.
Contributor
|
See #909 |
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.
A new system to configure filters for actors.
The main idea is to be able to write for example:
Current proof of concept works, run time overhead yet to assess to compare to another implementation (partial) using C++ JIT compilation (preliminary tests show a factor of around 2 for short simulations on m'y computer).
To discuss : optional dependency on (py)ROOT (for C++ JIT) to reduce simulation time when using generic filters.
Demo in test023 generic (not an actual test yet, must be executed with options, e.g. -san1e2).