STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
stapl::runtime Namespace Reference

STAPL Runtime System implementation classes and functions. More...

Namespaces

 this_context
 STAPL Runtime System RMI execution context management.
 

Classes

class  active_handle_response
 Function object to call the function operator of a distributed object with the given value. More...
 
class  aggregator
 Aggregator for point-to-point requests. More...
 
class  all_locations_rpc_aggregator
 Aggregator for RPC requests to all locations of a gang. More...
 
class  all_locs_construct_request
 Request to construct an object on all locally managed locations. More...
 
class  allgather_object
 Performs an allgather over all locations of the current gang. More...
 
class  allreduce_object
 Performs an allreduce over all locations of the current gang. More...
 
class  any
 any can hold an object of any type. The object can be retrieved only by casting to the correct type. More...
 
class  any_range
 Type erased range of const objects with associated size information. More...
 
struct  arbitrary
 Arbitrary mapping function. More...
 
class  arg_storage
 Storage for an object of type T that is retrieved by lvalue reference. More...
 
class  array_mailbox
 Mailbox for multiple threads that are contiguously numbered. More...
 
class  async_result
 Storage for a result that can be asynchronously assigned and retrieved. More...
 
class  async_results
 Storage for an array of results that can be asynchronously assigned and retrieved. More...
 
class  async_rmi_request
 RMI request that discards the return value and supports combining. More...
 
class  async_rpc_request
 Remote Procedure Call (RPC) request that discards return values. More...
 
class  backoff_metadata
 Backoff mechanism metadata. More...
 
class  barrier
 Performs a barrier over the processes specified by the topology object. More...
 
class  barrier_object
 Performs a barrier over all locations of the current gang. More...
 
class  bcast_aggregator
 Aggregator for ordered and unordered broadcast requests. More...
 
class  bind_rmi_result
 Establishes a communication tunnel to a member function of a distributed object. More...
 
class  binomial_tree_iterator
 Iterator to generate range of children ids required from make_binomial_tree. More...
 
class  block_registry
 Implements a registry that allows registration of ranges (blocks) of keys to be used by an entity that has a unique id. More...
 
struct  blocked
 Block mapping function. More...
 
class  bool_mutex
 Bool based mutex. More...
 
class  broadcast_object
 Performs a broadcast over all locations of the current gang. More...
 
class  buffer_iarchive
 Archive to unpack an object from a stream. More...
 
class  buffer_oarchive
 Archive to pack an object to a stream. More...
 
class  c_string
 Wraps a C string into a class. More...
 
class  cache_line_aligned_allocator
 An allocator that enforces that all allocated memory returned to the caller begins at the start of a cache line. More...
 
class  cache_line_aligned_storage
 Storage for a single instance of type T. Class has alignas directive to ensure cache line alignment. Used as storage type for cache_line_aligned_vector. More...
 
class  cache_line_aligned_vector
 Basic vector class based on std::vector which enforces cache line alignment. More...
 
class  call_promise_set_value
 Calls promise<rmi_handle::reference>::set_value() from location 0. More...
 
class  centralized_fuzzy_barrier
 Centralized fuzzy barrier. More...
 
struct  cloner
 Copy constructs a new T object on heap allocated memory. More...
 
class  collective
 Handle for distributed memory collective operations. More...
 
class  combinable_rmi_request
 Encapsulates an RMI request that supports combining for subsequent execution via the function operator. More...
 
class  combined_request_size
 Information about the size of combined requests. More...
 
class  common_gang_md
 Metadata that can be shared between multiple gangs. More...
 
class  communicator
 This class assists with sending messages between processes. More...
 
class  comparable_proxy
 Proxy object that allows type-erased objects or function pointers to be compared between them. More...
 
struct  comparator
 Function object to test if two objects are equal. More...
 
class  concurrency
 Initializes and controls threads for shared-memory concurrency. More...
 
struct  const_member_pointer
 Returns a member function pointer of type R (T::*)(Arg...) const. More...
 
class  construct_request
 Request to construct an object in a new gang over specific locations of an existing gang. More...
 
class  context
 Execution context of a task or request. More...
 
struct  context_id
 Id for an execution context. It is associated with context object. More...
 
class  continuation_request
 Calls function f with a Future created with t.... More...
 
class  copied_arg_storage
 Storage for a moved object that is retrieved by copy or by const reference. More...
 
class  copied_ref_storage
 Storage for a moved object that is retrieved by non-const reference. More...
 
struct  copyable
 Tag type for objects that for which is_copyable is std::true_type. More...
 
struct  create_object
 Calls the constructor of T with Args. More...
 
struct  create_shared_ptr
 Creates a new shared_ptr from the given object. More...
 
class  ctx_impl
 Wrapper to store a context and allow queueing it into a boost::intrusive::list. More...
 
struct  data_race_helper
 Helper class for detecting possible data races in a class static or stand-alone function. More...
 
struct  deferred_t
 Tag type to defer an operation. More...
 
class  delete_object_request
 Request to delete a distributed object. More...
 
class  distributor
 Gang id and metadata distributor. More...
 
class  exception
 Runtime base exception object. More...
 
class  executor_intermediate
 Intermediate class to allow adding entries with scheduling information. More...
 
class  executor_rmi_request
 Request for executing the given function on the destination location. More...
 
struct  external_caller
 Function object that calls a function passed from external_call(). More...
 
class  fence_md
 Fence metadata for intergang communication when a gang_md has no representative. More...
 
struct  fence_md_delete
 Destroys fence_md objects while sending the metadata to the correct process. More...
 
class  fence_section
 Enters a section of the code that is related to fence. More...
 
struct  fixed
 Fixed mapping function. More...
 
class  full_location
 Describes a location as a tuple of a gang id and a location id. More...
 
class  future_base
 Provides a common base for an asynchronously returned object. More...
 
class  futures_base
 Provides a common base for asynchronously returned arrays of objects. More...
 
class  gang_description
 Contains information about the locations of a gang. More...
 
class  gang_md
 Gang metadata that is shared by the locations that are on the same process. More...
 
class  gang_md_registry
 Gang metadata registry. More...
 
class  gang_retriever
 Retrieves the gang_md& associated with the gang id. More...
 
class  gang_switcher
 Switches to and from the given gang. More...
 
class  global_wf
 Function object to create a new distributed or mixed-mode environment. More...
 
class  handle_response
 Function object to assign an object to a distributed object via the Handle::set_value() function. More...
 
struct  has_define_type_impl
 Detects if T has a function T::define_type(stapl::typer&). More...
 
class  header
 Provides the enum and the different headers for communication. More...
 
struct  heap_tracker_init
 Nifty counter idiom to initialize the heap tracker and keep it alive until the last object file that uses it is finalized. More...
 
class  hierarchical_mutex
 Hierarchical synchronization primitive that does not emit memory fences. More...
 
struct  identity
 Identity mapping function. More...
 
struct  identity_member_pointer
 Returns a member function pointer of type R (T::*)(Arg...). More...
 
class  indexed_handle_response
 Function object to assign an object to a distributed object that accepts multiple objects via the Handle::set_value() function. More...
 
class  indexed_response
 Function object to assign an object to a known address that expects multiple objects. More...
 
class  instrument
 Provides instrumentation capabilities for runtime functions. More...
 
class  intrusive_mpsc_queue
 An intrusive lock-free MPSC (multiple producer, single consumer) queue. More...
 
class  intrusive_mpsc_queue_hook
 Hook for intrusive_mpsc_queue. More...
 
struct  is_appropriate_handle
 Returns std::true_type if Handle can be used to call PMF, otherwise std::false_type. More...
 
struct  is_contiguous_iterator
 If T is an iterator to a container that its elements are in contiguous space it is equivalent to std::true_type, for any other iterator it is std::false_type. More...
 
struct  is_copyable
 Typedefs member type to std::true_type if T is a copyable type, otherwise it typedefs it to std::false_type. More...
 
struct  is_known_polymorphic
 Returns if a type T has polymorphic_callable defined. More...
 
struct  is_movable
 Typedefs member type to std::true_type if T is a movable type, otherwise it typedefs it to std::false_type. More...
 
struct  is_reference_wrapper
 Returns if T is a std::reference_wrapper<> or boost::reference_wrapper. More...
 
struct  is_reference_wrapper_impl
 Returns if T is a std::reference_wrapper<> or boost::reference_wrapper. More...
 
struct  is_shared_ptr
 Returns if T is a std::shared_ptr<> or boost::shared_ptr. More...
 
struct  is_shared_ptr_impl
 Returns if T is a std::shared_ptr or boost::shared_ptr. More...
 
class  location_md
 Location metadata. More...
 
class  location_rpc_aggregator
 Aggregator for RPC requests to a single location. More...
 
class  location_rpc_executor
 Executes RPC requests for a specific location, preserving the requests that could not be executed for a later invocation. More...
 
class  location_rpc_request
 Encapsulates an RPC request directed to a location for subsequent execution via the function operator. More...
 
class  logical_clock
 Implements a logical clock for managing epochs. More...
 
class  mailbox
 Mailbox for multiple threads with arbitrary numbering. More...
 
struct  make_arg_storage
 Argument storage type creation metafunction. More...
 
struct  make_arguments< F, T... >
 Metafuction for creating a tuple of arg_storage_t to store the objects in list T. More...
 
class  malloc_allocator
 An allocator that uses std::malloc() directly. More...
 
class  managed_locations_info
 Container that associates parent gang to child gang location ids only for locally managed locations. More...
 
class  managed_locations_rpc_aggregator
 Aggregator for RPC requests to all locations in shared memory. More...
 
class  meets_requirements_oarchive
 Archive to determine if the object meets the packing requirements. More...
 
class  memory_allocator
 Provides interfaces to do pool allocation for objects. More...
 
class  message
 Communication buffer. More...
 
struct  message_delete
 Deleter for message objects. More...
 
class  message_handle
 This class is used to keep track of the handles associated with a message. More...
 
class  message_shared_ptr
 Intrusive message shared pointer. More...
 
class  message_slist
 Intrusive message list. More...
 
struct  movable
 Tag type for objects that for which is_movable is std::true_type. More...
 
class  moved_cref_storage
 Storage for a moved object that is retrieved by const reference. More...
 
class  moved_object_storage
 Storage for an object that is moved and retrieved either by copy or by rvalue reference. More...
 
class  moved_ref_storage
 Storage for a moved object that is retrieved by reference. More...
 
class  mpe_profiler
 Notifies MPE of a new instrumented section. More...
 
class  mpi_communicator
 Implements a communicator based on MPI-2. More...
 
class  nc_async_rmi_request
 RMI request that discards the return value. More...
 
class  nested_wf
 Function object to create a new threads-only environment. More...
 
struct  no_context_t
 Tag type to skip any operations related to a context. More...
 
struct  no_implicit_flush_t
 Tag type to mark that a flush is not implicit. More...
 
class  non_const_arg_storage
 Storage for a non-const, non-basic, non-distributed object that is retrieved by non-const lvalue reference to non-basic object. More...
 
class  non_const_ptr_storage
 Storage for a pointer to non-const, non-basic, non-distributed object that is retrieved by pointer to a non-const, non-basic object. More...
 
class  object_storage
 Storage for objects used in communication over shared memory. More...
 
class  object_virtual_address
 Distributed object virtual address. More...
 
struct  p_object_ptr_cast_impl
 Casts the void pointer to pointer to T. More...
 
class  p_object_ref_storage
 Storage for an lvalue reference to a distributed object. More...
 
class  packed_handle
 Packs rmi_handle::reference and rmi_handle::const_reference for use in requests. More...
 
class  packed_handle_epoch
 Packs rmi_handle::reference and rmi_handle::const_reference and the epoch for use in requests. More...
 
class  packed_object_storage
 Storage for object of type T used in communication. More...
 
struct  packed_value
 Handles unpacking objects stored in an arg_storage. More...
 
class  papi_clock
 Represents a clock based on PAPI_get_real_usec(). More...
 
class  papi_cycle_clock
 Represents a clock based on PAPI_get_real_cyc() and MHz. More...
 
class  poly_destroy
 Calls typer_traits::destroy() for polymorphic types. More...
 
class  poly_meets_requirements
 Calls the requested function from typer_traits for polymorphic types. More...
 
class  poly_pack
 Calls typer_traits::pack() for polymorphic types. More...
 
class  poly_packed_size
 Calls typer_traits::packed_size() for polymorphic types. More...
 
class  poly_unpack
 Calls for typer_traits::unpack() for polymorphic types. More...
 
class  pool
 Pool of memory chunks of a specific size. More...
 
struct  primitive_traits
 Traits for primitives. More...
 
struct  read_lock_guard
 Lock guard for read lock ownership. More...
 
struct  read_lock_t
 Tag type for read lock ownership. More...
 
class  ready_future
 future_base implementation for ready values. More...
 
class  ready_futures
 futures_base implementation for ready values. More...
 
class  reduce
 Distributed memory collective reduce. More...
 
class  reduce_rmi_handle
 Handle to wait for values from reduce_rmi(). More...
 
class  reduction
 Shared memory reduction using atomic counter. Last thread through does serial reduction and returns true, signaling value is ready for consumption. More...
 
class  ref_counted
 Provides a reference counting mechanism for objects that derive from it. More...
 
class  ref_counted_range
 Provides a range-based interface for ref_counted derived objects. More...
 
class  ref_counted_wrapper
 Wrapper over T to make it conformable with ref_counted. More...
 
class  request_queue
 Request queue. More...
 
class  response
 Function object to assign an object to a known address. More...
 
class  response_aggregator
 Aggregator for responses to requests. More...
 
class  restore_request
 Request for restoring an SPMD section. More...
 
class  rmi_delegate
 Delegate for an RMI request. More...
 
class  rmi_executor
 Executes RMI requests for a specific context, preserving the requests that could not be executed for a later invocation. More...
 
class  rmi_handle_base
 Distributed object base handle. More...
 
class  rmi_handle_extended_base
 Extended distributed object handle information. More...
 
class  rmi_handle_info
 Distributed object handle information. More...
 
class  rmi_request
 Encapsulates an RMI request for subsequent execution via the function operator. More...
 
class  rpc_aggregator
 Aggregator for RPC requests to a process or a range of processes. More...
 
struct  rpc_executor
 Executes RPC requests for a process. More...
 
class  rpc_request
 Encapsulates an RPC request directed to a process for subsequent execution via the function operator. More...
 
class  runqueue
 Queue for scheduling requests. More...
 
struct  runqueue_gang_id_comparator
 Less than equal comparator for runqueue::impl and gang ids. More...
 
class  runtime_error
 Runtime error exception object. More...
 
class  rval_storage
 Storage for an object that is retrieved by rvalue reference. More...
 
class  shared_object_factory
 Factory for creating object shared between threads. More...
 
class  shared_runqueue
 Runqueue shared among locations of a gang that are on the same process. More...
 
class  single_location_construct_request
 Request to construct an object in a new single location gang. More...
 
class  size_oarchive
 Archive to calculate the size an object needs for packing. More...
 
class  spmd_registry
 Registry for SPMD-registered objects. More...
 
class  stack
 Thread stack information object. More...
 
struct  supports_stapl_packing
 Returns std::true_type if typer_traits specialization exists for T or T::define_type(stapl::typer&) is defined. More...
 
struct  supports_stapl_packing_impl
 Returns std::true_type if typer_traits specialization exists for T or T::define_type(stapl::typer&) is defined. More...
 
class  sync_rmi_request
 RMI request that calls the given callback with the return value of the function. More...
 
class  task_queue< R(Args...)>
 A lock-free MPSC (multiple producer, single consumer) queue of tasks to be executed. More...
 
class  thin_spin_mutex
 Spin-based synchronization primitive that does not emit memory fences. More...
 
struct  thread_info_t
 Thread information. More...
 
class  timer
 Provides a timer mechanism. More...
 
class  tl_pools
 Thread local memory chunk pools. More...
 
class  topology
 Describes the topology of the processes of a gang. More...
 
struct  transport_qualifier
 Tags T with movable, copyable, or leaves it T. More...
 
class  try_rmi_request
 RMI request that will not execute if the distributed object has been destroyed and that discards the return value. More...
 
class  tunnel_aggregator
 RMI request aggregator for a single destination location. More...
 
struct  uint_rng
 Returns a suitable random number generator for the given unsigned integral type size. More...
 
class  value_handle
 Handle for receiving one result. More...
 
class  values_handle
 Handle for receiving multiple results. More...
 
struct  write_lock_t
 Tag type for write lock ownership. More...
 

Typedefs

typedef centralized_fuzzy_barrier fuzzy_barrier
 
typedef std::uint32_t location_id
 Location id type.
 
typedef std::uint32_t gang_id
 Gang id type.
 
typedef std::uint16_t nesting_level
 RMI nesting level type.
 
typedef std::uint8_t magic_id
 Magic number that disambiguates between different deeply-nested RMIs.
 
typedef std::uint32_t internal_affinity_tag
 Raw affinity tag type.
 
typedef std::uintptr_t object_id
 Registered object id type. More...
 
typedef object_id collective_id
 Collective operation id type.
 
using message_ptr = std::unique_ptr< message, message_delete >
 message unique pointer. More...
 
using message_hook_type = boost::intrusive::member_hook< message, message::slist_hook_type, &message::slist_hook >
 Intrusive message list hook. More...
 
using message_raw_ptr_slist = typename boost::intrusive::make_slist< message, message_hook_type, boost::intrusive::cache_last< true >, boost::intrusive::constant_time_size< false > >::type
 Intrusive message list for message pointers. More...
 
template<typename T , typename R >
using arg_storage_t = typename make_arg_storage< T, R >::type
 Argument storage type. More...
 
template<typename F , typename... T>
using arguments_t = typename make_arguments< F, T... >::type
 A tuple of arg_storage_t to store the objects in list T.
 
template<typename T , typename BinaryOperation >
using binary_operation_result_t = decltype(std::declval< BinaryOperation >()(std::declval< T >(), std::declval< T >()))
 Returns the result of binary operation BinaryOperation when passed T.
 
using packed_handle_type = packed_handle_epoch
 Default handle type for requests.
 
template<std::size_t Len>
using aligned_storage_t = typename std::aligned_storage< Len, STAPL_RUNTIME_DEFAULT_ALIGNMENT >::type
 Provides the member typedef type, which is a POD type suitable for use as uninitialized storage for any object whose size is at most Len and whose alignment requirement is a divisor of STAPL_RUNTIME_DEFAULT_ALIGNMENT.
 
using list_hook_type = boost::intrusive::list_base_hook< boost::intrusive::link_mode< boost::intrusive::auto_unlink > >
 Intrusive list hook.
 
using set_hook_type = boost::intrusive::set_base_hook< boost::intrusive::link_mode< boost::intrusive::auto_unlink > >
 Intrusive set hook.
 

Enumerations

enum  polling_policy_t { NO_THREAD = 0x0, SINGLE_THREAD, FIRST_THREAD, MASTER_THREAD }
 Communicator polling policy. More...
 

Functions

template<typename Handle >
context::epoch_type find_target_epoch (context const &ctx, Handle const &h) noexcept
 Returns the epoch that a request from context ctx on handle h should execute in. More...
 
template<typename Handle >
gang_mdfind_target_gang_md (context &ctx, Handle const &h) noexcept
 Returns if possible the gang metadata associated with h, otherwise nullptr. More...
 
unsigned int get_processes_per_node (MPI_Comm comm)
 Returns the number of processes per node, based on how many processes are co-scheduled with process 0. More...
 
std::ostream & operator<< (std::ostream &, context const &)
 
constexpr bool operator== (context_id const &x, context_id const &y) noexcept
 
constexpr bool operator!= (context_id const &x, context_id const &y) noexcept
 
bool operator< (context_id const &x, context_id const &y) noexcept
 
void assert_fail (const char *s, const char *file, unsigned int line, const char *function)
 
void assert_fail (const char *s, const char *function)
 
void warning (const char *s, const char *function)
 
int get_debug_level (void) noexcept
 Returns the debug level of the runtime.
 
executor_baseget_executor (const gang_id gid)
 Returns the executor associated with the location of gang with id gid from the stack. More...
 
std::ostream & operator<< (std::ostream &os, full_location const &l)
 
std::ostream & operator<< (std::ostream &, gang_description const &)
 
constexpr bool operator!= (gang_md const &x, gang_md const &y) noexcept
 
TauGroup_t const & get_tau_group (void)
 Returns a TAU group for the runtime. More...
 
constexpr bool operator!= (location_md const &x, location_md const &y) noexcept
 
message_ptr make_message_ptr (message *const m)
 Returns a message_ptr from m. More...
 
template<typename ProcessRange , typename Callback , typename Function >
void call_construct_all_impl (ProcessRange &&pids, Callback &&c, const gang_md::id gid, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Calls construct_all_impl() on processes pids. More...
 
template<typename ProcessRange , typename Callback , typename T , typename Function >
void call_construct_range_impl (ProcessRange &&pids, Callback &&c, const gang_md::id gid, location_range_wrapper< T > const &r, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Calls construct_range_impl() on processes pids. More...
 
template<typename Callback , typename Function >
void construct_all_impl (Callback &&c, gang_md &g, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Creates a distributed object through f on all locations of gang g. More...
 
template<typename Callback , typename T , typename Function >
void construct_range_impl (Callback &&c, gang_md &g, location_range_wrapper< T > const &r, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Creates a distributed object through f on the subset locs of the locations of the gang associated with g. More...
 
template<typename Callback , typename T , typename Function >
void fwd_construct_range_impl (Callback &&c, gang_md &g, location_range_wrapper< T > const &r, const context::epoch_type e, Function &&f)
 Target for forwarding the request to construct_range_impl(). More...
 
template<typename T , typename... Args>
auto call_constructor (Args &&... args) -> decltype(std::bind(create_object< T >
 Creates a function object used to construct an instance T with args.
 
template<typename Callback , typename Function >
void construct_single (Callback &&c, gang_md::id gid, gang_md *g, const location_md::id lid, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new single location gang over location lid of gang g. More...
 
template<typename Callback , typename Function >
void construct_neighbors (Callback &&c, gang_md &g, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over all the locations of the gang associated with ctx that are on shared memory. More...
 
template<typename Callback , typename Function >
void construct_all (Callback &&c, const gang_md::id gid, gang_md *g, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over all locations of the gang of h. More...
 
template<typename Callback , typename T , typename Function >
void construct_range (Callback &&c, gang_md::id gid, gang_md *g, location_range_wrapper< T > const &r, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over the range r of the locations of the gang associated with g. More...
 
template<typename F , typename Range , typename... T>
void rpc (F &&f, Range &&pids, T &&... t)
 Remote Procedure Call (RPC) to process primitive. More...
 
template<typename Tuple , std::size_t... I, typename... T>
std::size_t dynamic_size (index_sequence< I... >, T &&... t) noexcept
 Returns the dynamic size required for storing the objects t... in a arguments_t.
 
template<typename F , typename Tuple , std::size_t... I>
auto invoke (F &&f, Tuple &args, void *const base, index_sequence< I... >) -> decltype(std::forward< F >(f)(std::get< I >(args).get(base)...))
 Calls f with the stored objects in args passed as arguments. More...
 
template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto invoke (MemFun const &pmf, Base &ref, Tuple &args, void *const base, index_sequence< I... >) -> decltype((ref.*pmf)(std::get< I >(args).get(base)...))
 Calls the member function pmf on ref with the stored objects in args passed as arguments. More...
 
template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto invoke (MemFun const &pmf, Base &ref, Tuple &args, void *const base, std::size_t &size, index_sequence< I... >) -> decltype((ref.*pmf)(std::get< I >(args).get(base, size)...))
 Calls the member function pmf on ref with the stored objects in args passed as arguments. More...
 
template<typename Tuple , std::size_t... I>
void cleanup (Tuple &, index_sequence< I... >)
 Releases any resources associated with the stored objects if invoke() was not called. More...
 
header::epoch_type get_message_epoch (message const &m) noexcept
 Returns the epoch m was sent from.
 
std::tuple< context_id, header::epoch_type, process_idget_message_info (message const &m, const location_id lid) noexcept
 Returns the context id, the epoch and the process id m was sent from as a std::tuple. More...
 
template<typename T , typename Handle >
T & retrieve_object (Handle &&h, location_md &l) noexcept
 Returns a reference to the object that h refers to. More...
 
template<typename T , typename Handle >
T * try_retrieve_object (Handle &&h, location_md *const l) noexcept
 Attempts to return a pointer to the object that h refers to. More...
 
template<typename T >
auto define_type_cast (T const &t) noexcept -> decltype(define_type_provider< T >::apply(const_cast< T &>(t)))
 
template<typename T >
auto define_type_cast (T volatile &t) noexcept -> decltype(define_type_provider< T >::apply(const_cast< T &>(t)))
 
template<typename T >
auto define_type_cast (T const volatile &t) noexcept -> decltype(define_type_provider< T >::apply(const_cast< T &>(t)))
 
void rmi_fence (context &)
 Ensures that all outstanding RMI requests have been completed. More...
 
void rmi_fence (context &, std::function< bool(void)> f)
 Ensures that all outstanding RMI requests have been completed and the return value of f is true. More...
 
c_string demangle (const char *)
 Returns a demangled version of the given mangled name.
 
c_string demangle (c_string const &)
 Returns a demangled version of the given mangled name.
 
int getpid (void) noexcept
 Returns the process id of the calling process.
 
std::size_t get_total_physical_memory (void) noexcept
 Returns the total amount of physical memory in bytes.
 
std::size_t get_used_physical_memory (void) noexcept
 Returns the amount of physical memory that is being used in bytes.
 
std::size_t get_available_physical_memory (void) noexcept
 Returns the amount of physical memory available in bytes.
 
std::size_t get_physical_memory_load (void) noexcept
 Returns the percentage of physical memory that is being used (0-100).
 
std::size_t get_num_hardware_threads (void) noexcept
 Returns the number of hardware threads on the system.
 
constexpr std::size_t aligned_size (const std::size_t n, const std::size_t alignment=STAPL_RUNTIME_DEFAULT_ALIGNMENT) noexcept
 Returns n adjusted with extra padding bytes to satisfy alignment of alignment.
 
constexpr std::false_type define_type_exists (...)
 Returns std::false_type if T::define_type(stapl::typer&) does not exist or is not accessible.
 
template<typename T >
constexpr std::true_type define_type_exists (T *t, decltype(runtime::define_type_cast(*t).define_type(std::declval< typer &>())) *=nullptr)
 Returns std::true_type if T::define_type(stapl::typer&) exists.
 
template<typename T , typename U >
T & no_access_check_cast (U &u) noexcept
 Cast function to break access checking.
 
template<typename T , typename U >
T const & no_access_check_cast (U const &u) noexcept
 Cast function to break access checking. More...
 
template<typename T >
T * p_object_ptr_cast (void *p) noexcept
 Casts the void pointer to T, where T is a distributed object.
 
template<typename R , typename Tuple , typename F >
polymorphic_apply (F &&f, const type_id tid)
 Scans the tuple of types Tuple and calls f() for the type that matches the type id tid. More...
 
template<typename Range , typename T >
auto find_index (Range const &r, T const &v) noexcept -> typename std::iterator_traits< decltype(std::begin(r))>::difference_type
 Finds index of the given element in a range. More...
 
template<typename Range >
bool all_unique (Range const &r)
 Returns true if the range has unique elements, otherwise returns false.
 
template<typename UIntType >
UIntType integral_ceil_log2 (UIntType i) noexcept
 Log2 algorithm for unsigned integral types. More...
 
template<typename UIntType , typename Size >
UIntType set_bits (UIntType dst, UIntType v, Size msb, Size lsb) noexcept
 Sets the [msb, lsb] bits of dst to value v and returns the new dst.
 
template<typename UIntType , typename Size >
UIntType read_bits (UIntType dst, Size msb, Size lsb) noexcept
 Reads the [msb, lsb] bits of dst.
 
template<typename T1 , typename T2 >
constexpr bool operator== (cache_line_aligned_allocator< T1 > const &, cache_line_aligned_allocator< T2 > const &) noexcept
 
template<typename T1 , typename T2 >
constexpr bool operator!= (cache_line_aligned_allocator< T1 > const &, cache_line_aligned_allocator< T2 > const &) noexcept
 
template<typename T >
std::vector< T > make_vector (std::vector< T > v)
 Returns a std::vector<T>. More...
 
template<typename T , typename InputIterator >
std::vector< T > make_vector (InputIterator first, InputIterator last)
 Returns a std::vector<T>. More...
 
template<typename T , typename U , typename = typename std::enable_if< !std::is_same< std::vector<T>, typename std::decay<U>::type >::value>::type>
std::vector< T > make_vector (U &&u)
 Returns a std::vector<T>. More...
 
template<typename T1 , typename T2 >
constexpr bool operator== (malloc_allocator< T1 > const &, malloc_allocator< T2 > const &) noexcept
 
template<typename T1 , typename T2 >
constexpr bool operator!= (malloc_allocator< T1 > const &, malloc_allocator< T2 > const &) noexcept
 
template<typename T , typename Deleter >
void intrusive_ptr_add_ref (ref_counted< T, Deleter > *p) noexcept
 Increases the reference count of the object pointed to by p. More...
 
template<typename T , typename Deleter >
void intrusive_ptr_release (ref_counted< T, Deleter > *p) noexcept
 Decreases the reference count of the object pointed to by p and and deletes it if the count has reached 0. More...
 
template<typename T , typename... Args>
boost::intrusive_ptr< T > make_ref_counted (Args &&... args)
 Constructs an object of type T that provides the interface and functionality of ref_counter using args as the parameter list for the constructor of T.
 
template<typename T >
std::vector< T > split_string_to_vector (std::string const &s, const char *delims)
 Splits the given std::string to a vector of T, based on the delimiters. More...
 
template<typename IntType , typename Size >
std::tuple< IntType, IntType, decltype(boost::irange(std::declval< IntType >), std::declval< IntType >)))> make_flat_tree (IntType myid, Size n)
 Returns the root, parent and children ids for the part of a flat tree that myid belongs to. More...
 
template<typename IntType , typename Size >
std::tuple< IntType, IntType, decltype(boost::irange(std::declval< IntType >), std::declval< IntType >)))> make_binary_tree (IntType myid, Size n)
 Returns the root, parent and children ids for the part of a binary tree that myid belongs to. More...
 
template<typename IntType , typename Size >
std::tuple< IntType, IntType, boost::iterator_range< binomial_tree_iterator< IntType, Size > > > make_binomial_tree (IntType myid, Size n)
 Returns the root, parent and children ids for the part of a binomial tree that myid belongs to. More...
 
template<typename... T>
void unused (T &&...)
 Function to remove warnings on unused variables.
 
void scheduling_point (context &)
 Yields the location to execute some requests.
 
template<typename Predicate >
bool yield_until (context &ctx, Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool yield_until (const no_context_t, Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool yield_until (Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool yield_if_not (context &ctx, Predicate &&pred)
 Yields if pred does not return true. More...
 
template<typename Predicate >
bool yield_if_not (const no_context_t, Predicate &&pred)
 Yields if pred does not return true. More...
 
template<typename Predicate >
bool yield_if_not (Predicate &&pred)
 Yields if pred does not return true. More...
 
void warning (const char *s, const char *file, unsigned int line, const char *function)
 
static void fork_impl (const unsigned int parent_tid, thread_info_t const &parent_info, const unsigned int end_level, const unsigned int af_offset, std::function< void(unsigned int)> f)
 Recursive forking for implementing concurrency::fork(). More...
 
void fence_md_update_sent (const gang_md::id init_gid, const gang_md::id gid, const nesting_level n, const unsigned int sent)
 Updates count for sent intergang requests. More...
 
void fence_md_update_processed (const gang_md::id init_gid, const gang_md::id gid, const nesting_level n, const unsigned int processed)
 Updates count for processed intergang requests. More...
 
void fence_md_update (const gang_md::id init_gid, const gang_md::id gid, const nesting_level n, const unsigned int sent, const unsigned int processed)
 Updates counts for sent and processed intergang requests. More...
 
void release_gang_md (const gang_id gid)
 Releases the gang_md object associated with gid.
 
static std::pair< std::size_t, std::size_t > allocation_sizes (std::size_t size) noexcept
 Returns the number of initial number of messages to allocate and the maximum number of messages allowed. More...
 
void free_memory (void)
 
static STAPL_RUNTIME_THREAD_LOCAL (tl_pools, pools) void free_memory(void)
 Thread-local pools.
 
std::ostream & operator<< (std::ostream &os, object_virtual_address const &h)
 
std::ostream & operator<< (std::ostream &os, rmi_handle_info const &h)
 
static void notify_created (runqueue::impl &rq)
 Notifies that rq has been created.
 
stackget_thread_stack (void)
 Returns the thread-local stack.
 
static void bcast_unordered (gang_md &, message_ptr, const process_id=invalid_process_id)
 
static void deferred_process (gang_md &g, message_ptr m)
 Adds a message that was deferred because the gang metadata was not available.
 
static void deferred_enqueue (const gang_md::id gid, message_ptr m)
 Defers the execution of the requests in m.
 
static STAPL_RUNTIME_THREAD_LOCAL (backoff_metadata<>, backoff) static void bcast_unordered(gang_md &g
 Thread-local backoff metadata. More...
 
 if (m->is_forwarded()||pids.empty()||(pids.size()==1 &&pids[0]==id))
 
 if (id!=invalid_process_id &&id!=topo.root_id())
 
static void bcast_unordered_init (gang_md &g, message_ptr m)
 Initializes a broadcast of m to all the locations of g.
 
static void runqueue_add (message_ptr m)
 Adds m to its destination runqueue.
 
static void process_incoming (const bool can_block)
 Process incoming messages.
 
template<typename Function >
void rmi_fence_impl (context &ctx, Function &&f)
 RMI fence implementation. More...
 

Variables

constexpr read_lock_t read_lock = { }
 Tag for read lock ownership.
 
constexpr write_lock_t write_lock = { }
 Tag for write lock ownership.
 
constexpr gang_id invalid_gang_id = std::numeric_limits<gang_id>::max()
 Invalid gang id.
 
constexpr object_id invalid_object_id = std::numeric_limits<object_id>::max()
 Invalid object_id.
 
static struct stapl::runtime::heap_tracker_init hpi
 
constexpr unsigned int boost_serialization_flags
 Flags required for the boost::archive objects. More...
 
constexpr deferred_t deferred = { }
 Tag to create gang_md objects with deferred id.
 
constexpr no_context_t no_context = { }
 Tag to skip any operations related to a context.
 
constexpr no_implicit_flush_t no_implicit_flush = { }
 Tag to mark that a flush is not implicit.
 
static std::unordered_map< collective::id, collective, boost::hash< collective::id > > collective_registry
 collective object registry.
 
static std::mutex collective_registry_mtx
 collective object registry mutex.
 
static mpi_communicator mpi_comm
 
static std::thread::id master_thread_id
 Master thread id.
 
static std::vector< unsigned int > hierarchy
 Processing element hierarchy.
 
static std::vector< unsigned int >::size_type max_num_levels = 0
 Number of available levels.
 
static unsigned int max_num_threads = 0
 Maximum number of threads.
 
static unsigned int process_affinity_width = 0
 Bits reserved for process affinity.
 
static std::vector< unsigned int > affinity_width
 Bits reserved for each hierarchy level.
 
static hierarchical_mutex process_mutex
 Master mutex.
 
static std::atomic< gang_md * > global_gang_md {nullptr}
 Global gang metadata (gang with id 0)
 
static block_registry< gang_md::id, gang_md * > registry
 Gang metadata registry.
 
static std::unordered_map< gang_md::id, fence_md * > fence_md_registry
 Fence metadata registry.
 
static std::mutex fence_md_registry_mtx
 Fence metadata registry mutex.
 
const auto sizeof_location_md
 
const std::size_t sizeof_message = sizeof(aligned_storage_t<sizeof(message)>)
 Aligned sizeof message.
 
static std::size_t default_msg_capacity = 0
 Default message capacity.
 
static bool enable_msg_pool = true
 Pool allocation enable flag.
 
static unsigned int nppn = 0
 Number of processes per node.
 
static std::size_t min_num_msgs = 0
 Minimum number of messages in the pool.
 
static double max_mem_fraction = 0.0
 Maximum fraction of memory used for communication buffers.
 
static pool msg_pool
 Message pool.
 
static std::new_handler old_new_handler = nullptr
 std::new_handler before memory_allocator::initialize().
 
static bool count_allocs = false
 true if run-time statistics for pool allocations enabled.
 
static unsigned int aggregation_factor = 0
 Maximum number of RMI requests to aggregate before sending a message.
 
static bool initialized = false
 true if the runtime is initialized, otherwise false.
 
static int debug_level = 0
 Debug level.
 
static std::size_t executor_window_size = 0
 Executor window size.
 
static std::size_t executor_retire_chunk = 0
 Executor retire chunk.
 
static std::vector< unsigned int > hierarchy_widths
 All the available hierarchy level widths.
 
static bool consumed_1st_level = false
 true if the first level of parallelism is consumed
 
static static STAPL_RUNTIME_THREAD_LOCAL(stack, thread_stack) static gang_md unsigned int owner_nlocs = 0
 Thread local stack. More...
 
static std::mutex owner_mtx
 
static std::unordered_map< gang_md::id, message_slistdeferred_requests
 Deferred requests per gang id.
 
static std::mutex deferred_requests_mtx
 Deferred requests mutex.
 
static std::atomic< int > overloaded {0}
 Positive number if the process is overloaded.
 
static polling_policy_t polling_policy = FIRST_THREAD
 Polling policy.
 
static std::chrono::milliseconds backoff_max_wait
 Maximum backoff wait in milliseconds.
 
static std::chrono::milliseconds backoff_init_wait
 Initial backoff wait in milliseconds.
 
static message_ptr m
 
static message_ptr const process_id id
 
auto const & pids = topo.children()
 
 else
 

Detailed Description

STAPL Runtime System implementation classes and functions.

Function Documentation

◆ no_access_check_cast()

template<typename T , typename U >
T const& stapl::runtime::no_access_check_cast ( U const &  u)
noexcept

Cast function to break access checking.

◆ polymorphic_apply()

template<typename R , typename Tuple , typename F >
R stapl::runtime::polymorphic_apply ( F &&  f,
const type_id  tid 
)

Scans the tuple of types Tuple and calls f() for the type that matches the type id tid.

Template Parameters
RReturn type of f.

◆ allocation_sizes()

static std::pair<std::size_t, std::size_t> stapl::runtime::allocation_sizes ( std::size_t  size)
staticnoexcept

Returns the number of initial number of messages to allocate and the maximum number of messages allowed.

The calculation of the maximum number of messages allowed is based on a heuristic that uses the number of processes running on a node.

Variable Documentation

◆ sizeof_location_md

const auto stapl::runtime::sizeof_location_md
Initial value:
=
aligned_size(sizeof(location_md), runqueue::required_alignment())
constexpr std::size_t aligned_size(const std::size_t n, const std::size_t alignment=STAPL_RUNTIME_DEFAULT_ALIGNMENT) noexcept
Returns n adjusted with extra padding bytes to satisfy alignment of alignment.
Definition: aligned_storage.hpp:60

◆ owner_nlocs

static STAPL_RUNTIME_THREAD_LOCAL (stack, thread_stack) static gang_md unsigned int stapl::runtime::owner_nlocs = 0
static

Thread local stack.

Arbitrates the restore() primitive.

◆ id

message_ptr const process_id stapl::runtime::id
Initial value:
{
auto const& topo = g.get_topology()

◆ else

stapl::runtime::else
Initial value:
{
m->mark_forwarded()