#include <CCA_Block.h>
Public Member Functions | |
void | setDimensions (int n) |
void | setLayout (int dimension, int gLow, int gHigh, int beginPad, int endPad, int gSize, int blockBefore, int blockAfter, int blockId) |
void | getLayout (int dimension, int *gLow, int *gHigh, int *beginPad, int *endPad, int *gSize, int *blockBefore, int *blockAfter, int *blockId) |
void | addField (int fieldTag, char *fieldString) |
int | getFieldOffset (int fieldTag) |
int | getFieldNameOffset (char *name) |
void | fixDescription () |
int | getBlockId () |
struct CCA_dimenMap * | getDimensions (int &n) |
const char ** | getFieldNames (int &nf) |
const int * | getFieldTags (int &nf) |
int | getNFields () |
int | getIsStacked () |
Private Attributes | |
int | nDim |
int | stored |
struct CCA_dimenMap * | dim |
int | nFields |
int | capFields |
int * | fieldId |
char ** | fieldName |
int | locked |
int | blockId |
Conceivably should be rewritten in mpi data_type or Cart terms.
The Block introspection is separate from the block data because the CCA_BlockDescription could be the currency for requesting a block from a data manager. The block data manager would have the option of returning a CCA_DoubleBlock with a different but compatible description (i.e. larger, or with more fields) depending on how the data manager was queried. e.g. getBlockExact(CCA_BlockDescription * bd) {...} will do a data copy to create the block matching bd while getBlock(CCA_BlockDescription * bd) {...} makes sure only that what it returns is a superset of the specification in bd.
void CCA_BlockDescription::addField | ( | int | fieldTag, | |
char * | fieldString | |||
) |
fieldTag | can be anything but must be unique. | |
fieldString | must be unique if given; it can be NULL and we'll make something up: fieldd. |
int CCA_BlockDescription::getFieldOffset | ( | int | fieldTag | ) |
Returns the field layer in stacked data or the field location in strided data. Returns -1 if field not known.
int CCA_BlockDescription::getFieldNameOffset | ( | char * | name | ) |
Returns the field layer in stacked data or the field location in strided data given a string name. Returns -1 if fieldName not known.
int CCA_BlockDescription::getBlockId | ( | ) |
Returns the index of this block. total blocks in a data set are indexed 0 to n-1. Depending on the distributed memory implementation, The blockId may line up with a processor number or not.
int CCA_BlockDescription::getIsStacked | ( | ) |
Returns 1 if each field is stored contiguously. Returns 0 if all the fields for a given index in in the block are stored contiguously.
int CCA_BlockDescription::stored [private] |
0 -> strided data, 1 ->stacked data
struct CCA_dimenMap* CCA_BlockDescription::dim [read, private] |
array [nDim] long
int* CCA_BlockDescription::fieldId [private] |
array [nFields] long
char** CCA_BlockDescription::fieldName [private] |
array [nFields] long