Namespaces | |
communication | |
internal | |
Typedefs | |
template<typename PhantomData_T > | |
using | DynamicLevelwiseCurveBalance = DynamicCurveBalance< PhantomData_T > |
template<typename PhantomData_T > | |
using | DynamicLevelwiseDiffusionBalance = DynamicDiffusionBalance< PhantomData_T > |
using | InfoCollection = std::map< BlockID, BlockInfo > |
using | InfoCollectionPair = std::pair< InfoCollection::key_type, InfoCollection::mapped_type > |
using | idx_t = uint_t |
using | workload_t = real_t |
using | memory_t = real_t |
Enumerations | |
enum | LocalCommunicationMode { START = 0, WAIT = 1, BUFFER = 2, NO_OPTIMIZATION = 3 } |
Functions | |
void | logDuringRefresh (BlockForest &forest, const PhantomBlockForest &) |
std::ostream & | operator<< (std::ostream &os, const BlockForest &forest) |
static void | pushBackNeighborhoodSectionBlockCenters (const AABB &blockAABB, const real_t x, const real_t y, const real_t z, std::vector< real_t > ¢ers) |
void | constructNeighborhoodSectionBlockCenters (uint_t sectionIndex, const AABB &blockAABB, std::vector< real_t > ¢ers) |
uint_t | getBlockNeighborhoodSectionIndex (const int x, const int y, const int z) |
uint_t | getBlockNeighborhoodSectionIndex (const uint_t x, const uint_t y, const uint_t z) |
uint_t | getBlockNeighborhoodSectionIndex (const stencil::Direction &d) |
uint_t | getBlockMaxNeighborhoodSectionSize (const uint_t sectionIndex) |
const std::array< uint_t, 6 > & | getFaceNeighborhoodSectionIndices () |
const std::array< uint_t, 12 > & | getEdgeNeighborhoodSectionIndices () |
const std::array< uint_t, 8 > & | getCornerNeighborhoodSectionIndices () |
shared_ptr< StructuredBlockForest > | createUniformBlockGridFromConfig (const shared_ptr< Config > &config, CellInterval *requestedDomainSize, const bool keepGlobalBlockInformation) |
Parses config block called 'DomainSetup' and creates a StructuredBlockForest. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGridFromConfig (const Config::BlockHandle &configBlock, CellInterval *requestedDomainSize, const bool keepGlobalBlockInformation) |
Parses config block and creates a StructuredBlockForest. More... | |
shared_ptr< BlockForest > | createBlockForest (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a block forest that represents a uniform block grid. More... | |
std::unique_ptr< SetupBlockForest > | createSetupBlockForest (const math::AABB &simulationDomain, Vector3< uint_t > blocks, const Vector3< bool > &isPeriodic, const uint_t numberOfProcesses, const uint_t initialRefinementLevel) |
shared_ptr< BlockForest > | createBlockForest (const math::AABB &simulationDomain, const Vector3< uint_t > &blocks, const Vector3< bool > &isPeriodic, const uint_t numberOfProcesses, const uint_t initialRefinementLevel, const bool keepGlobalBlockInformation) |
shared_ptr< BlockForest > | createBlockForest (const math::AABB &simulationDomain, const Vector3< uint_t > &blocks, const Vector3< bool > &isPeriodic, const bool setupRun, const std::string &sbffile, const uint_t numberOfProcesses, const uint_t initialRefinementLevel, const bool keepGlobalBlockInformation) |
shared_ptr< BlockForest > | createBlockForestFromConfig (const Config::BlockHandle &mainConf, const bool keepGlobalBlockInformation) |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const bool oneBlockPerProcess, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const bool oneBlockPerProcess, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const uint_t maxBlocksPerProcess, const bool includeMetis, const bool forceMetis, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const uint_t maxBlocksPerProcess, const bool includeMetis, const bool forceMetis, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
shared_ptr< StructuredBlockForest > | createUniformBlockGrid (const std::string &filename, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const bool keepGlobalBlockInformation) |
Function for creating a structured block forest that represents a uniform block grid. More... | |
void | calculateCellDistribution (const Vector3< uint_t > &cells, uint_t nrOfBlocks, Vector3< uint_t > &blocksOut, Vector3< uint_t > &cellsPerBlock) |
Tries to distribute a given amount of total cells to a given amount of blocks. More... | |
void | uniformWorkloadAndMemoryAssignment (SetupBlockForest &forest) |
memory_t | cellWeightedCommunicationCost (const SetupBlock *const a, const SetupBlock *const b, uint_t xCellsPerBlock, uint_t yCellsPerBlock, uint_t zCellsPerBlock) |
memory_t | uniformFacesDominantCommunication (const SetupBlock *const a, const SetupBlock *const b) |
BlockInfo | operator+ (const BlockInfo &lhs, const BlockInfo &rhs) |
std::ostream & | operator<< (std::ostream &os, const BlockInfo &bi) |
template<typename T , typename G > | |
mpi::GenericSendBuffer< T, G > & | operator<< (mpi::GenericSendBuffer< T, G > &buf, const BlockInfo &info) |
template<typename T > | |
mpi::GenericRecvBuffer< T > & | operator>> (mpi::GenericRecvBuffer< T > &buf, BlockInfo &info) |
std::pair< uint_t, uint_t > | getBlockSequenceRange (uint_t numLocalBlocks, MPI_Comm comm) |
std::map< blockforest::BlockID, uint_t > | getBlockIdToSequenceMapping (const PhantomBlockForest &phantomForest, const std::vector< std::pair< const PhantomBlock *, uint_t > > &targetProcess, const std::pair< uint_t, uint_t > &blockSequenceRange, MPI_Comm comm) |
std::pair< uint_t, uint_t > | getBlockSequenceRange (const PhantomBlockForest &phantomForest, MPI_Comm comm) |
std::map< blockforest::BlockID, uint_t > | getBlockIdToSequenceMapping (const PhantomBlockForest &phantomForest, const std::pair< uint_t, uint_t > &blockSequenceRange, MPI_Comm comm) |
template<typename T > | |
T * | ptr (std::vector< T > &v) |
void | writeColor (std::ofstream &outfile, const uint_t index, const uint_t selector) |
std::ostream & | operator<< (std::ostream &os, const SetupBlockForest &forest) |
WALBERLA_STATIC_ASSERT (sizeof(workload_t)==4||sizeof(workload_t)==8) | |
std::string | naturalNumberToGroupedThousandsString (const uint_t number, const char separator=' ') |
Returns the string representation of 'number', every three digits the character 'separator' is inserted (172408725 -> "172 408 725") More... | |
template<typename UINT > | |
std::string | uintToBitString (const UINT value) |
Returns a string that stores the bitwise representation of 'value' (must be an unsigned integer) More... | |
template<typename T > | |
workload_t | workloadSum (const T &array) |
template<typename T > | |
memory_t | memorySum (const T &array) |
memory_t | bytesToMiB (memory_t bytes) |
std::string | naturalNumberToGroupedThousandsString (const real_t number, const char separator=' ') |
void | fillStream (std::ostream &ostream, const char fill, uint_t length) |
template<typename... Stencils> | |
void | exportUniformBufferedScheme (pybind11::module_ &m) |
template<typename... Stencils> | |
void | exportUniformDirectScheme (pybind11::module_ &m) |
template<typename... Stencils> | |
void | exportUniformDirectScheme (py::module_ &m) |
template<typename... Stencils> | |
void | exportUniformBufferedScheme (py::module_ &m) |
Variables | |
static const uint_t | hilbertOrder [24][8] |
static const uint_t | hilbertOrientation [24][8] |
static const uint_t | PARAVIEW = 0 |
static const uint_t | GNUPLOT = 1 |
using walberla::blockforest::DynamicLevelwiseCurveBalance = typedef DynamicCurveBalance<PhantomData_T> |
using walberla::blockforest::DynamicLevelwiseDiffusionBalance = typedef DynamicDiffusionBalance<PhantomData_T> |
using walberla::blockforest::idx_t = typedef uint_t |
using walberla::blockforest::InfoCollection = typedef std::map<BlockID, BlockInfo> |
using walberla::blockforest::InfoCollectionPair = typedef std::pair<InfoCollection::key_type, InfoCollection::mapped_type> |
using walberla::blockforest::memory_t = typedef real_t |
using walberla::blockforest::workload_t = typedef real_t |
void walberla::blockforest::calculateCellDistribution | ( | const Vector3< uint_t > & | cells, |
uint_t | nrOfBlocks, | ||
Vector3< uint_t > & | blocksOut, | ||
Vector3< uint_t > & | cellsPerBlock | ||
) |
Tries to distribute a given amount of total cells to a given amount of blocks.
It may happen that divisibility of the nr of cells requested prevents a distribution in this case the number of cells is chosen bigger than requested
cells | total number of cells requested | |
nrOfBlocks | total number of blocks to distribute the cells to | |
[out] | blocksOut | calculated number of blocks in x/y/z |
[out] | cellsPerBlock | how many cells to put on each block it may happen that divisibility of the number of cells requested prevents a distribution in this case the number of cells is chosen (slightly) bigger than requested |
Example: in: cells = (10,15,16) in: blocks = 8 out: blocks = (2,2,2) out: cellsPerBlock = (5,8,8) out: newCells = (10,16,16)
memory_t walberla::blockforest::cellWeightedCommunicationCost | ( | const SetupBlock *const | a, |
const SetupBlock *const | b, | ||
uint_t | xCellsPerBlock, | ||
uint_t | yCellsPerBlock, | ||
uint_t | zCellsPerBlock | ||
) |
void walberla::blockforest::constructNeighborhoodSectionBlockCenters | ( | uint_t | sectionIndex, |
const AABB & | blockAABB, | ||
std::vector< real_t > & | centers | ||
) |
shared_ptr< BlockForest > walberla::blockforest::createBlockForest | ( | const AABB & | domainAABB, |
const uint_t | numberOfXBlocks, | ||
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXProcesses, | ||
const uint_t | numberOfYProcesses, | ||
const uint_t | numberOfZProcesses, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks, each block has the same size. The distribution of blocks to processes also follows a Cartesian decomposition.
domainAABB | An axis-aligned bounding box that spans the entire simulation space/domain |
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXProcesses | Number of processes the blocks are distributed to in x direction |
numberOfYProcesses | Number of processes the blocks are distributed to in y direction |
numberOfZProcesses | Number of processes the blocks are distributed to in z direction |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< BlockForest > walberla::blockforest::createBlockForest | ( | const math::AABB & | simulationDomain, |
const Vector3< uint_t > & | blocks, | ||
const Vector3< bool > & | isPeriodic, | ||
const bool | setupRun, | ||
const std::string & | sbffile, | ||
const uint_t | numberOfProcesses, | ||
const uint_t | initialRefinementLevel, | ||
const bool | keepGlobalBlockInformation | ||
) |
shared_ptr< BlockForest > walberla::blockforest::createBlockForest | ( | const math::AABB & | simulationDomain, |
const Vector3< uint_t > & | blocks, | ||
const Vector3< bool > & | isPeriodic, | ||
const uint_t | numberOfProcesses, | ||
const uint_t | initialRefinementLevel, | ||
const bool | keepGlobalBlockInformation | ||
) |
shared_ptr< BlockForest > walberla::blockforest::createBlockForestFromConfig | ( | const Config::BlockHandle & | mainConf, |
const bool | keepGlobalBlockInformation | ||
) |
std::unique_ptr<SetupBlockForest> walberla::blockforest::createSetupBlockForest | ( | const math::AABB & | simulationDomain, |
Vector3< uint_t > | blocks, | ||
const Vector3< bool > & | isPeriodic, | ||
const uint_t | numberOfProcesses, | ||
const uint_t | initialRefinementLevel | ||
) |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const AABB & | domainAABB, |
const uint_t | numberOfXBlocks, | ||
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const bool | oneBlockPerProcess, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. Either all blocks are assigned to the same process (useful for non-parallel simulations) or each blocks is assigned to a different process (useful if only one block shall be assigned to each process).
domainAABB | An axis-aligned bounding box that spans the entire simulation space/domain |
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
oneBlockPerProcess | If true, each block is assigned to a different process. If false, all blocks are assigned to the same process (process 0). |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const AABB & | domainAABB, |
const uint_t | numberOfXBlocks, | ||
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const uint_t | maxBlocksPerProcess, | ||
const bool | includeMetis, | ||
const bool | forceMetis, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The number of active MPI processes is used in order to determine the process distribution = in order to perform the initial, static load balancing. Each block is assumed to generate the same amount of work and to require the same amount of memory.
domainAABB | An axis-aligned bounding box that spans the entire simulation space/domain |
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
maxBlocksPerProcess | Maximum number of blocks that are allowed to be assigned to one process. If a value of '0' is provided, any number of blocks are allowed to be located on one process - meaning static load balancing doesn't try to obey any memory limit. ['0' by default] |
includeMetis | If true (and if available!), METIS is also used during load balancing. [true by default] |
forceMetis | If true, METIS is always preferred over space filling curves [false by default] |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const AABB & | domainAABB, |
const uint_t | numberOfXBlocks, | ||
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const uint_t | numberOfXProcesses, | ||
const uint_t | numberOfYProcesses, | ||
const uint_t | numberOfZProcesses, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The distribution of blocks to processes also follows a Cartesian decomposition.
domainAABB | An axis-aligned bounding box that spans the entire simulation space/domain |
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
numberOfXProcesses | Number of processes the blocks are distributed to in x direction |
numberOfYProcesses | Number of processes the blocks are distributed to in y direction |
numberOfZProcesses | Number of processes the blocks are distributed to in z direction |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const std::string & | filename, |
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The entire block structure and its corresponding process distribution are loaded from file.
filename | A file that stores a block structure and its corresponding process distribution |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const uint_t | numberOfXBlocks, |
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const real_t | dx, | ||
const bool | oneBlockPerProcess, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. Either all blocks are assigned to the same process (useful for non-parallel simulations) or each blocks is assigned to a different process (useful if only one block shall be assigned to each process).
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
dx | Edge length of each cell (cells are assumed to be cubes) |
oneBlockPerProcess | If true, each block is assigned to a different process. If false, all blocks are assigned to the same process (process 0). |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const uint_t | numberOfXBlocks, |
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const real_t | dx, | ||
const uint_t | maxBlocksPerProcess, | ||
const bool | includeMetis, | ||
const bool | forceMetis, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The number of active MPI processes is used in order to determine the process distribution = in order to perform the initial, static load balancing. Each block is assumed to generate the same amount of work and to require the same amount of memory.
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
dx | Edge length of each cell (cells are assumed to be cubes) |
maxBlocksPerProcess | Maximum number of blocks that are allowed to be assigned to one process. If a value of '0' is provided, any number of blocks are allowed to be located on one process - meaning static load balancing doesn't try to obey any memory limit. ['0' by default] |
includeMetis | If true (and if available!), METIS is also used during load balancing. [true by default] |
forceMetis | If true, METIS is always preferred over space filling curves [false by default] |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid | ( | const uint_t | numberOfXBlocks, |
const uint_t | numberOfYBlocks, | ||
const uint_t | numberOfZBlocks, | ||
const uint_t | numberOfXCellsPerBlock, | ||
const uint_t | numberOfYCellsPerBlock, | ||
const uint_t | numberOfZCellsPerBlock, | ||
const real_t | dx, | ||
const uint_t | numberOfXProcesses, | ||
const uint_t | numberOfYProcesses, | ||
const uint_t | numberOfZProcesses, | ||
const bool | xPeriodic, | ||
const bool | yPeriodic, | ||
const bool | zPeriodic, | ||
const bool | keepGlobalBlockInformation | ||
) |
Function for creating a structured block forest that represents a uniform block grid.
Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The distribution of blocks to processes also follows a Cartesian decomposition.
numberOfXBlocks | Number of blocks in x direction |
numberOfYBlocks | Number of blocks in y direction |
numberOfZBlocks | Number of blocks in z direction |
numberOfXCellsPerBlock | Number of cells of each block in x direction |
numberOfYCellsPerBlock | Number of cells of each block in y direction |
numberOfZCellsPerBlock | Number of cells of each block in z direction |
dx | Edge length of each cell (cells are assumed to be cubes) |
numberOfXProcesses | Number of processes the blocks are distributed to in x direction |
numberOfYProcesses | Number of processes the blocks are distributed to in y direction |
numberOfZProcesses | Number of processes the blocks are distributed to in z direction |
xPeriodic | If true, the block structure is periodic in x direction [false by default] |
yPeriodic | If true, the block structure is periodic in y direction [false by default] |
zPeriodic | If true, the block structure is periodic in z direction [false by default] |
keepGlobalBlockInformation | If true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default] |
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGridFromConfig | ( | const Config::BlockHandle & | configBlock, |
CellInterval * | requestedDomainSize, | ||
const bool | keepGlobalBlockInformation | ||
) |
Parses config block and creates a StructuredBlockForest.
Two possibilities: 1) Using the cells per block and number of blocks for each direction
{ cellsPerBlock < 10, 20, 30 > ; // required blocks < 1, 2, 3 > ; // required periodic < 0, 0, 1 >; // not required, defaults to no periodicity dx 0.01; // defaults to 1.0 }
An optional config parameter 'cartesianSetup' is available. Its default, true, causes one block to be assigned to each process. Setting it to false allows multiple blocks to be assigned to each process. If the number of blocks is not divisible by the number of processes, the loadbalancer tries to assign the blocks to processes as evenly as possible. 2) Using the number of global cells, #blocks = #processes, if this does not fit, extend the domain
{ cells < 10,40,90>; // required periodic < 0, 0, 1 >; // not required, defaults to no periodicity dx 0.01; // defaults to 1.0 }
An optional config parameter 'oneBlockPerProcess' is available. Setting it to false forces all blocks to be assigned to a single process, which may be useful for debugging purposes. Otherwise, one block is assigned to each process. Example: cells < 31,31,31> started using 8 processors
calculated processor distribution <2,2,2>
real domain is then extended to <32,32,32> and every processor gets a block of <16,16,16>
When this setup is used and requestedDomainSize is not the null pointer, it is set to
the requested domain size ( in the example <31,31,31> )
shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGridFromConfig | ( | const shared_ptr< Config > & | config, |
CellInterval * | requestedDomainSize, | ||
const bool | keepGlobalBlockInformation | ||
) |
Parses config block called 'DomainSetup' and creates a StructuredBlockForest.
For more information see function below.
void walberla::blockforest::exportUniformBufferedScheme | ( | py::module_ & | m | ) |
void walberla::blockforest::exportUniformBufferedScheme | ( | pybind11::module_ & | m | ) |
void walberla::blockforest::exportUniformDirectScheme | ( | py::module_ & | m | ) |
void walberla::blockforest::exportUniformDirectScheme | ( | pybind11::module_ & | m | ) |
|
inline |
std::map< blockforest::BlockID, uint_t > walberla::blockforest::getBlockIdToSequenceMapping | ( | const PhantomBlockForest & | phantomForest, |
const std::pair< uint_t, uint_t > & | blockSequenceRange, | ||
MPI_Comm | comm | ||
) |
std::map< blockforest::BlockID, uint_t > walberla::blockforest::getBlockIdToSequenceMapping | ( | const PhantomBlockForest & | phantomForest, |
const std::vector< std::pair< const PhantomBlock *, uint_t > > & | targetProcess, | ||
const std::pair< uint_t, uint_t > & | blockSequenceRange, | ||
MPI_Comm | comm | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
std::pair<uint_t, uint_t> walberla::blockforest::getBlockSequenceRange | ( | const PhantomBlockForest & | phantomForest, |
MPI_Comm | comm | ||
) |
std::pair<uint_t, uint_t> walberla::blockforest::getBlockSequenceRange | ( | uint_t | numLocalBlocks, |
MPI_Comm | comm | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
memory_t walberla::blockforest::memorySum | ( | const T & | array | ) |
|
inline |
std::string walberla::blockforest::naturalNumberToGroupedThousandsString | ( | uint_t | number, |
const char | separator | ||
) |
Returns the string representation of 'number', every three digits the character 'separator' is inserted (172408725 -> "172 408 725")
mpi::GenericSendBuffer<T,G>& walberla::blockforest::operator<< | ( | mpi::GenericSendBuffer< T, G > & | buf, |
const BlockInfo & | info | ||
) |
|
inline |
|
inline |
|
inline |
mpi::GenericRecvBuffer<T>& walberla::blockforest::operator>> | ( | mpi::GenericRecvBuffer< T > & | buf, |
BlockInfo & | info | ||
) |
T* walberla::blockforest::ptr | ( | std::vector< T > & | v | ) |
|
inlinestatic |
std::string walberla::blockforest::uintToBitString | ( | const UINT | value | ) |
Returns a string that stores the bitwise representation of 'value' (must be an unsigned integer)
memory_t walberla::blockforest::uniformFacesDominantCommunication | ( | const SetupBlock *const | a, |
const SetupBlock *const | b | ||
) |
void walberla::blockforest::uniformWorkloadAndMemoryAssignment | ( | SetupBlockForest & | forest | ) |
walberla::blockforest::WALBERLA_STATIC_ASSERT | ( | sizeof(workload_t) | = =4||sizeof(workload_t)==8 | ) |
workload_t walberla::blockforest::workloadSum | ( | const T & | array | ) |
void walberla::blockforest::writeColor | ( | std::ofstream & | outfile, |
const uint_t | index, | ||
const uint_t | selector | ||
) |
|
static |
|
static |
|
static |
|
static |