VTK
ADIOSVarInfo.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: ADIOSVarInfo.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME ADIOSVarInfo - The utility class wrapping the ADIOS_VARINFO struct
16 
17 #ifndef _ADIOSVarInfo_h
18 #define _ADIOSVarInfo_h
19 
20 #include <string>
21 #include <vector>
22 
23 #include <adios_read.h>
24 
25 //----------------------------------------------------------------------------
26 namespace ADIOS
27 {
28 
29 class VarInfo
30 {
31 public:
32  // Data structure used to hold block index mapping info
33  struct StepBlock
34  {
35  StepBlock() : Step(-1), Block(-1), BlockId(-1) {}
36  StepBlock(int s, int b, int i) : Step(s), Block(b), BlockId(i) { }
37  int Step;
38  int Block;
39  int BlockId;
40  };
41 
42 public:
43  VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v);
44  virtual ~VarInfo(void);
45  void SetName(const std::string& name) { this->Name = name; }
46 
47  const int& GetId() const;
48  const ADIOS_DATATYPES& GetType() const;
49  const std::string& GetName(void) const;
50  size_t GetNumSteps(void) const;
51  size_t GetNumBlocks(size_t step) const;
52  StepBlock* GetNewestBlockIndex(size_t step, size_t pid) const;
53  void GetDims(std::vector<size_t>& dims, size_t step, size_t pid) const;
54 
55 protected:
56  int Id;
57  ADIOS_DATATYPES Type;
59  size_t NumSteps;
60  size_t NumPids;
61  std::vector<std::vector<size_t> > Dims;
62 
63  // This maps the absolute time step and process id to a file-local
64  // step and block id for reading
65  std::vector<StepBlock*> StepBlockIndex;
66 };
67 
68 } // End namespace ADIOS
69 #endif // _ADIOSVarInfo_h
70 // VTK-HeaderTest-Exclude: ADIOSVarInfo.h
ADIOS::VarInfo::GetNumBlocks
size_t GetNumBlocks(size_t step) const
ADIOS::VarInfo::GetDims
void GetDims(std::vector< size_t > &dims, size_t step, size_t pid) const
ADIOS::VarInfo::VarInfo
VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v)
ADIOS::VarInfo::GetType
const ADIOS_DATATYPES & GetType() const
ADIOS::VarInfo::GetId
const int & GetId() const
tagBlock
Definition: vtkAMRFlashReaderInternal.h:79
ADIOS::VarInfo::Type
ADIOS_DATATYPES Type
Definition: ADIOSVarInfo.h:57
ADIOS::VarInfo::GetNumSteps
size_t GetNumSteps(void) const
ADIOS::VarInfo::NumSteps
size_t NumSteps
Definition: ADIOSVarInfo.h:59
ADIOS::VarInfo::~VarInfo
virtual ~VarInfo(void)
ADIOS::VarInfo::StepBlockIndex
std::vector< StepBlock * > StepBlockIndex
Definition: ADIOSVarInfo.h:65
ADIOS::VarInfo::Id
int Id
Definition: ADIOSVarInfo.h:56
ADIOS::VarInfo::Name
std::string Name
Definition: ADIOSVarInfo.h:58
ADIOS::VarInfo::StepBlock::StepBlock
StepBlock(int s, int b, int i)
Definition: ADIOSVarInfo.h:36
ADIOS::VarInfo::GetName
const std::string & GetName(void) const
ADIOS::VarInfo::StepBlock::StepBlock
StepBlock()
Definition: ADIOSVarInfo.h:35
vtkX3D::name
Definition: vtkX3D.h:219
ADIOS::VarInfo::StepBlock::Block
int Block
Definition: ADIOSVarInfo.h:38
ADIOS::VarInfo::SetName
void SetName(const std::string &name)
Definition: ADIOSVarInfo.h:45
ADIOS::VarInfo::StepBlock::Step
int Step
Definition: ADIOSVarInfo.h:37
vtkX3D::string
Definition: vtkX3D.h:490
ADIOS
Definition: ADIOSAttribute.h:25
ADIOS::VarInfo::NumPids
size_t NumPids
Definition: ADIOSVarInfo.h:60
ADIOS::VarInfo
Definition: ADIOSVarInfo.h:29
ADIOS::VarInfo::StepBlock::BlockId
int BlockId
Definition: ADIOSVarInfo.h:39
ADIOS::VarInfo::StepBlock
Definition: ADIOSVarInfo.h:33
ADIOS::VarInfo::GetNewestBlockIndex
StepBlock * GetNewestBlockIndex(size_t step, size_t pid) const
ADIOS::VarInfo::Dims
std::vector< std::vector< size_t > > Dims
Definition: ADIOSVarInfo.h:61