|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
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. | |
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.
| using ChemistryBalance::Integrate = std::function<uint32_t(const ChemistryCells &, const Kokkos::View<uint32_t *> &, const Kokkos::View<float *> &, uint32_t)> |
| 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.
| 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).