chombo-discharge
Public Member Functions | Protected Attributes | List of all members
Loads Class Reference

Class for holding computational loads. More...

#include <CD_Loads.H>

Public Member Functions

 Loads () noexcept
 Constructor. Assigns zero loads.
 
virtual ~Loads () noexcept
 Destructor (does nothing).
 
virtual std::map< int, Real > & getLoads () noexcept
 Get the computational loads. More...
 
virtual const std::map< int, Real > & getLoads () const noexcept
 Get the computational loads. More...
 
virtual void resetLoads () noexcept
 Reset loads. Sets all loads to 0.
 
virtual void assignLoads (const std::map< int, Real > &a_assignedLoads) noexcept
 Assign loads. More...
 
virtual void assignLoads (const std::vector< Real > &a_assignedLoads) noexcept
 Assign loads. In this version a_assignedLoads[0] is the load assigned to rank 0, and so on. More...
 
virtual void assignLoads (const Vector< Real > &a_assignedLoads) noexcept
 Assign loads. In this version a_assignedLoads[0] is the load assigned to rank 0, and so on. More...
 
virtual void incrementLoads (const std::map< int, Real > &a_increments) noexcept
 Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on. More...
 
virtual void incrementLoads (const std::vector< Real > &a_increments) noexcept
 Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on. More...
 
virtual void incrementLoads (const Vector< Real > &a_increments) noexcept
 Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on. More...
 
virtual void incrementLoad (const int a_rank, const Real a_increment) noexcept
 Increment load on rank. More...
 
virtual std::vector< std::pair< int, Real > > getSortedLoads () const noexcept
 Get sorted loads. More...
 

Protected Attributes

std::map< int, Real > m_loads
 Actual computational loads per MPI rank. More...
 

Detailed Description

Class for holding computational loads.

This is typically used in the context of load-balancing with AMR. The class is, however, standalone.

Member Function Documentation

◆ assignLoads() [1/3]

void Loads::assignLoads ( const std::map< int, Real > &  a_assignedLoads)
virtualnoexcept

Assign loads.

Parameters
[in]a_assignedLoadsLoads assigned to ranks.

◆ assignLoads() [2/3]

void Loads::assignLoads ( const std::vector< Real > &  a_assignedLoads)
virtualnoexcept

Assign loads. In this version a_assignedLoads[0] is the load assigned to rank 0, and so on.

Parameters
[in]a_assignedLoadsLoads assigned to ranks.

◆ assignLoads() [3/3]

void Loads::assignLoads ( const Vector< Real > &  a_assignedLoads)
virtualnoexcept

Assign loads. In this version a_assignedLoads[0] is the load assigned to rank 0, and so on.

Parameters
[in]a_assignedLoadsLoads assigned to ranks.

◆ getLoads() [1/2]

const std::map< int, Real > & Loads::getLoads ( ) const
virtualnoexcept

Get the computational loads.

Returns
m_loads

◆ getLoads() [2/2]

std::map< int, Real > & Loads::getLoads ( )
virtualnoexcept

Get the computational loads.

Returns
m_loads

◆ getSortedLoads()

std::vector< std::pair< int, Real > > Loads::getSortedLoads ( ) const
virtualnoexcept

Get sorted loads.

This routine sorts the computational loads from smallest to largest, and returns the result as a vector of ranks (and loads).

◆ incrementLoad()

void Loads::incrementLoad ( const int  a_rank,
const Real  a_increment 
)
virtualnoexcept

Increment load on rank.

Parameters
[in]a_rankMPI rank where load is incremented
[in]a_incrementLoad increment

◆ incrementLoads() [1/3]

void Loads::incrementLoads ( const std::map< int, Real > &  a_increments)
virtualnoexcept

Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on.

Parameters
[in]a_incrementsLoads to increment by.

◆ incrementLoads() [2/3]

void Loads::incrementLoads ( const std::vector< Real > &  a_increments)
virtualnoexcept

Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on.

Parameters
[in]a_incrementsLoads to increment by.

◆ incrementLoads() [3/3]

void Loads::incrementLoads ( const Vector< Real > &  a_increments)
virtualnoexcept

Increment loads. In this version a_increments[0] is the load increment for rank 0, and so on.

Parameters
[in]a_incrementsLoads to increment by.

Member Data Documentation

◆ m_loads

std::map<int, Real> Loads::m_loads
protected

Actual computational loads per MPI rank.

The key is the rank, and the value is the actual load


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