Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #41: Separate execution and memory resources #80

Merged
merged 5 commits into from
Oct 8, 2018

Conversation

AerialMantis
Copy link
Contributor

Gordon added 2 commits October 7, 2018 23:54
* Fixes codeplaysoftware#41 and codeplaysoftware#42.
* Introduce `memory_resource` to represent the memory component of a system topology.
* Remove `can_place_memory` and `can_place_agents` from the `execution_resource` as these are no longer required.
* Remove `memory_resource` and `allocator` from the `execution_context` as these no longer make sense.
* Update the wording to describe how execution resources and memory resources are structured.
* Refactor `affinity_query` to be between an `execution_resource` and a `memory_resource`.
* Make minor corrections.
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved

auto relativeLatency = relativeLatency01 > relativeLatency02;
auto relativeLatency = relativeLatency1 > relativeLatency0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the requirements for the returned type of the comparison operators? Must they be bool?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classes like less<T> break if the comparison operators don't return bool, because their operator() expects to return bool. This issue came up with bitmasks in the SIMD proposal; the author avoided the issue by not overloading comparison operators to return non-bool, and instead introducing two-letter comparison operators that return a bitmask for use e.g., in where clauses.

Copy link
Collaborator

@mhoemmen mhoemmen Oct 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See e.g., [comparisons.less]. I also read [expr.rel] as requiring that operator< always return bool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type of the comparison operators is currently a std::expected<size_t, error_type>, the reason for this was so that we could reflect a magnitude rather than simply a boolean as the relative affinity, and also that we want to handle failures to retrieve affinity. However, there have been some concerns about this interface not playing well with others, and this is another good example of that. I have an issue open for looking into alternative solutions to this - #68.


The construction of an `execution_context` on a component implies affinity (where possible) to the given resource. This guarantees that all executors created from that `execution_context` can access the resources and the internal data structures requires to guarantee the placement of the processor.
The construction of an `execution_context` on an `execution_resource` implies affinity (where possible) to the given resource. This guarantees that all executors created from that `execution_context` can access the resources and the internal data structures requires to guarantee the placement of the processor.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"data structures requires" -> "data structures required"

Not sure what "guarantee the placement of the processor" means. Has "processor" been defined in this context?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"placement of the data" perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I believe this wording is describing the guarantee that executors can make about where execution agents run. I've changed this to "binding of execution agents", does this read better?

affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
affinity/cpp-20/d0796r3.md Outdated Show resolved Hide resolved
@AerialMantis AerialMantis merged commit 5b0fce5 into codeplaysoftware:master Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants