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 #ifndef __VTK_WRAP__
20 #ifndef VTK_WRAPPING_CXX
21 
22 #include <string>
23 #include <vector>
24 
25 #include <adios_read.h>
26 
27 //----------------------------------------------------------------------------
28 namespace ADIOS
29 {
30 
31 class VarInfo
32 {
33 public:
34  // Data structure used to hold block index mapping info
35  struct StepBlock
36  {
37  StepBlock() : Step(-1), Block(-1), BlockId(-1) {}
38  StepBlock(int s, int b, int i) : Step(s), Block(b), BlockId(i) { }
39  int Step;
40  int Block;
41  int BlockId;
42  };
43 
44 public:
45  VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v);
46  virtual ~VarInfo(void);
47  void SetName(const std::string& name) { this->Name = name; }
48 
49  const int& GetId() const;
50  const ADIOS_DATATYPES& GetType() const;
51  const std::string& GetName(void) const;
52  size_t GetNumSteps(void) const;
53  size_t GetNumBlocks(size_t step) const;
54  StepBlock* GetNewestBlockIndex(size_t step, size_t pid) const;
55  void GetDims(std::vector<size_t>& dims, size_t step, size_t pid) const;
56 
57 protected:
58  int Id;
59  ADIOS_DATATYPES Type;
61  size_t NumSteps;
62  size_t NumPids;
63  std::vector<std::vector<size_t> > Dims;
64 
65  // This maps the absolute time step and process id to a file-local
66  // step and block id for reading
67  std::vector<StepBlock*> StepBlockIndex;
68 };
69 
70 } // End namespace ADIOS
71 #endif
72 #endif
73 #endif // _ADIOSVarInfo_h
74 // VTK-HeaderTest-Exclude: ADIOSVarInfo.h
void SetName(const std::string &name)
Definition: ADIOSVarInfo.h:47
std::string Name
Definition: ADIOSVarInfo.h:60
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:63
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:67
ADIOS_DATATYPES Type
Definition: ADIOSVarInfo.h:59
const std::string & GetName(void) const
const int & GetId() const
StepBlock(int s, int b, int i)
Definition: ADIOSVarInfo.h:38
StepBlock * GetNewestBlockIndex(size_t step, size_t pid) const