Functions | |
int | SubIntervalFromStream (std::istream &inStream, const pcpp::IndexIntervalType &inInterval, pcpp::IndexIntervalType &subInterval) |
std::deque< size_t > | PrimeFactors (size_t inNumber) |
int | SimplePartitionInterval (const pcpp::IndexIntervalType &inInterval, std::vector< bool > partDirection, int partID, int numPart, pcpp::IndexIntervalType &outInterval, std::vector< int > &numPartitions) |
Multi-dimensional interval partitioning (non-MPI) More... | |
int | Part1D (const size_t iStart, const size_t iEnd, const size_t numPart, const size_t partIndex, size_t &partStart, size_t &partEnd) |
Extract a sub-interval of a 1-dimensional integer interval. More... | |
int | PartitionCartesianExtent (const pcpp::IndexIntervalType &globalExtent, const std::vector< int > &cartDims, const std::vector< int > &cartCoords, pcpp::IndexIntervalType &partExtent, std::ostream &messageStream) |
Get local sub-interval of an n-dimensional integer interval. More... | |
int | PartitionCartesianInterval (const pcpp::IndexIntervalType &globalInterval, const std::vector< int > &cartDims, const std::vector< int > &cartCoords, pcpp::IndexIntervalType &partInterval, std::ostream &messageStream) |
Get local sub-interval of an n-dimensional integer interval. More... | |
void | CollapseInterval (size_t &xSize, size_t &ySize, size_t &zSize, const pcpp::IndexIntervalType &inInterval, pcpp::IndexIntervalType &outInterval) |
std::vector< pcpp::IndexIntervalType > | UniqueUnion (const std::vector< pcpp::IndexIntervalType > &intervalSet) |
template<typename BufferDataType > | |
void | TransferBufferData (size_t numPoints, int numComponents, size_t sourceSize, size_t targetSize, const size_t *sourceIndices, const size_t *targetIndices, const BufferDataType *sourceBuffer, BufferDataType *targetBuffer) |
Transfer data from a sized source buffer to a (different) sized target buffer. More... | |
template<typename BufferDataType > | |
int | CopyInterval (const std::vector< size_t > &sourceSizes, const pcpp::IndexIntervalType &sourceInterval, const BufferDataType *sourceBuffer, const std::vector< size_t > &destSizes, const pcpp::IndexIntervalType &destInterval, BufferDataType *destData) |
int | RecursiveReadConfiguration (const std::string ¤tPath, std::istream &inStream, pcpp::ConfigType &plascomConfig, std::ostream &messageStream, const std::string="") |
int | ProcessConfigurationFile (const std::string &configFileName, pcpp::ConfigType &plascomConfig, pcpp::CommunicatorType &globalCommunicator, std::ostream &messageStream) |
Populate a configuration object from file in parallel. More... | |
int | ProcessConfigurationRestart (const std::string &restartFileName, pcpp::ConfigType &inConfig, pcpp::CommunicatorType &configCommunicator, std::ostream &messageStream) |
Populate a configuration object from an HDF5 restart file. More... | |
std::string | ConfigKey (const std::string &configName, const std::string &keyName) |
pcpp::ConfigType | GetSubConfig (const std::string &configName, const pcpp::ConfigType &plascomConfig) |
int | ConfigureDataDictionary (pcpp::ConfigType &inConfig, const std::string &dictName, pcpp::field::metadataset &dataDictionary, std::ostream &messageStream) |
pcpp::field::metadataset | ExtractDictionary (const pcpp::field::metadataset &dataDictionary, const char loc) |
pcpp::ConfigType | ExtractConfigParams (const fixtures::ConfigurationType &inConfig, const std::string &configName) |
template<typename GridType > | |
int | ConfigureGrid (pcpp::ConfigType &inConfig, const std::string &gridKey, pcpp::CommunicatorType &inCommunicator, GridType &inGrid, std::ostream &messageStream) |
template<typename BufferDataType > | |
void | ReportBufferStats (std::ostream &outStream, size_t numValues, const BufferDataType *dataBuffer) |
int | ErrorMetrics (int numDim, size_t numPoints, double *dataBuffer, double *normData, size_t &maxErrLocation) |
std::string | GetConfigName (const std::string &configKey, int nameDepth=0) |
void | GetFieldMetaFromTokens (pcpp::field::metadata &metaData, std::vector< std::string > &inTokens) |
void CollapseInterval | ( | size_t & | xSize, |
size_t & | ySize, | ||
size_t & | zSize, | ||
const pcpp::IndexIntervalType & | inInterval, | ||
pcpp::IndexIntervalType & | outInterval | ||
) |
Definition at line 93 of file PCPPIntervalUtils.C.
std::string ConfigKey | ( | const std::string & | configName, |
const std::string & | keyName | ||
) |
Definition at line 191 of file PCPPUtil.C.
Referenced by ConfigStateValues(), base::Configure(), base< GridT, StateT >::ConfigureDomain(), plascom2::util::ConfigureGrid(), base::ConfigureGrid(), base< GridT, StateT >::ConfigureGridDomainBoundaries(), plascom2::util::ConfigureGridInfo(), plascom2::util::ConfigureGridSubRegions(), application::ConfigureSimulation(), base::ConfigureState(), base< GridT, StateT >::CreateData(), euler::util::InitializeAdvectionDiffusion(), application::RunMaxwellSolver(), and application::RunPlasCom2().
int ConfigureDataDictionary | ( | pcpp::ConfigType & | inConfig, |
const std::string & | dictName, | ||
pcpp::field::metadataset & | dataDictionary, | ||
std::ostream & | messageStream | ||
) |
Definition at line 129 of file PCPPUtil.C.
References metadataset::AddField(), metadata::dsize, GetFieldMetaFromTokens(), Parameters::GetValue(), Parameters::GetValueVector(), Parameters::IsSet(), metadata::loc, and metadata::ncomp.
Referenced by base< GridT, StateT >::ConfigureDomain().
int pcpp::util::ConfigureGrid | ( | pcpp::ConfigType & | inConfig, |
const std::string & | gridKey, | ||
pcpp::CommunicatorType & | inCommunicator, | ||
GridType & | inGrid, | ||
std::ostream & | messageStream | ||
) |
Definition at line 47 of file PCPPUtil.H.
int pcpp::util::CopyInterval | ( | const std::vector< size_t > & | sourceSizes, |
const pcpp::IndexIntervalType & | sourceInterval, | ||
const BufferDataType * | sourceBuffer, | ||
const std::vector< size_t > & | destSizes, | ||
const pcpp::IndexIntervalType & | destInterval, | ||
BufferDataType * | destData | ||
) |
Definition at line 75 of file PCPPIntervalUtils.H.
References sizeextent::GetFlatIndices(), sizeextent::InitSimple(), and sizeextent::NNodes().
int ErrorMetrics | ( | int | numDim, |
size_t | numPoints, | ||
double * | dataBuffer, | ||
double * | normData, | ||
size_t & | maxErrLocation | ||
) |
Definition at line 23 of file PCPPUtil.C.
References numPoints.
Referenced by plascom2::util::PC2Compare(), and ReportBufferStats().
pcpp::ConfigType ExtractConfigParams | ( | const fixtures::ConfigurationType & | inConfig, |
const std::string & | configName | ||
) |
Definition at line 70 of file PCPPUtil.C.
References x.
Referenced by base< GridT, StateT >::ConfigureDomain(), and application::ConfigureDomains().
pcpp::field::metadataset ExtractDictionary | ( | const pcpp::field::metadataset & | dataDictionary, |
const char | loc | ||
) |
Definition at line 9 of file PCPPUtil.C.
References metadata::loc.
std::string pcpp::util::GetConfigName | ( | const std::string & | configKey, |
int | nameDepth = 0 |
||
) |
Definition at line 57 of file PCPPUtil.C.
References x.
Referenced by RecursiveReadConfiguration().
void pcpp::util::GetFieldMetaFromTokens | ( | pcpp::field::metadata & | metaData, |
std::vector< std::string > & | inTokens | ||
) |
Definition at line 113 of file PCPPUtil.C.
References metadata::dsize, metadata::loc, metadata::ncomp, and metadata::unit.
Referenced by ConfigureDataDictionary().
pcpp::ConfigType GetSubConfig | ( | const std::string & | configName, |
const pcpp::ConfigType & | plascomConfig | ||
) |
Definition at line 90 of file PCPPUtil.C.
References x.
Referenced by TestPlasCom2Output().
int Part1D | ( | const size_t | iStart, |
const size_t | iEnd, | ||
const size_t | numPart, | ||
const size_t | partIndex, | ||
size_t & | partStart, | ||
size_t & | partEnd | ||
) |
Extract a sub-interval of a 1-dimensional integer interval.
iStart | - start of the interval |
iEnd | - end of the interval |
numPart | - number of sub-interval |
partIndex | - which sub-interval to return |
partStart | - return start of sub-interval |
partEnd | - return end of sub-interval |
Definition at line 283 of file PCPPIntervalUtils.C.
Referenced by PartitionCartesianExtent(), PartitionCartesianInterval(), and SimplePartitionInterval().
int PartitionCartesianExtent | ( | const pcpp::IndexIntervalType & | globalExtent, |
const std::vector< int > & | cartDims, | ||
const std::vector< int > & | cartCoords, | ||
pcpp::IndexIntervalType & | partExtent, | ||
std::ostream & | messageStream | ||
) |
Get local sub-interval of an n-dimensional integer interval.
This function takes an n-dimensional integer interval, partitions it into a number of equal subintervals according to the input parameters and returns the local sub-interval.
globalExtent | - ref to extent to be partitioned |
cartDims | - ref to vector indicating number of partitions in each dimension |
cartCoords | - ref to vector indicating local Cartesian coordinates (of local process) |
partExtent | - returned extent of local partition (i.e. local partition interval) |
messageStream | - ref to std::ostream for any messages generated by the routine |
Definition at line 317 of file PCPPIntervalUtils.C.
References sizeextent::Init(), sizeextent::ND(), and Part1D().
Referenced by TestHaloParallel(), TestHaloPeriodic(), TestHDF5HyperSlab(), and TestHDF5Read2DBlockStructuredGrid().
int PartitionCartesianInterval | ( | const pcpp::IndexIntervalType & | globalInterval, |
const std::vector< int > & | cartDims, | ||
const std::vector< int > & | cartCoords, | ||
pcpp::IndexIntervalType & | partInterval, | ||
std::ostream & | messageStream | ||
) |
Get local sub-interval of an n-dimensional integer interval.
This function takes an n-dimensional integer interval, partitions it into a number of equal subintervals according to the input parameters and returns the local sub-interval.
globalInterval | - ref to interval to be partitioned |
cartDims | - ref to vector indicating number of partitions in each dimension |
cartCoords | - ref to vector indicating local Cartesian coordinates (of local process) |
partInterval | - returned interval of local partition (i.e. local partition interval) |
messageStream | - ref to std::ostream for any messages generated by the routine |
TestHaloParallel
TestGrid_PUBS_IntegratedHalo
Definition at line 372 of file PCPPIntervalUtils.C.
References sizeextent::Init(), sizeextent::ND(), and Part1D().
Referenced by application::ConfigureSimulation(), testfixtures::CreateSimulationFixtures(), euler::util::CreateSimulationFixtures(), euler::util::InitializeSimulationFixtures(), parallel_blockstructured::ParallelSetup(), and TestGrid_PBS_IntegratedHalo().
std::deque< size_t > PrimeFactors | ( | size_t | inNumber | ) |
Definition at line 132 of file PCPPIntervalUtils.C.
Referenced by pcpp::comm::SetupCartesianTopology(), and SimplePartitionInterval().
int ProcessConfigurationFile | ( | const std::string & | configFileName, |
pcpp::ConfigType & | plascomConfig, | ||
pcpp::CommunicatorType & | globalCommunicator, | ||
std::ostream & | messageStream | ||
) |
Populate a configuration object from file in parallel.
This function populates a configuration object from input configuration file in PlasComCM format, or CodeletX format by reading the configuration object on processor 0, and BCast it out to the rest of the processors.
configFileName | std::string ref indicating the path to the configuration file |
plascomConfig | pcpp::ConfigType ref to configuration data object to populate |
globalCommunicator | pcpp::CommunicatorType ref to parallel communication object |
messageStream | std::ostream reference to output stream for any status messages |
Definition at line 326 of file PCPPUtil.C.
References CommunicatorObject::BroadCast(), CommunicatorObject::Check(), CommunicatorObject::Rank(), RecursiveReadConfiguration(), ix::util::RenewStream(), CommunicatorObject::SetExit(), and x.
Referenced by application::ConfigureApplication(), TestPCPPHDF5Write(), TestPlasCom2Input(), and TestPlasCom2Output().
int ProcessConfigurationRestart | ( | const std::string & | restartFileName, |
pcpp::ConfigType & | inConfig, | ||
pcpp::CommunicatorType & | configCommunicator, | ||
std::ostream & | messageStream | ||
) |
Populate a configuration object from an HDF5 restart file.
This function populates a configuration object from input HDF5 file in PlasCom2 format by reading the configuration object on processor 0, and BCast it out to the rest of the processors.
restartFileName | std::string ref indicating the path to the configuration file |
plascomConfig | pcpp::ConfigType ref to configuration data object to populate |
globalCommunicator | pcpp::CommunicatorType ref to parallel communication object |
messageStream | std::ostream reference to output stream for any status messages |
Definition at line 396 of file PCPPUtil.C.
References base::AttributeExists(), CommunicatorObject::BroadCast(), CommunicatorObject::Check(), base::Close(), ix::sys::FILEEXISTS(), base::Open(), CommunicatorObject::Rank(), base::ReadAttribute(), Parameters::ReadFromStream(), and CommunicatorObject::SetErr().
Referenced by application::ConfigureApplication(), and TestPlasCom2Input().
int RecursiveReadConfiguration | ( | const std::string & | currentPath, |
std::istream & | inStream, | ||
pcpp::ConfigType & | plascomConfig, | ||
std::ostream & | messageStream, | ||
const std::string | inName = "" |
||
) |
Definition at line 203 of file PCPPUtil.C.
References ix::sys::FILEEXISTS(), GetConfigName(), KeyValuePairObj< K, V >::Key(), KeyValuePairObj< K, V >::Value(), and x.
Referenced by ProcessConfigurationFile().
void pcpp::util::ReportBufferStats | ( | std::ostream & | outStream, |
size_t | numValues, | ||
const BufferDataType * | dataBuffer | ||
) |
Definition at line 55 of file PCPPUtil.H.
References ErrorMetrics(), and numPoints.
Referenced by base::Report().
int SimplePartitionInterval | ( | const pcpp::IndexIntervalType & | inInterval, |
std::vector< bool > | partDirection, | ||
int | partID, | ||
int | numPart, | ||
pcpp::IndexIntervalType & | outInterval, | ||
std::vector< int > & | numPartitions | ||
) |
Multi-dimensional interval partitioning (non-MPI)
Definition at line 151 of file PCPPIntervalUtils.C.
References Part1D(), and PrimeFactors().
Referenced by parallel_blockstructured::SetupThreads(), TestHaloThreaded(), and TestVarious().
int SubIntervalFromStream | ( | std::istream & | inStream, |
const pcpp::IndexIntervalType & | inInterval, | ||
pcpp::IndexIntervalType & | subInterval | ||
) |
Definition at line 7 of file PCPPIntervalUtils.C.
References sizeextent::Copy(), and sizeextent::Overlap().
void pcpp::util::TransferBufferData | ( | size_t | numPoints, |
int | numComponents, | ||
size_t | sourceSize, | ||
size_t | targetSize, | ||
const size_t * | sourceIndices, | ||
const size_t * | targetIndices, | ||
const BufferDataType * | sourceBuffer, | ||
BufferDataType * | targetBuffer | ||
) |
Transfer data from a sized source buffer to a (different) sized target buffer.
Template function to transfer numPoints data items of specified type from sourceBuffer with total size indicated by sourceSize into targetBuffer with size indicated by targetSize. The shapes of the data to be transferred from/to is encapsulated by the sourceIndices/targetIndices flat arrays of source and target indices, resp. If numComponents > 1, then the sourceSize, and targetSize arguments are interpreted as blockSizes and a number of blocks = numComponents will be transferred.
Definition at line 53 of file PCPPIntervalUtils.H.
References numComponents, and numPoints.
std::vector< pcpp::IndexIntervalType > UniqueUnion | ( | const std::vector< pcpp::IndexIntervalType > & | intervalSet | ) |
Definition at line 75 of file PCPPIntervalUtils.C.
References sizeextent::Overlap().