version GIT relicensing-7336-ga5359f9c0a 2026-12-03 09:40:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
PSCToolkitWrappers::Vector Class Reference

#include <deal.II/lac/psblas_vector.h>

Detailed Description

Implementation of a distributed parallel vector class based on PSBLAS (Parallel Sparse BLAS), which is the computational kernel of the PSCToolkit library.

This class stores a contiguous block of vector entries on each MPI process according to an IndexSet partitioning, and optionally maintains read-only ghost elements for entries owned by other processes. It supports the standard algebraic operations (addition, scaling, inner products, norms) as well as element-wise access. The interface is designed to be as close as possible to that of PETScWrappers::MPI::Vector.

A typical workflow for using this vector is as follows:

  1. Create the vector by providing an IndexSet that describes the parallel partitioning (i.e., which global degrees of freedom are owned by each MPI process) and the MPI communicator, either through the constructor or a call to reinit(). At this point the vector is in the Build state.
  2. Fill the vector by inserting or adding values through set(), add(), or the element access operators.
  3. Call compress() to transition the vector to the Assembled state, in which algebraic operations such as norms, inner products, and matrix-vector products become available.

Definition at line 69 of file psblas_vector.h.

Inheritance diagram for PSCToolkitWrappers::Vector:
[legend]

Classes

class  VectorReference
 

Public Types

using size_type = ::types::global_dof_index
 
using value_type = double
 

Public Member Functions

 Vector ()
 
 Vector (const Vector &)
 
 Vector (const IndexSet &local_partitioning, const MPI_Comm communicator)
 
 Vector (const IndexSet &local_partitioning, const IndexSet &ghost_indices, const MPI_Comm communicator)
 
 ~Vector ()
 
void reinit (const IndexSet &local_partitioning, const MPI_Comm communicator, const bool omit_zeroing_entries=false)
 
void reinit (const Vector &v, const bool omit_zeroing_entries=false)
 
void reinit (const IndexSet &local_partitioning, const IndexSet &ghost_indices, const MPI_Comm communicator)
 
Vector & operator= (const Vector &v)
 
size_type size () const override
 
virtual void extract_subvector_to (const ArrayView< const types::global_dof_index > &indices, const ArrayView< value_type > &elements) const override
 
void extract_subvector_to (const std::vector< size_type > &indices, std::vector< value_type > &values) const
 
template<typename ForwardIterator , typename OutputIterator >
void extract_subvector_to (ForwardIterator indices_begin, ForwardIterator indices_end, OutputIterator values_begin) const
 
size_type locally_owned_size () const
 
void set (const std::vector< size_type > &indices, const std::vector< value_type > &values)
 
void add (const std::vector< size_type > &indices, const std::vector< value_type > &values)
 
void add (const value_type s, const Vector &V)
 
void add (const value_type s)
 
void scale (const Vector &v)
 
value_type add_and_dot (const value_type a, const Vector &v, const Vector &W)
 
void sadd (const value_type s, const Vector &V)
 
void sadd (const value_type s, const value_type a, const Vector &V)
 
void equ (const value_type a, const Vector &v)
 
value_type operator() (const size_type index) const
 
VectorReference operator() (const size_type index)
 
value_type operator[] (const size_type index) const
 
VectorReference operator[] (const size_type index)
 
value_type operator* (const Vector &v) const
 
Vector & operator-= (const Vector &v)
 
Vector & operator+= (const Vector &v)
 
Vector & operator= (const value_type s)
 
const IndexSet & locally_owned_elements () const
 
const IndexSet & ghost_elements () const
 
bool has_ghost_elements () const
 
void update_ghost_values () const
 
void swap (Vector &v)
 
void compress (const VectorOperation::values operation)
 
value_type * begin ()
 
const value_type * begin () const
 
value_type * end ()
 
const value_type * end () const
 
MPI_Comm get_mpi_communicator () const
 
psb_c_descriptor * get_psblas_descriptor () const
 
psb_c_dvector * get_psblas_vector () const
 
void clear ()
 
Vector::value_type linfty_norm () const
 
Vector::value_type l1_norm () const
 
Vector::value_type l2_norm () const
 
Vector::value_type mean_value () const
 
bool all_zero () const
 
std::size_t memory_consumption () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
Querying the observer pointers an object has.
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 

Static Public Member Functions

static ::ExceptionBase & ExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBase & ExcNoSubscriber (std::string arg1, std::string arg2)
 

Private Member Functions

EnableObserverPointer functionality

Classes derived from EnableObserverPointer provide a facility to subscribe to this object. This is mostly used by the ObserverPointer class.

void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void check_no_subscribers () const noexcept
 

Private Attributes

psb_c_dvector * psblas_vector
 
psb_c_ctxt * psblas_context
 
std::shared_ptr< psb_c_descriptor > psblas_descriptor
 
MPI_Comm communicator
 
IndexSet owned_elements
 
IndexSet ghost_indices
 
bool ghosted
 
internal::State state
 
VectorOperation::values last_action
 
bool remote_entries_pending
 
std::atomic< unsigned int > counter
 
std::map< std::string, unsigned int > counter_map
 
std::vector< std::atomic< bool > * > validity_pointers
 
const std::type_info * object_info
 

Static Private Attributes

static std::mutex mutex
 

Friends

class SparseMatrix
 
class PreconditionAMG
 

Member Typedef Documentation

◆ size_type

Definition at line 244 of file psblas_vector.h.

◆ value_type

Definition at line 246 of file psblas_vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/4]

Vector< Number >::Vector ( )

Default constructor. Generates an empty (zero-size) vector.

Definition at line 29 of file psblas_vector.cc.

◆ Vector() [2/4]

Vector< Number >::Vector ( const Vector &  v)

Copy constructor. Sets the dimension to that of the given vector, and copies all elements.

Definition at line 41 of file psblas_vector.cc.

◆ Vector() [3/4]

Vector< Number >::Vector ( const IndexSet &  local_partitioning,
const MPI_Comm  communicator 
)
explicit

Construct a new parallel PSBLAS vector without ghost elements from an IndexSet.

Definition at line 65 of file psblas_vector.cc.

◆ Vector() [4/4]

Vector< Number >::Vector ( const IndexSet &  local_partitioning,
const IndexSet &  ghost_indices,
const MPI_Comm  communicator 
)

Construct a new parallel ghosted PSBLAS vector from IndexSets.

Note
This operation always creates a ghosted vector, which is considered read-only.
See also
vectors with ghost elements

Definition at line 76 of file psblas_vector.cc.

◆ ~Vector()

Vector< Number >::~Vector ( )

Destructor. Internally, its frees the PSBLAS vector and descriptor.

Definition at line 53 of file psblas_vector.cc.

Member Function Documentation

◆ reinit() [1/3]

void Vector< Number >::reinit ( const IndexSet &  local_partitioning,
const MPI_Comm  communicator,
const bool  omit_zeroing_entries = false 
)

Reinit as a vector without ghost elements. If omit_zeroing_entries is false, the vector is filled by zeros. Otherwise, the elements are left an unspecified state.

See also
vectors with ghost elements

Definition at line 90 of file psblas_vector.cc.

◆ reinit() [2/3]

void Vector< Number >::reinit ( const Vector &  v,
const bool  omit_zeroing_entries = false 
)

Change the dimension to that of the vector v, and also take over the partitioning into local sizes as well as the MPI communicator. The same applies as for the other reinit function.

The elements of v are not copied, i.e. this function is the same as calling reinit(v.size(), v.locally_owned_size(), omit_zeroing_entries).

Definition at line 311 of file psblas_vector.cc.

◆ reinit() [3/3]

void Vector< Number >::reinit ( const IndexSet &  local_partitioning,
const IndexSet &  ghost_indices,
const MPI_Comm  communicator 
)

Construct a new parallel ghosted PSBLAS vector from IndexSets.

Note that the ghost IndexSet may be empty and that any indices already contained in local are ignored during construction. The global indices in ghost are supplied as ghost indices so that they can be read locally.

Note
This operation always creates a ghosted vector, which is considered read-only.

Definition at line 175 of file psblas_vector.cc.

◆ operator=() [1/2]

Vector & Vector< Number >::operator= ( const Vector &  v)

Copy assignment. The behavior of this class is the same as that of PETScWrappers::MPI::Vector class.

Resize the present vector if necessary. Also take over the MPI communicator of v. The semantics of this operator are complex. If the two vectors have the same size, and if either the left or right hand side vector of the assignment (i.e., either the input vector on the right hand side, or the calling vector to the left of the assignment operator) currently has ghost elements, then the left hand side vector will also have ghost values and will consequently be a read-only vector (see also the glossary entry on the issue). Otherwise, the left hand vector will be a writable vector after this operation. These semantics facilitate having a vector with ghost elements on the left hand side of the assignment, and a vector without ghost elements on the right hand side, with the resulting left hand side vector having the correct values in both its locally owned and its ghost elements. On the other hand, if the left hand side vector does not have the correct size yet, or is perhaps an entirely uninitialized vector, then the assignment is simply a copy operation in the usual sense: In that case, if the right hand side has no ghost elements (i.e., is a completely distributed vector), then the left hand side will have no ghost elements either. And if the right hand side has ghost elements (and is consequently read-only), then the left hand side will have these same properties after the operation.

Definition at line 348 of file psblas_vector.cc.

◆ size()

Vector::size_type Vector< Number >::size ( ) const
inlineoverridevirtual

Return the global size of the vector, i.e. the sum of the local sizes over all MPI processes.

Implements ReadVector< double >.

Definition at line 807 of file psblas_vector.h.

◆ extract_subvector_to() [1/3]

void Vector< Number >::extract_subvector_to ( const ArrayView< const types::global_dof_index > &  indices,
const ArrayView< value_type > &  elements 
) const
inlineoverridevirtual

Extract a range of elements all at once.

Implements ReadVector< double >.

Definition at line 871 of file psblas_vector.h.

◆ extract_subvector_to() [2/3]

void Vector< Number >::extract_subvector_to ( const std::vector< size_type > &  indices,
std::vector< value_type > &  values 
) const
inline

Instead of getting individual elements of a vector via operator(), this function allows getting a whole set of elements at once. The indices of the elements to be read are stated in the first argument, the corresponding values are returned in the second.

If the current vector is called v, then this function is the equivalent to the code

for (unsigned int i=0; i<indices.size(); ++i)
values[i] = v[indices[i]];
Precondition
The sizes of the indices and values arrays must be identical.

Definition at line 882 of file psblas_vector.h.

◆ extract_subvector_to() [3/3]

template<typename ForwardIterator , typename OutputIterator >
void Vector< ForwardIterator, OutputIterator >::extract_subvector_to ( ForwardIterator  indices_begin,
ForwardIterator  indices_end,
OutputIterator  values_begin 
) const
inline

Instead of getting individual elements of a vector via operator(), this function allows getting a whole set of elements at once. In contrast to the previous function, this function obtains the indices of the elements by dereferencing all elements of the iterator range provided by the first two arguments, and puts the vector values into memory locations obtained by dereferencing a range of iterators starting at the location pointed to by the third argument.

If the current vector is called v, then this function is the equivalent to the code

ForwardIterator indices_p = indices_begin;
OutputIterator values_p = values_begin;
while (indices_p != indices_end)
{
*values_p = v[*indices_p];
++indices_p;
++values_p;
}
Precondition
It must be possible to write into as many memory locations starting at values_begin as there are iterators between indices_begin and indices_end.

Definition at line 893 of file psblas_vector.h.

◆ locally_owned_size()

Vector::size_type Vector< Number >::locally_owned_size ( ) const

Return the local dimension of the vector, i.e. the number of elements stored on the present MPI process. For sequential vectors, this number is the same as size(), but for parallel vectors it may be smaller.

To figure out which elements exactly are stored locally, use locally_owned_elements().

Definition at line 531 of file psblas_vector.cc.

◆ set()

void Vector< Number >::set ( const std::vector< size_type > &  indices,
const std::vector< value_type > &  values 
)

A collective set operation: instead of setting individual elements of a vector, this function allows to set a whole set of elements at once. The indices of the elements to be set are stated in the first argument, the corresponding values in the second.

Definition at line 580 of file psblas_vector.cc.

◆ add() [1/3]

void Vector< Number >::add ( const std::vector< size_type > &  indices,
const std::vector< value_type > &  values 
)

A collective add operation: This function adds a whole set of values stored in values to the vector components specified by indices.

Definition at line 602 of file psblas_vector.cc.

◆ add() [2/3]

void Vector< Number >::add ( const value_type  s,
const Vector &  V 
)

Addition of a multiple of a vector, i.e. *this += s*V.

Definition at line 644 of file psblas_vector.cc.

◆ add() [3/3]

void Vector< Number >::add ( const value_type  s)

Addition of s to all components.

Definition at line 659 of file psblas_vector.cc.

◆ scale()

void Vector< Number >::scale ( const Vector &  v)

Scale each element of this vector by the corresponding element in the argument. This function is mostly meant to simulate multiplication (and immediate re-assignment) by a diagonal scaling matrix.

Definition at line 700 of file psblas_vector.cc.

◆ add_and_dot()

Vector::value_type Vector< Number >::add_and_dot ( const value_type  a,
const Vector &  v,
const Vector &  W 
)

Performs a combined operation of a vector addition and a subsequent inner product, returning the value of the inner product. In other words, the result of this function is the same as if the user called

this->add(a, V);
return_value = *this * W;
void add(const std::vector< size_type > &indices, const std::vector< value_type > &values)

Definition at line 718 of file psblas_vector.cc.

◆ sadd() [1/2]

void Vector< Number >::sadd ( const value_type  s,
const Vector &  V 
)

Definition at line 675 of file psblas_vector.cc.

◆ sadd() [2/2]

void Vector< Number >::sadd ( const value_type  s,
const value_type  a,
const Vector &  V 
)

Definition at line 689 of file psblas_vector.cc.

◆ equ()

void Vector< Number >::equ ( const value_type  a,
const Vector &  v 
)

Definition at line 516 of file psblas_vector.cc.

◆ operator()() [1/2]

Vector::value_type Vector< Number >::operator() ( const size_type  index) const
inline

Provide read-only access to an element.

Definition at line 839 of file psblas_vector.h.

◆ operator()() [2/2]

Vector::VectorReference Vector< Number >::operator() ( const size_type  index)
inline

Provide read-write access to an element of the vector.

Definition at line 847 of file psblas_vector.h.

◆ operator[]() [1/2]

Vector::value_type Vector< Number >::operator[] ( const size_type  index) const
inline

Provide read-only access to an element.

Definition at line 855 of file psblas_vector.h.

◆ operator[]() [2/2]

Vector::VectorReference Vector< Number >::operator[] ( const size_type  index)
inline

Provide read-write access to an element of the vector.

Definition at line 863 of file psblas_vector.h.

◆ operator*()

Vector::value_type Vector< Number >::operator* ( const Vector &  v) const

Dot product of the vector with another vector.

Definition at line 539 of file psblas_vector.cc.

◆ operator-=()

Vector & Vector< Number >::operator-= ( const Vector &  v)

Subtract the given vector from the present one.

Definition at line 565 of file psblas_vector.cc.

◆ operator+=()

Vector & Vector< Number >::operator+= ( const Vector &  v)

Add the given vector from the present one.

Definition at line 550 of file psblas_vector.cc.

◆ operator=() [2/2]

Vector & Vector< Number >::operator= ( const value_type  s)

Set all components of the vector to the given number s. Simply pass this down to the individual block objects, but we still need to declare this function to make the example given in the discussion about making the constructor explicit work.

Since the semantics of assigning a scalar to a vector are not immediately clear, this operator should really only be used if you want to set the entire vector to zero. This allows the intuitive notation v=0.

Definition at line 392 of file psblas_vector.cc.

◆ locally_owned_elements()

const IndexSet & Vector< Number >::locally_owned_elements ( ) const
inline

Return an index set that describes which elements of this vector are owned by the current processor. Note that this index set does not include elements this vector may store locally as ghost elements but that are in fact owned by another processor. As a consequence, the index sets returned on different processors if this is a distributed vector will form disjoint sets that add up to the complete index set. Obviously, if a vector is created on only one processor, then the result would satisfy

vec.locally_owned_elements() == complete_index_set (vec.size())
IndexSet complete_index_set(const IndexSet::size_type N)
Definition index_set.h:1187

Definition at line 815 of file psblas_vector.h.

◆ ghost_elements()

const IndexSet & Vector< Number >::ghost_elements ( ) const
inline

Return the IndexSet of ghost elements.

Definition at line 823 of file psblas_vector.h.

◆ has_ghost_elements()

bool Vector< Number >::has_ghost_elements ( ) const
inline

Return if the vector contains ghost elements.

See also
vectors with ghost elements

Definition at line 831 of file psblas_vector.h.

◆ update_ghost_values()

void Vector< Number >::update_ghost_values ( ) const

Update ghosted elements.

Definition at line 839 of file psblas_vector.cc.

◆ swap()

void Vector< Number >::swap ( Vector &  v)

Swap the contents of this vector and the other vector v. This function only swaps the pointers to the data of the two vectors and therefore does not need to allocate temporary storage and move data around.

This function is analogous to the swap function of all C++ standard containers.

Definition at line 731 of file psblas_vector.cc.

◆ compress()

void Vector< Number >::compress ( const VectorOperation::values  operation)

Compress the underlying representation of the PSBLAS object, i.e. flush the buffers of the vector object if it has any. This function is necessary after writing into a vector element-by-element and before anything else can be done on it.

Definition at line 751 of file psblas_vector.cc.

◆ begin() [1/2]

PSCToolkitWrappers::Vector::value_type * Vector< Number >::begin ( )
inline

Return an iterator to the start of the locally owned elements of the vector.

Definition at line 775 of file psblas_vector.h.

◆ begin() [2/2]

const PSCToolkitWrappers::Vector::value_type * Vector< Number >::begin ( ) const
inline

Return a constant iterator to the start of the locally owned elements of the vector.

Definition at line 783 of file psblas_vector.h.

◆ end() [1/2]

PSCToolkitWrappers::Vector::value_type * Vector< Number >::end ( )
inline

Return an iterator to the element past the end of the locally owned elements of the vector.

Definition at line 791 of file psblas_vector.h.

◆ end() [2/2]

const PSCToolkitWrappers::Vector::value_type * Vector< Number >::end ( ) const
inline

Return a constant iterator to the element past the end of the locally owned elements of the vector.

Definition at line 799 of file psblas_vector.h.

◆ get_mpi_communicator()

MPI_Comm Vector< Number >::get_mpi_communicator ( ) const

Definition at line 404 of file psblas_vector.cc.

◆ get_psblas_descriptor()

psb_c_descriptor * Vector< Number >::get_psblas_descriptor ( ) const

Get the underlying PSBLAS descriptor. Use it only when you know what you are doing.

Definition at line 412 of file psblas_vector.cc.

◆ get_psblas_vector()

psb_c_dvector * Vector< Number >::get_psblas_vector ( ) const

Get a pointer to the underlying PSBLAS vector. Use it only when you know what you are doing.

Definition at line 420 of file psblas_vector.cc.

◆ clear()

void Vector< Number >::clear ( )

Release all memory and return to a state just like after having called the default constructor.

Definition at line 428 of file psblas_vector.cc.

◆ linfty_norm()

Vector::value_type Vector< Number >::linfty_norm ( ) const

\(l_\infty\)-norm of the vector. Return the value of the vector element with the maximum absolute value.

Definition at line 450 of file psblas_vector.cc.

◆ l1_norm()

Vector::value_type Vector< Number >::l1_norm ( ) const

\(l_1\)-norm of the vector. The sum of the absolute values.

Definition at line 460 of file psblas_vector.cc.

◆ l2_norm()

Vector::value_type Vector< Number >::l2_norm ( ) const

\(l_2\)-norm of the vector. The square root of the sum of the squares of the elements.

Definition at line 470 of file psblas_vector.cc.

◆ mean_value()

Vector::value_type Vector< Number >::mean_value ( ) const

Compute the mean value of the vector.

Definition at line 480 of file psblas_vector.cc.

◆ all_zero()

bool Vector< Number >::all_zero ( ) const

Return whether the vector contains only elements with value zero. This is a collective operation. This function is expensive, because potentially all elements have to be checked.

Definition at line 495 of file psblas_vector.cc.

◆ memory_consumption()

std::size_t Vector< Number >::memory_consumption ( ) const

Estimate for the memory consumption (not implemented for this class).

Definition at line 850 of file psblas_vector.cc.

◆ n_subscriptions()

unsigned int EnableObserverPointer::n_subscriptions ( ) const
inlineinherited

Return the present number of subscriptions to this object. This allows to use this class for reference counted lifetime determination where the last one to unsubscribe also deletes the object.

Definition at line 318 of file enable_observer_pointer.h.

◆ list_subscribers() [1/2]

template<typename StreamType >
void EnableObserverPointer::list_subscribers ( StreamType &  stream) const
inlineinherited

List the subscribers to the input stream.

Definition at line 335 of file enable_observer_pointer.h.

◆ list_subscribers() [2/2]

void EnableObserverPointer::list_subscribers ( ) const
inherited

List the subscribers to deallog.

Definition at line 200 of file enable_observer_pointer.cc.

◆ serialize()

template<class Archive >
void EnableObserverPointer::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineinherited

Read or write the data of this object to or from a stream for the purpose of serialization using the BOOST serialization library.

This function does not actually serialize any of the member variables of this class. The reason is that what this class stores is only who subscribes to this object, but who does so at the time of storing the contents of this object does not necessarily have anything to do with who subscribes to the object when it is restored. Consequently, we do not want to overwrite the subscribers at the time of restoring, and then there is no reason to write the subscribers out in the first place.

Definition at line 327 of file enable_observer_pointer.h.

◆ subscribe()

void EnableObserverPointer::subscribe ( std::atomic< bool > *const  validity,
const std::string &  identifier = "" 
) const
privateinherited

Subscribes a user of the object by storing the pointer validity. The subscriber may be identified by text supplied as identifier.

Definition at line 136 of file enable_observer_pointer.cc.

◆ unsubscribe()

void EnableObserverPointer::unsubscribe ( std::atomic< bool > *const  validity,
const std::string &  identifier = "" 
) const
privateinherited

Unsubscribes a user from the object.

Note
The identifier and the validity pointer must be the same as the one supplied to subscribe().

Definition at line 154 of file enable_observer_pointer.cc.

◆ check_no_subscribers()

void EnableObserverPointer::check_no_subscribers ( ) const
privatenoexceptinherited

Check that there are no objects subscribing to this object. If this check passes then it is safe to destroy the current object. It this check fails then this function will either abort or print an error message to deallog (by using the AssertNothrow mechanism), but will not throw an exception.

Note
Since this function is just a consistency check it does nothing in release mode.
If this function is called when there is an uncaught exception then, rather than aborting, this function prints an error message to the standard error stream and returns.

Definition at line 58 of file enable_observer_pointer.cc.

Friends And Related Symbol Documentation

◆ SparseMatrix

friend class SparseMatrix
friend

Typedef for sparse matrix type used

Typedef for the sparse matrix type used.

Definition at line 765 of file psblas_vector.h.

◆ PreconditionAMG

friend class PreconditionAMG
friend

Typedef for the AMG preconditioner type.

Definition at line 767 of file psblas_vector.h.

Member Data Documentation

◆ psblas_vector

psb_c_dvector* PSCToolkitWrappers::Vector::psblas_vector
private

Definition at line 713 of file psblas_vector.h.

◆ psblas_context

psb_c_ctxt* PSCToolkitWrappers::Vector::psblas_context
private

Definition at line 718 of file psblas_vector.h.

◆ psblas_descriptor

std::shared_ptr<psb_c_descriptor> PSCToolkitWrappers::Vector::psblas_descriptor
private

Definition at line 723 of file psblas_vector.h.

◆ communicator

MPI_Comm PSCToolkitWrappers::Vector::communicator
private

The MPI communicator over which the vector is distributed.

Definition at line 728 of file psblas_vector.h.

◆ owned_elements

IndexSet PSCToolkitWrappers::Vector::owned_elements
private

This IndexSet contains the global indices of the locally owned values.

Definition at line 733 of file psblas_vector.h.

◆ ghost_indices

IndexSet PSCToolkitWrappers::Vector::ghost_indices
private

This IndexSet contains the global indices of the ghost values.

Definition at line 738 of file psblas_vector.h.

◆ ghosted

bool PSCToolkitWrappers::Vector::ghosted
private

Denotes if this vector has ghost indices associated with it. This means that at least one of the processes in a parallel program has at least one ghost index.

Definition at line 745 of file psblas_vector.h.

◆ state

internal::State PSCToolkitWrappers::Vector::state
private

State of the descriptor associated with the vector. Its state can be either default, building or assembled).

Definition at line 751 of file psblas_vector.h.

◆ last_action

VectorOperation::values PSCToolkitWrappers::Vector::last_action
private

Member variable storing if the last operation done on the vector was a write or an add operation.

Definition at line 757 of file psblas_vector.h.

◆ remote_entries_pending

bool PSCToolkitWrappers::Vector::remote_entries_pending
private

Whether contributions to entries owned by other processes have been handed to PSBLAS and still need to be exchanged by compress().

Definition at line 763 of file psblas_vector.h.

◆ counter

std::atomic<unsigned int> EnableObserverPointer::counter
mutableprivateinherited

Store the number of objects which subscribed to this object. Initially, this number is zero, and upon destruction it shall be zero again (i.e. all objects which subscribed should have unsubscribed again).

The creator (and owner) of an object is counted in the map below if HE manages to supply identification.

We use the mutable keyword in order to allow subscription to constant objects also.

This counter may be read from and written to concurrently in multithreaded code: hence we use the std::atomic class template.

Definition at line 212 of file enable_observer_pointer.h.

◆ counter_map

std::map<std::string, unsigned int> EnableObserverPointer::counter_map
mutableprivateinherited

In this map, we count subscriptions for each different identification string supplied to subscribe().

Definition at line 218 of file enable_observer_pointer.h.

◆ validity_pointers

std::vector<std::atomic<bool> *> EnableObserverPointer::validity_pointers
mutableprivateinherited

In this vector, we store pointers to the validity bool in the ObserverPointer objects that subscribe to this class.

Definition at line 224 of file enable_observer_pointer.h.

◆ object_info

const std::type_info* EnableObserverPointer::object_info
mutableprivateinherited

Pointer to the typeinfo object of this object, from which we can later deduce the class name. Since this information on the derived class is neither available in the destructor, nor in the constructor, we obtain it in between and store it here.

Definition at line 232 of file enable_observer_pointer.h.

◆ mutex

std::mutex EnableObserverPointer::mutex
staticprivateinherited

A mutex used to ensure data consistency when accessing the mutable members of this class. This lock is used in the subscribe() and unsubscribe() functions, as well as in list_subscribers().

Definition at line 239 of file enable_observer_pointer.h.


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