Implement TT policies to control process mapping, priorities, and inlining #226
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.
Policies replace explicit keymap and priomaps and can be directly inlined if so provided. They provide a wrapper around callables that map a key to an integer (rank, priority and the depth of inlining). They also provide extensibility in the future.
Users of
ttg::make_tt
can usettg::make_policy
to define policies with custom lambdas mapping keys to integers. Statically set policies cannot be changed at runtime, all defaulted policies can be set dynamically. Similarly,ttg::make_static_policy
provides policies with statically defaulted mapping functions, which cannot be changed at runtime.Users of
ttg::TT
can provide their own policy class that derives fromTTPolicyBase
to ensure forward compatibility. Policies are not virtual so custom policy classes simply override the base class symbols.TT implementations derive from a
TTPolicyWrapper
class that provides all policy-relevant member functions (to ensure consistency and reduce code duplication).@pnookala I used static policies in the streaming mrattg benchmark as a demo. Let me know if you're ok with that.
This change does not implement task inlining but provides the policy to control future implementations.
This PR supersedes #218 (too many conflicts after #217 and #223 were merged)
Signed-off-by: Joseph Schuchart [email protected]