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
void SetName(const std::string &name)
Definition: ADIOSVarInfo.h:45
std::string Name
Definition: ADIOSVarInfo.h:58
size_t GetNumBlocks(size_t step) const
const ADIOS_DATATYPES & GetType() const
VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v)
std::vector< std::vector< size_t > > Dims
Definition: ADIOSVarInfo.h:61
void GetDims(std::vector< size_t > &dims, size_t step, size_t pid) const
size_t GetNumSteps(void) const
virtual ~VarInfo(void)
std::vector< StepBlock * > StepBlockIndex
Definition: ADIOSVarInfo.h:65
ADIOS_DATATYPES Type
Definition: ADIOSVarInfo.h:57
const std::string & GetName(void) const
const int & GetId() const
StepBlock(int s, int b, int i)
Definition: ADIOSVarInfo.h:36
StepBlock * GetNewestBlockIndex(size_t step, size_t pid) const