Main Page | Class List | File List | Class Members | File Members

H5Part.h File Reference

#include <hdf5.h>

Go to the source code of this file.

Classes

struct  H5PartFile

Defines

#define H5PART_READ   0x01
#define H5PART_WRITE   0x02
#define H5PartOpenFileSerial(x, y)   H5PartOpenFile(x,y)
#define H5PartResetView(f)   H5PartSetView(f,-1,-1)
#define H5PartHasView(f)   ((f->viewstart<0||f->viewend<0)?0:1)

Typedefs

typedef H5PartFile H5PartFile

Functions

H5PartFileH5PartOpenFile (const char *filename, unsigned flags)
int H5PartFileIsValid (H5PartFile *f)
void H5PartCloseFile (H5PartFile *f)
void H5PartSetNumParticles (H5PartFile *f, long long nparticles)
int H5PartWriteDataFloat64 (H5PartFile *f, char *name, double *array)
int H5PartWriteDataInt64 (H5PartFile *f, char *name, long long *array)
void H5PartSetStep (H5PartFile *f, int step)
int H5PartGetNumSteps (H5PartFile *f)
int H5PartGetNumDatasets (H5PartFile *f)
int H5PartGetDatasetName (H5PartFile *f, int index, char *name, int maxlen)
long long H5PartGetNumParticles (H5PartFile *f)
void H5PartSetView (H5PartFile *f, long long start, long long end)
int H5PartGetView (H5PartFile *f, long long *start, long long *end)
void H5PartSetCanonicalView (H5PartFile *f)
int H5PartReadDataFloat64 (H5PartFile *f, char *name, double *array)
int H5PartReadDataInt64 (H5PartFile *f, char *name, long long *array)
int H5PartReadParticleStep (H5PartFile *f, int step, double *x, double *y, double *z, double *px, double *py, double *pz, long long *id)
int H5PartWriteStepAttrib (H5PartFile *f, char *name, hid_t type, void *attrib, int nelem)
int H5PartWriteFileAttrib (H5PartFile *f, char *name, hid_t type, void *attrib, int nelem)
int H5PartWriteAttrib (H5PartFile *f, char *name, hid_t type, void *attrib, int nelem)
int H5PartWriteFileAttribString (H5PartFile *f, char *name, char *attrib)
int H5PartWriteStepAttribString (H5PartFile *f, char *name, char *attrib)
int H5PartGetNumStepAttribs (H5PartFile *f)
int H5PartGetNumFileAttribs (H5PartFile *f)
void H5PartGetStepAttribInfo (H5PartFile *f, int idx, char *name, size_t maxnamelen, hid_t *type, int *nelem)
void H5PartGetFileAttribInfo (H5PartFile *f, int idx, char *name, size_t maxnamelen, hid_t *type, int *nelem)
int H5PartReadStepAttrib (H5PartFile *f, char *name, void *data)
void H5PartReadAttrib (H5PartFile *f, char *name, void *data)
int H5PartReadFileAttrib (H5PartFile *f, char *name, void *data)
int H5PartStashFile (H5PartFile *f, char *filename)
int H5PartUnstashFile (H5PartFile *f, char *filename, char *outputpath)
int H5PartGetNumStashFiles (H5PartFile *f)
int H5PartFileGetStashFileName (H5PartFile *f, int nameindex, char *filename, int maxnamelen)


Define Documentation

#define H5PART_READ   0x01
 

#define H5PART_WRITE   0x02
 

#define H5PartHasView  )     ((f->viewstart<0||f->viewend<0)?0:1)
 

#define H5PartOpenFileSerial x,
 )     H5PartOpenFile(x,y)
 

#define H5PartResetView  )     H5PartSetView(f,-1,-1)
 


Typedef Documentation

typedef struct H5PartFile H5PartFile
 

/struct H5PartFile: This is an essentially opaque datastructure that acts as the filehandle for all practical purposes. It is created by H5PartOpenFile<xx>() and destroyed by H5PartCloseFile().


Function Documentation

void H5PartCloseFile H5PartFile f  ) 
 

H5PartCloseFile: closes an open file.

Parameters:
f filehandle of the file to close
Returns:
void

int H5PartFileGetStashFileName H5PartFile f,
int  nameindex,
char *  filename,
int  maxnamelen
 

int H5PartFileIsValid H5PartFile f  ) 
 

H5PartFileIsValid: checks if a file was successfully opened.

Parameters:
f filehandle of the file to check validity
Returns:
1 if success 0 if failure

int H5PartGetDatasetName H5PartFile f,
int  _index,
char *  name,
int  maxlen
 

H5PartGetDatasetName: This reads the name of a datasetes specified by it's index.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
_index integer specifying the index of the dataset. If the number of datasets is nds, the range of index is 0 to nds-1.
name A null-terminated string for the name of the dataset.
maxlen An integer specifying the maximum length of the name array.
Returns:
1 on success, 0 on failure.

void H5PartGetFileAttribInfo H5PartFile f,
int  idx,
char *  name,
size_t  maxname,
hid_t *  type,
int *  nelem
 

H5PartGetFileAttribInfo: gets the name, type and number of elements of a file attribute .

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
idx Index of the attribute
name A null-terminated string with the name of the attribute.
maxname The length of the attribute name.
type One of the following ones: H5T_NATIVE_DOUBLE H5T_NATIVE_INT64 H5T_NATIVE_CHAR.
nelem Number of elements of type "type".
Returns:
void.

int H5PartGetNumDatasets H5PartFile f  ) 
 

H5PartGetNumDatasets: This reads the number of datasetes that are stored at a particular time step.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
number of datasets.

int H5PartGetNumFileAttribs H5PartFile f  ) 
 

H5PartGetNumFileAttribs: gets the number of attributes bound to the file.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
number of attributes of the File.

long long H5PartGetNumParticles H5PartFile f  ) 
 

H5PartGetNumParticles: This gets the number of particles that are stored in the current timestep. It will arbitrarily select a timestep if you haven't already set the timestep with H5PartSetStep().

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
number of particles in current timestep.

int H5PartGetNumStashFiles H5PartFile f  ) 
 

H5PartGetNumStashFiles: returns the number of stashed files.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
Number of stashed files.

int H5PartGetNumStepAttribs H5PartFile f  ) 
 

H5PartGetNumStepAttribs: gets the number of attributes bound to the current step. The step has to be set with H5PartSetStep().

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
number of attributes of the current step.

int H5PartGetNumSteps H5PartFile f  ) 
 

H5PartGetNumSteps: This reads the number of datasteps that are currently stored in the datafile. (simple return of an int). It works for both reading and writing of files, but is probably only typically used when you are reading.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
number of timesteps currently stored in the file.

void H5PartGetStepAttribInfo H5PartFile f,
int  idx,
char *  name,
size_t  maxname,
hid_t *  type,
int *  nelem
 

H5PartGetStepAttribInfo: gets the name, type and number of elements of a step attribute .

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
idx Index of the attribute
name A null-terminated string with the name of the attribute.
maxname the length of the name of the attribute.
type One of the following ones: H5T_NATIVE_DOUBLE H5T_NATIVE_INT64 H5T_NATIVE_CHAR.
nelem Number of elements of type "type".
Returns:
void.

int H5PartGetView H5PartFile f,
long long *  start,
long long *  end
 

H5PartGetView: Allows you to query the current view. Start and End will be -1 if there is no current view established. Use H5PartHasView to see if the view is smaller than the total dataset.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
start start particle
end end particle
Returns:
the number of elements in the view

H5PartFile* H5PartOpenFile const char *  filename,
unsigned  flags
 

H5PartOpenFile: Opens file with specified filename. If you open with flag H5PART_WRITE, it will truncate any file with the specified filename and start writing to it. If you open with H5PART_READ, then it will open the file readonly.

H5PartFile should be treated as an essentially opaque datastructure. It acts as the file handle, but internally it maintains several key state variables associated with the file.

Parameters:
filename The name of the IEEEIO data file to open. The typical extension for these files is .h5
flags The accessmode for the file. This is one of 2 different access modes: H5PART_READ, H5PART_WRITE.
Returns:
A new filehandle with an open file or NULL if error.

void H5PartReadAttrib H5PartFile f,
char *  name,
void *  data
 

H5PartReadAttrib: reads a step attribute NOTE: it has been superseeded by H5PartReadStepAttrib.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string with the name of the attribute.
data of the attribute.
Returns:
1 on success, -1 on failure.

int H5PartReadDataFloat64 H5PartFile f,
char *  name,
double *  array
 

H5PartReadDataFloat64: This reads in an individual array from a particlar timestep. If you haven't selected a particular timestep, it will pick the current one.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the array. When retrieving datasets from disk, you ask for them by name. There are no restrictions on naming of arrays, but it is useful to arrive at some common naming convention when sharing data with other groups.
array A buffer to read array of particle data. The datatype for elements in the buffer is implicit in the name of the subroutine call.
Returns:
1 on success, 0 on failure.

int H5PartReadDataInt64 H5PartFile f,
char *  name,
long long *  array
 

H5PartReadDataInt64: This reads in an individual array from a particlar timestep. If you haven't selected a particular timestep, it will pick the current one.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the array. When retrieving datasets from disk, you ask for them by name. There are no restrictions on naming of arrays, but it is useful to arrive at some common naming convention when sharing data with other groups.
array A buffer to read array of particle data. The datatype for elements in the buffer is implicit in the name of the subroutine call.
Returns:
1 on success, 0 on failure.

int H5PartReadFileAttrib H5PartFile f,
char *  name,
void *  data
 

H5PartReadFileAttrib: reads a file attribute

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string with the name of the attribute.
data Value of the attribute.
Returns:
1 on success, -1 on failure.

int H5PartReadParticleStep H5PartFile f,
int  step,
double *  x,
double *  y,
double *  z,
double *  px,
double *  py,
double *  pz,
long long *  id
 

H5PartReadParticleStep: This is the mongo read function that pulls in all of the data for a given timestep in one shot. It also takes the timestep as an argument and will call H5PartSetStep() internally so that you don't have to make that call separately. See also: H5PartReadArray() if you want to just read in one of the many arrays.

int H5PartReadStepAttrib H5PartFile f,
char *  name,
void *  data
 

H5PartReadStepAttrib: reads a step attribute

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string with the name of the attribute.
data of the attribute.
Returns:
1 on success, -1 on failure.

void H5PartSetCanonicalView H5PartFile f  ) 
 

H5SetCanonicalView: If it is too tedious to manually set the start and end coordinates for a view, the H5SetCanonicalView() will automatically select an appropriate domain decomposition of the data arrays for the degree of parallelism and set the "view" accordingly.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
Returns:
void

void H5PartSetNumParticles H5PartFile f,
long long  nparticles
 

H5PartSetNumParticles: This function's sole purpose is to prevent needless creation of new HDF5 DataSpace handles if the number of particles is invariant throughout the sim. That's its only reason for existence. After you call this subroutine, all subsequent operations will assume this number of particles will be written.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
nparticles A long long integer specifying the number of particles
Returns:
void

void H5PartSetStep H5PartFile f,
int  step
 

H5PartSetStep: When writing data to a file the current time step must be set (even if there is only one). In a file with N time steps, the steps are numbered from 0 to N-1.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
step the time step to set.
Returns:
void

void H5PartSetView H5PartFile f,
long long  start,
long long  end
 

H5SetView: For parallel I/O or for subsetting operations on the datafile, the H5SetView subroutine allows you to define a subset of the total particle dataset to read. The concept of "view" works for both serial and for parallel I/O. The "view" will remain in effect until a new view is set, or the number of particles in a dataset changes, or the view is "unset" by calling H5SetView(file,-1,-1);

Before you set a view, the H5PartGetNumParticles will return the total number of particles in a file (even for the parallel reads). However, after you set a view, it will return the number of particles contained in the view.

The range is inclusive (the start and the end index).

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
start start particle
end end particle
Returns:
void

int H5PartStashFile H5PartFile f,
char *  filename
 

NOTE: it's missing the read! H5PartStashFile: stash a file in the hdf5 file. If it does not exists a UserData and a Files group will be created. /param f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel(). /param filename A null-terminated string for the name of the filename. /return 1 on succes, 0 on failure.

int H5PartUnstashFile H5PartFile f,
char *  filename,
char *  outputpath
 

H5PartUnstashFile: unstash a file in the hdf5 file. /param f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel(). /param filename A null-terminated string for the name of the filename. /param The path to the directory to create the file. /return 1 on succes, 0 on failure.

int H5PartWriteAttrib H5PartFile f,
char *  name,
hid_t  type,
void *  value,
int  nelem
 

H5PartWriteAttr: writes a step attribute. Note: this call has been superseeded by H5PartWriteStepAttr.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the attribute.
type One of H5T_NATIVE_DOUBLE, H5T_NATIVE_INT64, H5T_NATIVE_CHAR.
value Value of the attribute.
nelem Number of elements of type "type".
Returns:
1 on success, 0 on failure.

int H5PartWriteDataFloat64 H5PartFile f,
char *  name,
double *  array
 

H5PartWriteDataFloat64: After setting the number of particles with H5PartSetNumParticles() and the current timestep using H5PartSetStep(), you can start writing datasets into the file. Each dataset has a name associated with it (chosen by the user) in order to facilitate later retrieval. The writing routines also implicitly store the datatype of the array so that the array can be reconstructed properly on other systems with incompatible type representations. The data is committed to disk before the routine returns. All data that is written after setting the timestep is associated with that timestep. While the number of particles can change for each timestep, you cannot change the number of particles in the middle of a given timestep.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the array. When retrieving datasets from disk, you ask for them by name. There are no restrictions on naming of arrays, but it is useful to arrive at some common naming convention when sharing data with other groups.
array A buffer containing an array of particle data to commit to disk. The datatype for elements in the buffer is implicit in the name of the subroutine call.
Returns:
1 on success, 0 on failure.

int H5PartWriteDataInt64 H5PartFile f,
char *  name,
long long *  array
 

H5PartWriteDataInt64: After setting the number of particles with H5PartSetNumParticles() and the current timestep using H5PartSetStep(), you can start writing datasets into the file. Each dataset has a name associated with it (chosen by the user) in order to facilitate later retrieval. The writing routines also implicitly store the datatype of the array so that the array can be reconstructed properly on other systems with incompatible type representations. The data is committed to disk before the routine returns. All data that is written after setting the timestep is associated with that timestep. While the number of particles can change for each timestep, you cannot change the number of particles in the middle of a given timestep.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the array. When retrieving datasets from disk, you ask for them by name. There are no restrictions on naming of arrays, but it is useful to arrive at some common naming convention when sharing data with other groups.
array A buffer containing an array of particle data to commit to disk. The datatype for elements in the buffer is implicit in the name of the subroutine call.
Returns:
1 on success, 0 on failure.

int H5PartWriteFileAttrib H5PartFile f,
char *  name,
hid_t  type,
void *  value,
int  nelem
 

H5PartWriteStepAttr: writes a string attribute bound to a step.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the attribute.
type One of H5T_NATIVE_DOUBLE, H5T_NATIVE_INT64, H5T_NATIVE_CHAR.
value Value of the attribute.
nelem Number of elements of type "type".
Returns:
1 on success, 0 on failure.

int H5PartWriteFileAttribString H5PartFile f,
char *  name,
char *  attrib
 

H5PartWriteFileAttribString: writes a string attribute bound to a file.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the attribute.
attrib A null-terminated string for the attribute.
Returns:
1 on success, 0 on failure.

int H5PartWriteStepAttrib H5PartFile f,
char *  name,
hid_t  type,
void *  value,
int  nelem
 

H5PartWriteStepAttrib: writes a step attribute.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the attribute.
type One of H5T_NATIVE_DOUBLE, H5T_NATIVE_INT64, H5T_NATIVE_CHAR.
value Value of the attribute.
nelem Number of elements of type "type".
Returns:
1 on success, 0 on failure.

int H5PartWriteStepAttribString H5PartFile f,
char *  name,
char *  attrib
 

H5PartWriteStepAttrString: writes a string attribute bound to the current step.

Parameters:
f A FileHandle opened by H5PartOpenFile() or H5PartOpenFileParallel().
name A null-terminated string for the name of the attribute.
attrib A null-terminated string for the attribute.
Returns:
1 on success, 0 on failure.


Generated on Tue Jan 31 11:52:45 2006 for H5Part by  doxygen 1.4.4