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//----------------------------------------------------------------------------
26namespace ADIOS
27{
28
30{
31public:
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;
40 };
41
42public:
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
55protected:
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
const std::string & GetName(void) const
void SetName(const std::string &name)
Definition: ADIOSVarInfo.h:45
const int & GetId() const
std::vector< StepBlock * > StepBlockIndex
Definition: ADIOSVarInfo.h:65
ADIOS_DATATYPES Type
Definition: ADIOSVarInfo.h:57
std::vector< std::vector< size_t > > Dims
Definition: ADIOSVarInfo.h:61
VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v)
void GetDims(std::vector< size_t > &dims, size_t step, size_t pid) const
virtual ~VarInfo(void)
std::string Name
Definition: ADIOSVarInfo.h:58
size_t GetNumSteps(void) const
const ADIOS_DATATYPES & GetType() const
size_t GetNumBlocks(size_t step) const
StepBlock * GetNewestBlockIndex(size_t step, size_t pid) const
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490
StepBlock(int s, int b, int i)
Definition: ADIOSVarInfo.h:36