Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
ChemistryBalance Class Reference

Moves the integration of queued cells from ranks with more chemistry work than the mean to ranks with less, in every chemistry call. More...

#include <chemistry_balance.h>

Public Types

using Integrate = std::function< uint32_t(const ChemistryCells &, const Kokkos::View< uint32_t * > &, const Kokkos::View< float * > &, uint32_t)>
 

Public Member Functions

 ChemistryBalance (uint32_t n_species, double threshold)
 
uint32_t send (const ChemistryCells &cells, const Kokkos::View< uint32_t * > &queue, uint32_t n_queued)
 Plans the call (collective) and sends the states of the cells this rank gives away, the end of its queue [0, n_queued).
 
uint32_t receive (const ChemistryCells &cells, const Kokkos::View< uint32_t * > &queue, const Integrate &integrate)
 Receives the cells sent to this rank, integrates them with integrate (guest cells, their queue, its cost keys, count), returns their results and takes back the results of the cells this rank sent. Returns the failures among the received cells.
 

Detailed Description

Moves the integration of queued cells from ranks with more chemistry work than the mean to ranks with less, in every chemistry call.

A rank's work is the sum over its queued cells of the sub-steps each took in its last call (at least one). The ranks gather these sums; where the largest exceeds the mean by more than the threshold, each rank above the mean sends the cells at the end of its queue (the cheapest, when the queue is ordered by cost) to ranks below it, pairing them in rank order: every rank computes the same plan from the same numbers. A sent cell's inputs (conservatives, partial densities, temperature seed, last sub-step, last cost, multiplier of dt, and with a forcing its species rates and U + dt rate) travel as raw bits, the receiver integrates it with the same kernel as its own cells, and its partial densities (those of U + dt rate with a forcing), last sub-step and sub-steps come back. A cell's result does not depend on where it is integrated, so results stay bitwise independent of the balancing.

Member Typedef Documentation

◆ Integrate

using ChemistryBalance::Integrate = std::function<uint32_t(const ChemistryCells &, const Kokkos::View<uint32_t *> &, const Kokkos::View<float *> &, uint32_t)>

Constructor & Destructor Documentation

◆ ChemistryBalance()

ChemistryBalance::ChemistryBalance ( uint32_t  n_species,
double  threshold 
)

Member Function Documentation

◆ receive()

uint32_t ChemistryBalance::receive ( const ChemistryCells &  cells,
const Kokkos::View< uint32_t * > &  queue,
const Integrate &  integrate 
)

Receives the cells sent to this rank, integrates them with integrate (guest cells, their queue, its cost keys, count), returns their results and takes back the results of the cells this rank sent. Returns the failures among the received cells.

◆ send()

uint32_t ChemistryBalance::send ( const ChemistryCells &  cells,
const Kokkos::View< uint32_t * > &  queue,
uint32_t  n_queued 
)

Plans the call (collective) and sends the states of the cells this rank gives away, the end of its queue [0, n_queued).

Returns
The queued cells this rank integrates itself: [0, kept).

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