STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::view_index_iterator< View > Struct Template Reference

Iterator that traverses a disjoint partition of the indices of a view's elements. More...

Public Member Functions

 view_index_iterator (View const &view, std::size_t vs_len, bool b_replicated)
 Construct an iterator that will cover the elements of the view that are local. More...
 
bool at_end (void) const
 Returns whether all local subviews of the view have been processed in the current iteration.
 
std::size_t size () const
 Returns the number of local subviews of the view, or in the case of a multi-view algorithm the number of local subviews of the first view.
 
bool contains (size_t const &idx) const
 Returns whether the specified index is part of the partition handled by this iterator. More...
 
void reset (void)
 Reset the iterator to allow another traversal of the view elements by the factory. More...
 
id_t operator* ()
 
view_index_iteratoroperator++ ()
 
view_index_iterator operator++ (int)
 

Detailed Description

template<typename View>
struct stapl::view_index_iterator< View >

Iterator that traverses a disjoint partition of the indices of a view's elements.

Template Parameters
ViewThe type of the view whose partitioned domain is being abstracted by the iterator.

The class is used in factories to easily partition the work of specifying the tasks of a PARAGRAPH across all locations on which the PARAGRAPH is being executed.

Constructor & Destructor Documentation

◆ view_index_iterator()

template<typename View >
stapl::view_index_iterator< View >::view_index_iterator ( View const &  view,
std::size_t  vs_len,
bool  b_replicated 
)

Construct an iterator that will cover the elements of the view that are local.

Parameters
viewThe view whose elements will be partitioned by the iterator.
vs_lenThe number of local subviews.
b_replicatedIndicated if the view is a repeat_view.

m_vs_length can differ from m_size in cases where the factory is processing multiple views. In that case vs_len is the number of local subviews of the first view, which we use to drive the behavior of the factory.

Member Function Documentation

◆ contains()

template<typename View >
bool stapl::view_index_iterator< View >::contains ( size_t const &  idx) const

Returns whether the specified index is part of the partition handled by this iterator.

Note
There is a potential for performance issues if the view method called in access generates ARMI traffic.

◆ reset()

template<typename View >
void stapl::view_index_iterator< View >::reset ( void  )
virtual

Reset the iterator to allow another traversal of the view elements by the factory.

This is used in factories such as map_reduce_factory where multiple traversals of the view indices are required to generate the reduce trees.

Implements stapl::view_index_iterator_base.


The documentation for this struct was generated from the following file: