STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Classes | Public Member Functions | Public Types | Related Functions
stapl::runtime::location_md Class Reference

Location metadata. More...

Classes

class  fence_md
 Fence metadata for intragang requests. More...
 

Public Member Functions

void * operator new (std::size_t)
 
void operator delete (void *)
 
void * operator new[] (std::size_t)=delete
 
void operator delete[] (void *)=delete
 
 location_md (const id lid, gang_md &g)
 Constructs a new location_md object. More...
 
 location_md (const id lid, const size_type local_idx, gang_md &g)
 Constructs a new location_md object. More...
 
 location_md (location_md const &)=delete
 
location_mdoperator= (location_md const &)=delete
 
id get_id (void) const noexcept
 
gang_md const & get_gang_md (void) const noexcept
 
gang_mdget_gang_md (void) noexcept
 
bool is_leader (void) const noexcept
 Returns true if this location is the leader among all the locally managed locations.
 
size_type local_index (void) const noexcept
 Returns the index of this location among all the locally managed locations.
 
runqueue_type const & get_runqueue (void) const noexcept
 
runqueue_typeget_runqueue (void) noexcept
 
void set_executor (std::unique_ptr< executor_base > ex) noexcept
 Sets the executor of this location_md.
 
executor_basetry_get_executor (void) noexcept
 
executor_baseget_executor (void)
 
magic_id disambiguate (context_id const &src, context_id const &dest)
 Generates the magic number to disambiguate between context_id objects that should not be the same. More...
 
gang_mdget_cached_gang_md (const gang_md::id gid)
 Returns a pointer to the cached gang metadata if it is available, otherwise nullptr.
 
epoch_type advance_epoch (void)
 
epoch_type get_epoch (void) const noexcept
 
void undefer_requests (void)
 
void defer_requests (void)
 
bool try_defer_requests (void)
 
std::pair< object_virtual_address, epoch_type > register_object (void *const p, const bool avoid_registry)
 Returns a handle and registration epoch upon registering p. More...
 
void unregister_object (object_virtual_address const &h)
 Unregisters the pointer associated with handle h. More...
 
void * get_object (object_virtual_address const &h, const epoch_type e=logical_clock::no_time) const
 
void pre_fence (void)
 Pre rmi_fence() operations. More...
 
void post_fence (void)
 Post rmi_fence() operations. More...
 
fence_md const & get_fence_md (void) const noexcept
 
fence_mdget_fence_md (void) noexcept
 
bool has_pending_rmis (void) const noexcept
 Returns if there are pending RMIs. More...
 
template<typename T , typename U >
T & reset_lss (void *addr, U &&u)
 Replaces the object associated with the given address. More...
 
template<typename T , typename CreatorFunction >
T & get_lss (void *addr, CreatorFunction &&f)
 Returns an object associated with the given address. More...
 
template<typename T >
T * try_get_lss (void *addr) noexcept
 Returns an object associated with the given address. More...
 
void destroy_lss (void *addr) noexcept
 Destroys the object associated with the given address. 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
 

Public Types

using id = location_id
 
using epoch_type = logical_clock::time_type
 
using size_type = gang_md::size_type
 
using runqueue_type = runqueue
 

Related Functions

(Note that these are not member functions.)

constexpr bool operator== (location_md const &x, location_md const &y) noexcept
 Returns if x is equal to y. More...
 

Detailed Description

Location metadata.

The metadata includes fence metadata for the intragang requests of the contexts of the associated location, objects registered through rmi_handle, location_specific_storage objects and a runqueue for incoming requests.

All location_md objects are reference-counted and are destroyed when the count becomes 0. The associated gang_md object is notified when the location_md object is destroyed.

Constructor & Destructor Documentation

◆ location_md() [1/2]

stapl::runtime::location_md::location_md ( const id  lid,
gang_md g 
)

Constructs a new location_md object.

Parameters
lidId of the location.
gMetadata of the gang the location belongs to.

◆ location_md() [2/2]

stapl::runtime::location_md::location_md ( const id  lid,
const size_type  local_idx,
gang_md g 
)

Constructs a new location_md object.

Parameters
lidId of the location.
local_idxIndex in the locally managed locations list of g.
gMetadata of the gang the location belongs to.

Member Function Documentation

◆ disambiguate()

magic_id stapl::runtime::location_md::disambiguate ( context_id const &  src,
context_id const &  dest 
)

Generates the magic number to disambiguate between context_id objects that should not be the same.

See also
context_id

◆ register_object()

std::pair<object_virtual_address, epoch_type> stapl::runtime::location_md::register_object ( void *const  p,
const bool  avoid_registry 
)

Returns a handle and registration epoch upon registering p.

If avoid_registry is true, then the object will not be inserted in a registry and the epoch will not be increased.

Warning
This function will increase the reference count of this location_md object.

◆ unregister_object()

void stapl::runtime::location_md::unregister_object ( object_virtual_address const &  h)

Unregisters the pointer associated with handle h.

Warning
This function will decrease the reference count of the location_md object. If the reference count is 0, it will be destroyed.

◆ pre_fence()

void stapl::runtime::location_md::pre_fence ( void  )

Pre rmi_fence() operations.

This notifies the runqueue to change the scheduling policy.

◆ post_fence()

void stapl::runtime::location_md::post_fence ( void  )

Post rmi_fence() operations.

This makes all unregistered handles from spmd_registry and the SPMD keys available again.

◆ has_pending_rmis()

bool stapl::runtime::location_md::has_pending_rmis ( void  ) const
noexcept

Returns if there are pending RMIs.

Warning
Only works for gangs with one location.

◆ reset_lss()

template<typename T , typename U >
T& stapl::runtime::location_md::reset_lss ( void *  addr,
U &&  u 
)

Replaces the object associated with the given address.

If there is a stored object, it will destroy it.

See also
location_specific_storage

◆ get_lss()

template<typename T , typename CreatorFunction >
T& stapl::runtime::location_md::get_lss ( void *  addr,
CreatorFunction &&  f 
)

Returns an object associated with the given address.

If there is no object, it will create one.

See also
location_specific_storage

◆ try_get_lss()

template<typename T >
T* stapl::runtime::location_md::try_get_lss ( void *  addr)
noexcept

Returns an object associated with the given address.

If there is no object, it will not create one.

See also
location_specific_storage

◆ destroy_lss()

void stapl::runtime::location_md::destroy_lss ( void *  addr)
noexcept

Destroys the object associated with the given address.

See also
location_specific_storage

◆ remove_ref()

long stapl::runtime::ref_counted< location_md , std::default_delete<location_md > >::remove_ref ( long  count = 1,
std::memory_order  order = std::memory_order_relaxed 
)
noexceptinherited

Decreases the reference count by count.

Returns
The new reference count.

◆ release()

bool stapl::runtime::ref_counted< location_md , std::default_delete<location_md > >::release ( std::memory_order  order = std::memory_order_relaxed)
noexceptinherited

Decreases the reference count, destroying the object if it reached 0.

Warning
If release() returns true, then the object has been destroyed.
Returns
true if the object was destroyed, otherwise false.

The documentation for this class was generated from the following files: