Id for an execution context. It is associated with context object. More...
Public Member Functions | |
constexpr | context_id (void) noexcept |
Creates an invalid context_id object. | |
context_id (full_location const &fl) noexcept | |
Creates a context_id object for a base context. | |
context_id (full_location const &init, full_location const ¤t_loc, full_location const &source_loc, const bool intra_gang, const nesting_level n, const magic_id m) noexcept | |
Creates a context_id object for point-to-point requests. | |
context_id (full_location const &init, const gang_id gid, full_location const &source_loc, const bool intra_gang, const nesting_level n, const magic_id m) noexcept | |
Creates a context_id object for broadcast and multicast requests. | |
std::size_t | hash_code (void) const noexcept |
Public Attributes | |
full_location | initiator |
First location in invocation list. | |
full_location | current |
Destination of the request. | |
full_location | source |
Source of the request. | |
bool | intragang |
true if the invocation list has only locations of the same gang. | |
nesting_level | nesting |
Nesting level of the request. | |
magic_id | magic |
Number to disambiguate between two shortened invocation lists. | |
Related Functions | |
(Note that these are not member functions.) | |
std::size_t | hash_value (context_id const &id) noexcept |
Hash value creation function for context_id. More... | |
Id for an execution context. It is associated with context object.
context_id objects are unique in the system in the sense that two different context_id objects correspond to different execution contexts.
The context_id is a compact version of the request invocation list. This list consists of all the location ids that participated in the chain of requests. For example, a request from location 2 to location 3 that will generate a request to location 0 has an invocation list of {2, 3, 0}.
It is clear that the invocation list would increase with every request that was created as a result of another. In order to avoid this, only the following is in a context_id at the moment of its creation (when a request is about to be sent):
The magic number is automatically generated by the source when it is detected that the context id information is not enough and can result in two unrelated requests generating the same context id. This can only happen when the nesting level is more than 2.
The intragang flag is here to detect requests that went outside a gang and generated requests that ended up in the same gang that the initiator is from.