Gang metadata that is shared by the locations that are on the same process. More...
Classes | |
class | fence_md |
Fence metadata for intergang requests. More... | |
Public Member Functions | |
gang_md (gang_description desc, const size_type nlocs) | |
Creates the global gang metadata with id 0 for processes with nlocs locally managed location. More... | |
gang_md (const id parent_id, common_gang_md &c_md) | |
Creates gang metadata for a single location gang. More... | |
gang_md (const id parent_id, const size_type nlocs) | |
Creates gang metadata for a shared memory only gang. More... | |
gang_md (const id gid, const id parent_id, gang_description desc) | |
Creates gang metadata with a known id. More... | |
gang_md (const id parent_id, gang_description desc) | |
Creates gang metadata with an automatically generated id. More... | |
gang_md (const deferred_t, const id parent_id, gang_description desc) | |
Creates gang metadata with an unknown id. More... | |
template<typename Range > | |
gang_md (const id gid, const id parent_id, gang_description desc, Range &&r) | |
Creates gang metadata with a known id. More... | |
template<typename Range > | |
gang_md (const id parent_id, gang_description desc, Range &&r) | |
Creates gang metadata with an automatically generated id. More... | |
gang_md (const id gid, const id parent_id, gang_md const &other) | |
Creates gang metadata that is identical to other with a known id. More... | |
gang_md (const id parent_id, gang_md const &other) | |
Creates gang metadata that is identical to other with an automatically generated id. More... | |
void | set_id (const id gid) |
Sets the gang id and automatically registers *this to the gang_md_registry. More... | |
id | get_id (void) const noexcept |
id | get_parent_id (void) const noexcept |
gang_description const & | get_description (void) const noexcept |
topology const & | get_topology (void) const noexcept |
runqueue_type const & | get_runqueue (void) const noexcept |
runqueue_type & | get_runqueue (void) noexcept |
fence_md const & | get_fence_md (void) const noexcept |
fence_md & | get_fence_md (void) noexcept |
size_type | size (void) const noexcept |
size_type | local_size (void) const noexcept |
Returns the number of locally managed locations. | |
bool | exists (const location_id lid) const noexcept |
Returns if the location id exists in this gang. | |
process_id | get_process_id (const location_id lid) const noexcept |
bool | conforms_with (gang_md const &g) const noexcept |
template<typename T , typename Handle , typename... Args> | |
std::shared_ptr< T > | get_shared_object (Handle const &h, Args &&... args) |
Returns an object that is shared among all the locally managed locations. More... | |
void | add_ref (long count=1, std::memory_order order=std::memory_order_relaxed) noexcept |
Increases the reference count by count . | |
long | remove_ref (long count=1, std::memory_order order=std::memory_order_relaxed) noexcept |
Decreases the reference count by count . More... | |
bool | release (std::memory_order order=std::memory_order_relaxed) noexcept |
Decreases the reference count, destroying the object if it reached 0. More... | |
long | use_count (std::memory_order order=std::memory_order_relaxed) const noexcept |
bool | unique (std::memory_order order=std::memory_order_relaxed) const noexcept |
Static Public Member Functions | |
static void | update_fence_md (const gang_md::id gid, fence_md::container_type const &c) |
Updates counts for sent and processed intergang requests. | |
Public Types | |
using | id = gang_id |
using | size_type = common_gang_md::size_type |
using | runqueue_type = shared_runqueue |
Related Functions | |
(Note that these are not member functions.) | |
constexpr bool | operator== (gang_md const &x, gang_md const &y) noexcept |
Returns if x is equal to y . More... | |
Gang metadata that is shared by the locations that are on the same process.
gang_md contains fence metadata for intergang requests (see also context). It acts as a proxy to the contained gang_description to return information on which process each location exists.
It also contains a topology object that describes the topology of the processes that the gang consists of.
Finally, it is used by the locations on the same process to create objects that can be shared between them.
A gang_md object is reference counted. It is destroyed when all the locally managed locations, their associated location_md objects as well as the gang_md objects in the children processes have been destroyed.
stapl::runtime::gang_md::gang_md | ( | gang_description | desc, |
const size_type | nlocs | ||
) |
Creates the global gang metadata with id 0
for processes with nlocs
locally managed location.
The object will be automatically registered to the gang_md_registry.
desc | gang_description object associated with this gang. |
nlocs | Number of locally managed locations. |
stapl::runtime::gang_md::gang_md | ( | const id | parent_id, |
common_gang_md & | c_md | ||
) |
Creates gang metadata for a single location gang.
The object will be automatically registered to the gang_md_registry.
parent_id | Id of the gang that created this one. |
c_md | Shared gang metadata. |
stapl::runtime::gang_md::gang_md | ( | const id | parent_id, |
const size_type | nlocs | ||
) |
Creates gang metadata for a shared memory only gang.
The object will be automatically registered to the gang_md_registry.
parent_id | Id of the gang that created this one. |
nlocs | Number of locally managed locations. |
stapl::runtime::gang_md::gang_md | ( | const id | gid, |
const id | parent_id, | ||
gang_description | desc | ||
) |
Creates gang metadata with a known id.
The object will be automatically registered to the gang_md_registry.
gid | Gang id. |
parent_id | Parent gang id. |
desc | gang_description object associated with this gang. |
stapl::runtime::gang_md::gang_md | ( | const id | parent_id, |
gang_description | desc | ||
) |
Creates gang metadata with an automatically generated id.
The object will be automatically registered to the gang_md_registry.
parent_id | Parent gang id. |
desc | gang_description object associated with the gang. |
stapl::runtime::gang_md::gang_md | ( | const deferred_t | , |
const id | parent_id, | ||
gang_description | desc | ||
) |
Creates gang metadata with an unknown id.
The object will be registered by set_id().
parent_id | Parent gang id. |
desc | gang_description object associated with the gang. |
stapl::runtime::gang_md::gang_md | ( | const id | gid, |
const id | parent_id, | ||
gang_description | desc, | ||
Range && | r | ||
) |
Creates gang metadata with a known id.
The object will be automatically registered to the gang_md_registry.
gid | Gang id. |
parent_id | Parent gang id. |
desc | gang_description object associated with this gang. |
r | Locally managed location id range. |
stapl::runtime::gang_md::gang_md | ( | const id | parent_id, |
gang_description | desc, | ||
Range && | r | ||
) |
Creates gang metadata with an automatically generated id.
The object will be automatically registered to the gang_md_registry.
parent_id | Parent gang id. |
desc | gang_description object associated with the gang. |
r | Locally managed location id range. |
stapl::runtime::gang_md::gang_md | ( | const id | gid, |
const id | parent_id, | ||
gang_md const & | other | ||
) |
Creates gang metadata that is identical to other
with a known id.
The object will be automatically registered to the gang_md_registry.
gid | Gang id. |
parent_id | Parent gang id. |
other | Gang to clone. |
stapl::runtime::gang_md::gang_md | ( | const id | parent_id, |
gang_md const & | other | ||
) |
Creates gang metadata that is identical to other
with an automatically generated id.
The object will be automatically registered to the gang_md_registry.
parent_id | Parent gang id. |
other | Gang to clone. |
void stapl::runtime::gang_md::set_id | ( | const id | gid | ) |
Sets the gang id and automatically registers *this
to the gang_md_registry.
gid | Id to register the gang metadata with. |
std::shared_ptr<T> stapl::runtime::gang_md::get_shared_object | ( | Handle const & | h, |
Args &&... | args | ||
) |
Returns an object that is shared among all the locally managed locations.
The returned object is valid for local_size() requesting locations and is indexed with h
.
h
.h | Handle to index the shared object. |
args | Arguments to pass to the constructor of the shared object. |
|
noexceptinherited |
Decreases the reference count by count
.
|
noexceptinherited |
Decreases the reference count, destroying the object if it reached 0.
release()
returns true
, then the object has been destroyed.true
if the object was destroyed, otherwise false
.