7#include <vapor/VDFIOBase.h>
11#include <vapor/NCBuf.h>
58#ifdef VAPOR3_0_0_ALPHA
59 WaveCodecIO(
const size_t dim[3],
const size_t bs[3],
int numTransforms,
const vector<size_t> cratios,
const string &wname,
const string &filebase);
100 virtual int OpenVariableRead(
size_t timestep,
const char *varname,
int reflevel = 0,
int lod = 0);
123 virtual int OpenVariableWrite(
size_t timestep,
const char *varname,
int reflevel = -1 ,
int lod = -1);
153 virtual int BlockReadRegion(
const size_t bmin[3],
const size_t bmax[3],
float *region,
bool unblock =
true);
178 virtual int ReadRegion(
const size_t min[3],
const size_t max[3],
float *region);
230 virtual int BlockWriteRegion(
const float *region,
const size_t bmin[3],
const size_t bmax[3],
bool block =
true);
258 virtual int WriteRegion(
const float *region,
const size_t min[3],
const size_t max[3]);
342 virtual int VariableExists(
size_t ts,
const char *varname,
int reflevel = 0,
int lod = 0)
const;
361 static size_t GetMaxCRatio(
const size_t bs[3],
string wavename,
string wmode);
371 void SetIOComm(MPI_Comm NewIOComm) { _IO_Comm = NewIOComm; };
384 double _methodThreadTimer;
390 class ReadWriteThreadObj {
392 ReadWriteThreadObj(
WaveCodecIO *wc,
int id,
float *region,
const size_t bmin_p[3],
const size_t bmax_p[3],
const size_t bdim_p[3],
const size_t dim_p[3],
const size_t bs_p[3],
bool reblock,
394 void BlockReadRegionThread();
395 void BlockWriteRegionThread();
396 const float *GetDataRange()
const {
return (_dataRange); }
402 const size_t *_bmin_p;
403 const size_t *_bmax_p;
404 const size_t *_bdim_p;
405 const size_t *_dim_p;
410 int _FetchBlock(
size_t bx,
size_t by,
size_t bz);
411 int _WriteBlock(
size_t bx,
size_t by,
size_t bz);
423 ReadWriteThreadObj ** _rw_thread_objs;
424 vector<vector<SignificanceMap>> _sigmapsThread;
425 vector<size_t> _sigmapsizes;
431 vector<Compressor *> _compressorThread3D;
432 vector<Compressor *> _compressorThread2DXY;
433 vector<Compressor *> _compressorThread2DXZ;
434 vector<Compressor *> _compressorThread2DYZ;
435 vector<Compressor *> _compressorThread;
436 vector<NCBuf *> _ncbufs;
439 VarType_T _compressorType;
442 size_t _validRegMin[3];
443 size_t _validRegMax[3];
448 vector<string> _ncpaths;
450 vector<int> _nc_sig_vars;
451 vector<int> _nc_wave_vars;
454 vector<float *> _cvectorThread;
455 unsigned char * _svector;
457 vector<unsigned char *> _svectorThread;
459 vector<float *> _blockThread;
462 vector<size_t> _ncoeffs;
463 vector<size_t> _cratios3D;
464 vector<size_t> _cratios2D;
465 vector<size_t> _cratios;
468 size_t _sliceBufferSize;
473 int _OpenVarWrite(
const string &basename);
474 int _OpenVarRead(
const string &basename);
475 int _WaveCodecIO(
int nthreads);
476 int _SetupCompressor();
478 void _UnpackCoord(VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill)
const;
480 void _PackCoord(VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill)
const;
482 void _FillPackedCoord(VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill)
const;
A class for managing data set metadata.
A sub-region reader for VDF files.
void GetValidRegion(size_t min[3], size_t max[3], int reflevel) const
static size_t GetMaxCRatio(const size_t bs[3], string wavename, string wmode)
void EnableBuffering(size_t count[3], size_t divisor, int rank)
virtual int WriteRegion(const float *region)
friend void * RunBlockReadRegionThread(void *object)
WaveCodecIO(const MetadataVDC &metadata, int nthreads=0)
virtual int VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
virtual void GetBlockSize(size_t bs[3], int reflevel) const
virtual int ReadRegion(const size_t min[3], const size_t max[3], float *region)
virtual int ReadRegion(float *region)
virtual int WriteRegion(const float *region, const size_t min[3], const size_t max[3])
const float * GetDataRange() const
virtual int OpenVariableWrite(size_t timestep, const char *varname, int reflevel=-1, int lod=-1)
virtual int ReadSlice(float *slice)
virtual int WriteSlice(const float *slice)
WaveCodecIO(const string &metafile, int nthreads=0)
virtual int BlockReadRegion(const size_t bmin[3], const size_t bmax[3], float *region, bool unblock=true)
virtual int OpenVariableRead(size_t timestep, const char *varname, int reflevel=0, int lod=0)
friend void * RunBlockWriteRegionThread(void *object)
virtual int GetNumTransforms() const
virtual int BlockWriteRegion(const float *region, const size_t bmin[3], const size_t bmax[3], bool block=true)
virtual void SetBoundaryPadOnOff(bool pad)
void SetCollectiveIO(bool newCollectiveIO)
virtual int CloseVariable()