STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Classes | Macros | Typedefs | Functions | Variables

Utility classes and variables. More...

+ Collaboration diagram for ARMI Utilities:

Classes

struct  stapl::affinity_tag
 Describes the affinity of a location. More...
 
class  stapl::exit_code
 Class to return exit codes from STAPL applications. More...
 
class  stapl::function< Signature >
 A general-purpose polymorphic function wrapper. More...
 
class  stapl::future< T >
 Provides a mechanism to access the result of asynchronous operations. More...
 
class  stapl::futures< T >
 Provides a mechanism to access the result of asynchronous operations. More...
 
class  stapl::immutable_range_wrapper< Iterator, T >
 Wraps a reference to a temporarily immutable range of objects. More...
 
class  stapl::immutable_reference_wrapper< T, bool >
 Wraps a reference to a temporarily immutable object. More...
 
class  stapl::immutable_shared< T, bool >
 Describes an immutable object. More...
 
class  stapl::lazy_reference_wrapper< T >
 std::reference_wrapper -like class for distributed objects. More...
 
class  stapl::location_range_wrapper< T >
 Range of location ids. More...
 
class  stapl::location_specific_storage< T >
 Supports global objects in the presence of locations. More...
 
class  stapl::main_wf
 Function object that is used with execute() to initiate a STAPL application. More...
 
class  stapl::pointer_wrapper< T, bool >
 std::reference_wrapper -like class for pointers to objects. More...
 
class  stapl::promise< R >
 Provides a means of setting a result asynchronously, which may be retrieved through an instance of future. More...
 
class  stapl::random_location_generator
 Random location id generator. More...
 
class  stapl::range_wrapper< Iterator, typename >
 Describes a range of const objects. More...
 
class  stapl::option
 Used to create a list of options. More...
 
class  stapl::pool_allocator< T, N >
 Pool backed allocator. More...
 
class  stapl::watchdog_timer
 Allows the creation of a watchdog timer that invokes the given function every interval milliseconds. More...
 

Macros

#define stapl_assert(E, M)
 Ensures the given input condition is true. More...
 
#define stapl_warning(E, M)
 Ensures the given input condition is true. More...
 

Typedefs

template<typename T >
using stapl::object_pointer_wrapper = pointer_wrapper< T, false >
 pointer_wrapper when it is known that T is not a distributed object.
 
template<typename T >
using stapl::p_object_pointer_wrapper = pointer_wrapper< T, true >
 pointer_wrapper when it is known that T is a distributed object.
 

Functions

template<typename T , typename = typename std::enable_if<!std::is_reference<T>::value>::type>
location_range_wrapper< typename std::decay< T >::type > stapl::location_range (T &&t)
 Returns a location_range_wrapper from t.
 
template<typename T >
location_range_wrapper< T const & > stapl::location_range (T &t)
 Returns a location_range_wrapper from t. More...
 
template<typename InputIterator >
immutable_range_wrapper< InputIterator > make_immutable_range (InputIterator first, InputIterator last) noexcept
 Creates a wrapper over the immutable range [first, last). More...
 
template<typename InputIterator , typename Size >
immutable_range_wrapper< InputIterator > make_immutable_range_n (InputIterator first, const Size count) noexcept
 Creates a wrapper over the immutable range [first, first + n). More...
 
template<typename T >
immutable_reference_wrapper< T > immutable_ref (T const &t)
 Creates an immutable reference to t. More...
 
template<typename T , typename... Args>
immutable_shared< T > make_immutable_shared (Args &&... args)
 Constructs an immutable object of type T. More...
 
template<typename T >
T * get_pointer (lazy_reference_wrapper< T > const &r)
 Returns a pointer to the distributed object referenced by r. More...
 
template<typename T >
std::conditional< is_p_object< T >::value, lazy_reference_wrapper< T >, std::reference_wrapper< T > >::type lazy_ref (T &t)
 Helper functions that creates an object of type lazy_reference_wrapper if T is a distributed object, otherwise an object of type std::reference_wrapper.
 
template<typename T >
std::conditional< is_p_object< T >::value, lazy_reference_wrapper< const T >, std::reference_wrapper< const T > >::type lazy_cref (T const &t)
 Helper function that creates an object of type lazy_reference_wrapper if T is a distributed object, otherwise an object of type std::reference_wrapper.
 
template<typename T >
T * get_pointer (pointer_wrapper< T > const &r)
 Returns a pointer to the object through pointer_wrapper. More...
 
template<typename T >
pointer_wrapper< T > pointer (T *const t)
 Helper functions that creates an object of type pointer_wrapper.
 
template<typename T >
pointer_wrapper< const T > cpointer (T *const t)
 Helper function that creates an object of type pointer_wrapper.
 
template<typename InputIterator >
range_wrapper< InputIterator > make_range (InputIterator first, InputIterator last) noexcept
 Creates a wrapper over the range [first, last). More...
 
template<typename InputIterator , typename Size >
range_wrapper< InputIterator > make_range_n (InputIterator first, const Size count) noexcept
 Creates a wrapper over the range [first, first + n). More...
 

Variables

constexpr affinity_tag stapl::invalid_affinity_tag
 Invalid affinity tag. More...
 

Detailed Description

Utility classes and variables.

Macro Definition Documentation

◆ stapl_assert

#define stapl_assert (   E,
 
)
Value:
do { \
if ( !std::uncaught_exception() && !(E) ) { \
std::fprintf(stderr, "STAPL ASSERTION: %s (file: %s, line: %d)\n", \
M, __FILE__, __LINE__); \
} \
} while (false)
void abort(std::string const &)
Displays the given std::string and aborts execution.
Definition: abort.cc:97

Ensures the given input condition is true.

If E is true, nothing happens, otherwise the error message M is printed and the program aborts.

◆ stapl_warning

#define stapl_warning (   E,
 
)
Value:
( (std::uncaught_exception() || (E)) ? \
(static_cast<void>(0)) : \
(std::fprintf(stderr, "STAPL WARNING: %s (file: %s, line: %d)\n", \
M, __FILE__, __LINE__)) )

Ensures the given input condition is true.

If E is true, nothing happens, otherwise the warning message M is printed.

Function Documentation

◆ location_range()

template<typename T >
location_range_wrapper<T const&> stapl::location_range ( T &  t)

Returns a location_range_wrapper from t.

Warning
It assumes that t will be alive when the location_range_wrapper is used.

◆ make_immutable_range()

template<typename InputIterator >
immutable_range_wrapper< InputIterator > make_immutable_range ( InputIterator  first,
InputIterator  last 
)
related

Creates a wrapper over the immutable range [first, last).

An immutable range of objects may be passed by reference during communication.

Warning
The sender has to guarantee that all callees have finished before deleting or mutating the object.
See also
make_range

◆ make_immutable_range_n()

template<typename InputIterator , typename Size >
immutable_range_wrapper< InputIterator > make_immutable_range_n ( InputIterator  first,
const Size  count 
)
related

Creates a wrapper over the immutable range [first, first + n).

An immutable range of objects may be passed by reference during communication.

Warning
The sender has to guarantee that all callees have finished before deleting or mutating the object.
See also
make_range_n

◆ immutable_ref()

template<typename T >
immutable_reference_wrapper< T > immutable_ref ( T const &  t)
related

Creates an immutable reference to t.

An immutable reference may pass the object by reference during shared memory communication, avoiding any potential copies.

Warning
The sender has to guarantee that all callees have finished before deleting or mutating the object.
See also
make_immutable_shared

◆ make_immutable_shared()

template<typename T , typename... Args>
immutable_shared< T > make_immutable_shared ( Args &&...  args)
related

Constructs an immutable object of type T.

Immutable objects may be passed by reference when communication happens in shared memory.

The object can never be mutated and it is deleted when the last immutable_shared is destroyed.

See also
immutable

◆ get_pointer() [1/2]

template<typename T >
T * get_pointer ( lazy_reference_wrapper< T > const &  r)
related

Returns a pointer to the distributed object referenced by r.

This function is required for interoperability with boost::bind().

◆ get_pointer() [2/2]

template<typename T >
T * get_pointer ( pointer_wrapper< T > const &  r)
related

Returns a pointer to the object through pointer_wrapper.

This function is required for interoperability with boost::bind().

◆ make_range()

template<typename InputIterator >
range_wrapper< InputIterator > make_range ( InputIterator  first,
InputIterator  last 
)
related

Creates a wrapper over the range [first, last).

Upon communication, a copy of the elements in the range is given to the callee.

See also
make_immutable_range

◆ make_range_n()

template<typename InputIterator , typename Size >
range_wrapper< InputIterator > make_range_n ( InputIterator  first,
const Size  count 
)
related

Creates a wrapper over the range [first, first + n).

Upon communication, a copy of the elements in the range is given to the callee.

See also
make_immutable_range_n

Variable Documentation

◆ invalid_affinity_tag

constexpr affinity_tag stapl::invalid_affinity_tag
Initial value:
=
{ std::numeric_limits<affinity_tag::tag_type>::max() }

Invalid affinity tag.