Class AnyDistributedSparseGrid

Inheritance Relationships

Derived Type

Class Documentation

class AnyDistributedSparseGrid

sparse grid base class

this class is agnostic of the dimensionality and data type of the grid

Subclassed by combigrid::DistributedSparseGridUniform< FG_ELEMENT >

Public Types

using SubspaceIndexType = int32_t

Public Functions

explicit AnyDistributedSparseGrid(size_t numSubspaces, CommunicatorType comm)
virtual ~AnyDistributedSparseGrid()
void clearSubspaceCommunicators()
size_t getAccumulatedDataSize() const

get sum of all data sizes of all subspaces of this grid on this rank

Returns:

the number of numbers stored; multiply by sizeof(FG_ELEMENT) to get bytes

size_t getAccumulatedDataSize(const std::set<SubspaceIndexType> &subsetOfSubspaces) const

get sum of data sizes of select subspaces of this grid on this rank

Parameters:

subsetOfSubspaces – the indices of the subspaces to consider

Returns:

the number of numbers stored; multiply by sizeof(FG_ELEMENT) to get bytes

CommunicatorType getCommunicator() const

get the communicator of this grid

usally the same as theMPISystem()->getLocalComm()

SubspaceSizeType getDataSize(SubspaceIndexType i) const

get the number of numbers in subspace i

SubspaceSizeType getDataSize(size_t i) const
std::set<typename AnyDistributedSparseGrid::SubspaceIndexType> &getIngroupSubspaces() const

get the subspaces that are only in this process group

SubspaceIndexType getNumSubspaces() const

get the number of subspaces

RankType getRank() const

get the rank of this process in the communicator

usually the same as theMPISystem()->getLocalRank()

const std::vector<SubspaceSizeType> &getSubspaceDataSizes() const

get the data sizes of all subspaces

std::vector<SubspaceSizeType> &getSubspaceDataSizes()
const std::vector<std::pair<CommunicatorType, std::vector<SubspaceIndexType>>> &getSubspacesByCommunicator() const

get the subspace communicators and the subspaces they are responsible for

used for subspace reduce only

virtual void setDataSize(SubspaceIndexType i, SubspaceSizeType newSize)

set the data size of a subspace

void setOutgroupCommunicator(CommunicatorType comm, RankType rankInComm)

set the communicator for communication with the other process groups

usually perpendicular to the local communicator: all ranks in this communicator have an AnyDistributedSparseGrid that represents the same part of the domain

used only for sparse grid reduce and outgroup reduce

Parameters:

comm – the communicator to use

void setSubspaceCommunicators(CommunicatorType comm, RankType rankInComm)

generate the communicators for communication with the other process groups

usually perpendicular to the local communicator: all ranks in this communicator have an AnyDistributedSparseGrid that represents the same part of the domain

used only for subspace reduce

Parameters:
  • comm – the communicator to generate sub-communicators from

  • rankInComm – the rank in comm

Protected Attributes

CommunicatorType comm_
RankType rank_
std::vector<SubspaceSizeType> subspacesDataSizes_
std::vector<std::pair<CommunicatorType, std::vector<SubspaceIndexType>>> subspacesByComm_
bool myOwnSubspaceCommunicators_ = false