7 #include <vapor/VDFIOBase.h>
8 #include <vapor/SignificanceMap.h>
9 #include <vapor/Compressor.h>
10 #include <vapor/EasyThreads.h>
11 #include <vapor/NCBuf.h>
57 WaveCodecIO(
const string &metafile,
int nthreads = 0);
61 const size_t dim[3],
const size_t bs[3],
int numTransforms,
62 const vector <size_t> cratios,
63 const string &wname,
const string &filebase
105 virtual int OpenVariableRead(
106 size_t timestep,
const char *varname,
int reflevel=0,
int lod=0
130 virtual int OpenVariableWrite(
131 size_t timestep,
const char *varname,
132 int reflevel=-1 ,
int lod=-1
139 virtual int CloseVariable();
163 virtual int BlockReadRegion(
164 const size_t bmin[3],
const size_t bmax[3],
float *region,
bool unblock=
true
190 virtual int ReadRegion(
191 const size_t min[3],
const size_t max[3],
float *region
194 virtual int ReadRegion(
float *region);
218 virtual int ReadSlice(
float *slice);
244 virtual int BlockWriteRegion(
245 const float *region,
const size_t bmin[3],
const size_t bmax[3],
275 virtual int WriteRegion(
276 const float *region,
const size_t min[3],
const size_t max[3]
279 virtual int WriteRegion(
300 virtual int WriteSlice(
const float *slice);
351 size_t min[3],
size_t max[3],
int reflevel
368 virtual int VariableExists(
392 static size_t GetMaxCRatio(
const size_t bs[3],
string wavename,
string wmode);
396 virtual int GetNumTransforms()
const;
400 virtual void GetBlockSize(
size_t bs[3],
int reflevel)
const;
402 void SetIOComm(MPI_Comm NewIOComm) {_IO_Comm = NewIOComm;};
405 _collectiveIO = newCollectiveIO;
407 friend void *RunBlockReadRegionThread(
void *
object);
408 friend void *RunBlockWriteRegionThread(
void *
object);
417 double _methodThreadTimer;
423 class ReadWriteThreadObj {
429 const size_t bmin_p[3],
430 const size_t bmax_p[3],
431 const size_t bdim_p[3],
432 const size_t dim_p[3],
433 const size_t bs_p[3],
437 void BlockReadRegionThread();
438 void BlockWriteRegionThread();
439 const float *GetDataRange()
const {
return (_dataRange);}
445 const size_t *_bmin_p;
446 const size_t *_bmax_p;
447 const size_t *_bdim_p;
448 const size_t *_dim_p;
454 size_t bx,
size_t by,
size_t bz
456 int _WriteBlock(
size_t bx,
size_t by,
size_t bz);
463 void EnableBuffering(
size_t count[3],
size_t divisor,
int rank);
468 ReadWriteThreadObj **_rw_thread_objs;
469 vector < vector <SignificanceMap> > _sigmapsThread;
470 vector <size_t> _sigmapsizes;
476 vector <Compressor *> _compressorThread3D;
477 vector <Compressor *> _compressorThread2DXY;
478 vector <Compressor *> _compressorThread2DXZ;
479 vector <Compressor *> _compressorThread2DYZ;
480 vector <Compressor *> _compressorThread;
481 vector <NCBuf *> _ncbufs;
484 VarType_T _compressorType;
487 size_t _validRegMin[3];
488 size_t _validRegMax[3];
493 vector <string> _ncpaths;
495 vector <int> _nc_sig_vars;
496 vector <int> _nc_wave_vars;
499 vector <float *> _cvectorThread;
500 unsigned char *_svector;
502 vector <unsigned char *> _svectorThread;
504 vector <float *> _blockThread;
507 vector <size_t> _ncoeffs;
508 vector <size_t> _cratios3D;
509 vector <size_t> _cratios2D;
510 vector <size_t> _cratios;
513 size_t _sliceBufferSize;
518 int _OpenVarWrite(
const string &basename);
519 int _OpenVarRead(
const string &basename);
520 int _WaveCodecIO(
int nthreads);
521 int _SetupCompressor();
524 VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill
528 VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill
531 void _FillPackedCoord(
532 VarType_T vtype,
const size_t src[3],
size_t dst[3],
size_t fill
539 #endif // _WaveCodeIO_h_
virtual void SetBoundaryPadOnOff(bool pad)
const float * GetDataRange() const
void SetCollectiveIO(bool newCollectiveIO)
A sub-region reader for VDF files.
Abstract base class for performing data IO to a VDC.
A class for managing data set metadata.