KASKADE 7 development version
Public Types | Related Functions | List of all members
Kaskade::NumaVector< Entry > Class Template Reference

A vector class tailored towards NUMA architectures. This vector distributes its entries in blocks of approximately equal size to the different nodes of NUMA machines in order to exploit the larger accumulated memory bandwidth for fast vector operations. This is most beneficial for large vectors exceeding the cache of the CPUs. Modern processors (2015-01-01) have up to 6MB 3rd level cache, so this is intended for vectors of more than 50,000 doubles, say. More...

#include <numaMatrix.hh>

Detailed Description

template<class Entry>
class Kaskade::NumaVector< Entry >

A vector class tailored towards NUMA architectures. This vector distributes its entries in blocks of approximately equal size to the different nodes of NUMA machines in order to exploit the larger accumulated memory bandwidth for fast vector operations. This is most beneficial for large vectors exceeding the cache of the CPUs. Modern processors (2015-01-01) have up to 6MB 3rd level cache, so this is intended for vectors of more than 50,000 doubles, say.

Template Parameters
Entrythe type of vector entries (usually Dune::FieldVector<double,n>)

Definition at line 716 of file numaMatrix.hh.

Inheritance diagram for Kaskade::NumaVector< Entry >:

Public Types

typedef Dune::FieldTraits< Entry >::field_type field_type
 
typedef Dune::FieldTraits< field_type >::real_type real_type
 
typedef Base::size_type size_type
 
typedef Base::value_type value_type
 
typedef NumaDenseMatrixDetail::VectorIterator< Entry > iterator
 
typedef NumaDenseMatrixDetail::VectorIterator< Entry const > const_iterator
 

Public Member Functions

Construction, assignment, and shape changes.
 NumaVector ()
 Creates a 0 vector. More...
 
 NumaVector (NumaVector const &a)=default
 Copy constructor. More...
 
 NumaVector (NumaVector &&a)=default
 Move constructor. More...
 
 NumaVector (size_type r, value_type v=value_type())
 Creates an r vector with given entries. More...
 
NumaVectoroperator= (NumaVector const &a)=default
 Copy assignment. More...
 
void resize (size_type r)
 Resizes the vector to r entries, leaving the entries in an undefined state. More...
 
Entry access
iterator begin ()
 iterator to first entry. More...
 
iterator end ()
 iterator to one beyond last entry. More...
 
const_iterator begin () const
 const iterator to first row. More...
 
const_iterator end () const
 const iterator to one beyond last entry. More...
 
Entry & operator[] (size_type row)
 The subscript operator. More...
 
Entry const & operator[] (size_type row) const
 The const subscript operator. More...
 
Linear algebra opterations.

The computations are performed in parallel on the NUMA nodes.

Selfoperator*= (field_type const &a)
 \( y \leftarrow a y \) More...
 
Selfoperator/= (field_type const &a)
 \( y \leftarrow \frac{1}{a} y \) More...
 
Selfoperator+= (Self const &x)
 \( y \leftarrow y+x \) More...
 
Selfoperator-= (Self const &x)
 \( y \leftarrow y - x \) More...
 
Selfaxpy (field_type const &a, Self const &x)
 \( y \leftarrow ax + y \) More...
 
Norms and scalar product.

The computations are performed in parallel on the NUMA nodes.

real_type two_norm () const
 euclidean norm: sqrt(sum over squared euclidean norms of entries) More...
 
real_type two_norm2 () const
 euclidean norm squared: sum over squared euclidean norms of entries More...
 
real_type one_norm () const
 one-norm: sum over absolute values of entries More...
 
field_type dot (Self const &other) const
 

Related Functions

(Note that these are not member functions.)

template<class Entry >
std::ostream & operator<< (std::ostream &out, NumaVector< Entry > const &vec)
 

Member Typedef Documentation

◆ const_iterator

template<class Entry >
typedef NumaDenseMatrixDetail::VectorIterator<Entry const> Kaskade::NumaVector< Entry >::const_iterator

Definition at line 727 of file numaMatrix.hh.

◆ field_type

template<class Entry >
typedef Dune::FieldTraits<Entry>::field_type Kaskade::NumaVector< Entry >::field_type

Definition at line 722 of file numaMatrix.hh.

◆ iterator

template<class Entry >
typedef NumaDenseMatrixDetail::VectorIterator<Entry> Kaskade::NumaVector< Entry >::iterator

Definition at line 726 of file numaMatrix.hh.

◆ real_type

template<class Entry >
typedef Dune::FieldTraits<field_type>::real_type Kaskade::NumaVector< Entry >::real_type

Definition at line 723 of file numaMatrix.hh.

◆ size_type

template<class Entry >
typedef Base::size_type Kaskade::NumaVector< Entry >::size_type

Definition at line 724 of file numaMatrix.hh.

◆ value_type

template<class Entry >
typedef Base::value_type Kaskade::NumaVector< Entry >::value_type

Definition at line 725 of file numaMatrix.hh.

Constructor & Destructor Documentation

◆ NumaVector() [1/4]

template<class Entry >
Kaskade::NumaVector< Entry >::NumaVector ( )
inline

Creates a 0 vector.

Definition at line 738 of file numaMatrix.hh.

◆ NumaVector() [2/4]

template<class Entry >
Kaskade::NumaVector< Entry >::NumaVector ( NumaVector< Entry > const &  a)
default

Copy constructor.

◆ NumaVector() [3/4]

template<class Entry >
Kaskade::NumaVector< Entry >::NumaVector ( NumaVector< Entry > &&  a)
default

Move constructor.

◆ NumaVector() [4/4]

template<class Entry >
Kaskade::NumaVector< Entry >::NumaVector ( size_type  r,
value_type  v = value_type() 
)
inline

Creates an r vector with given entries.

Definition at line 754 of file numaMatrix.hh.

Member Function Documentation

◆ axpy()

template<class Entry >
Self & Kaskade::NumaVector< Entry >::axpy ( field_type const &  a,
Self const &  x 
)
inline

\( y \leftarrow ax + y \)

Definition at line 856 of file numaMatrix.hh.

◆ begin() [1/2]

template<class Entry >
iterator Kaskade::NumaVector< Entry >::begin ( )
inline

iterator to first entry.

Definition at line 779 of file numaMatrix.hh.

◆ begin() [2/2]

template<class Entry >
const_iterator Kaskade::NumaVector< Entry >::begin ( ) const
inline

const iterator to first row.

Definition at line 789 of file numaMatrix.hh.

◆ dot()

template<class Entry >
field_type Kaskade::NumaVector< Entry >::dot ( Self const &  other) const
inline

Definition at line 895 of file numaMatrix.hh.

◆ end() [1/2]

template<class Entry >
iterator Kaskade::NumaVector< Entry >::end ( )
inline

iterator to one beyond last entry.

Definition at line 784 of file numaMatrix.hh.

◆ end() [2/2]

template<class Entry >
const_iterator Kaskade::NumaVector< Entry >::end ( ) const
inline

const iterator to one beyond last entry.

Definition at line 794 of file numaMatrix.hh.

◆ one_norm()

template<class Entry >
real_type Kaskade::NumaVector< Entry >::one_norm ( ) const
inline

one-norm: sum over absolute values of entries

Definition at line 887 of file numaMatrix.hh.

◆ operator*=()

template<class Entry >
Self & Kaskade::NumaVector< Entry >::operator*= ( field_type const &  a)
inline

\( y \leftarrow a y \)

Definition at line 817 of file numaMatrix.hh.

◆ operator+=()

template<class Entry >
Self & Kaskade::NumaVector< Entry >::operator+= ( Self const &  x)
inline

\( y \leftarrow y+x \)

Both vectors have to have the same size.

Definition at line 836 of file numaMatrix.hh.

◆ operator-=()

template<class Entry >
Self & Kaskade::NumaVector< Entry >::operator-= ( Self const &  x)
inline

\( y \leftarrow y - x \)

Both vectors have to have the same size.

Definition at line 847 of file numaMatrix.hh.

◆ operator/=()

template<class Entry >
Self & Kaskade::NumaVector< Entry >::operator/= ( field_type const &  a)
inline

\( y \leftarrow \frac{1}{a} y \)

Definition at line 826 of file numaMatrix.hh.

◆ operator=()

template<class Entry >
NumaVector & Kaskade::NumaVector< Entry >::operator= ( NumaVector< Entry > const &  a)
default

Copy assignment.

◆ operator[]() [1/2]

template<class Entry >
Entry & Kaskade::NumaVector< Entry >::operator[] ( size_type  row)
inline

The subscript operator.

Definition at line 799 of file numaMatrix.hh.

◆ operator[]() [2/2]

template<class Entry >
Entry const & Kaskade::NumaVector< Entry >::operator[] ( size_type  row) const
inline

The const subscript operator.

Definition at line 804 of file numaMatrix.hh.

◆ resize()

template<class Entry >
void Kaskade::NumaVector< Entry >::resize ( size_type  r)
inline

Resizes the vector to r entries, leaving the entries in an undefined state.

On resize, all iterators are invalidated. This method adheres to the Dune::BlockVector interface.

Definition at line 768 of file numaMatrix.hh.

◆ two_norm()

template<class Entry >
real_type Kaskade::NumaVector< Entry >::two_norm ( ) const
inline

euclidean norm: sqrt(sum over squared euclidean norms of entries)

Definition at line 874 of file numaMatrix.hh.

◆ two_norm2()

template<class Entry >
real_type Kaskade::NumaVector< Entry >::two_norm2 ( ) const
inline

euclidean norm squared: sum over squared euclidean norms of entries

Definition at line 879 of file numaMatrix.hh.

Referenced by Kaskade::NumaVector< Entry >::two_norm().

Friends And Related Function Documentation

◆ operator<<()

template<class Entry >
std::ostream & operator<< ( std::ostream &  out,
NumaVector< Entry > const &  vec 
)
related

Definition at line 904 of file numaMatrix.hh.


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