moab
|
Classes | |
struct | mhdf_EntDesc |
struct | mhdf_TagDesc |
struct | mhdf_ElemDesc |
struct | mhdf_FileDesc |
Typedefs | |
typedef void * | mhdf_FileHandle |
Opaque handle to an open file. | |
Functions | |
mhdf_FileHandle | mhdf_createFile (const char *filename, int overwrite, const char **elem_type_list, size_t elem_type_list_len, hid_t id_type, mhdf_Status *status) |
Create a new file. | |
mhdf_FileHandle | mhdf_openFile (const char *filename, int writable, unsigned long *max_id, hid_t id_type, mhdf_Status *status) |
Open an existing file. | |
mhdf_FileHandle | mhdf_openFileWithOpt (const char *filename, int writable, unsigned long *max_id, hid_t id_type, hid_t options, mhdf_Status *status) |
Open an existing file with options. | |
int | mhdf_countOpenHandles (mhdf_FileHandle h) |
Get number of open HDF5 objects from file. | |
struct mhdf_FileDesc * | mhdf_getFileSummary (mhdf_FileHandle file_handle, hid_t file_id_type, mhdf_Status *status) |
Get summary of data tables contained within file. | |
void | mhdf_fixFileDesc (struct mhdf_FileDesc *copy_ptr, const struct mhdf_FileDesc *orig_addr) |
Fix nested pointers for copied/moved FileDesc struct. | |
void | mhdf_getElemName (mhdf_FileHandle file_handle, unsigned int type_index, char *buffer, size_t buffer_size, mhdf_Status *status) |
Given an element type Id, get the name. Fails if buffer is not of sufficient size. | |
void | mhdf_closeFile (mhdf_FileHandle handle, mhdf_Status *status) |
Close the file. | |
int | mhdf_checkOpenHandles (mhdf_FileHandle handle, mhdf_Status *status) |
Check for open handles in file. | |
void | mhdf_closeData (mhdf_FileHandle file, hid_t handle, mhdf_Status *status) |
Common close function for all data handle types. | |
void | mhdf_getNextStartId (mhdf_FileHandle file, mhdf_index_t *start_id_out, mhdf_Status *status) |
Get start ID that will be assigned to next created dataset. | |
void | mhdf_writeHistory (mhdf_FileHandle file, const char **strings, int num_strings, mhdf_Status *status) |
Write the file history as a list of strings. | |
char ** | mhdf_readHistory (mhdf_FileHandle file, int *num_records_out, mhdf_Status *status) |
Read the file history as a list of strings. |
typedef void* mhdf_FileHandle |
int mhdf_checkOpenHandles | ( | mhdf_FileHandle | handle, |
mhdf_Status * | status | ||
) |
Check for open handles in file.
void mhdf_closeData | ( | mhdf_FileHandle | file, |
hid_t | handle, | ||
mhdf_Status * | status | ||
) |
Common close function for all data handle types.
Close an hid_t-type handle returned from any of the following functions. Any hid_t passed-back or returned must be closed via this function to avoid resource loss.
file | The file the object pointed to by the passed data handled exists int. |
handle | The data object to close. |
status | Passed back status of API call. |
void mhdf_closeFile | ( | mhdf_FileHandle | handle, |
mhdf_Status * | status | ||
) |
Close the file.
handle | The file to close. |
status | Passed back status of API call. |
int mhdf_countOpenHandles | ( | mhdf_FileHandle | h | ) |
Get number of open HDF5 objects from file.
mhdf_FileHandle mhdf_createFile | ( | const char * | filename, |
int | overwrite, | ||
const char ** | elem_type_list, | ||
size_t | elem_type_list_len, | ||
hid_t | id_type, | ||
mhdf_Status * | status | ||
) |
Create a new file.
Create a new HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss.
filename | The path and name of the file to create |
overwrite | If zero, will fail if the specified file already exists. If non-zero, will overwrite an existing file. |
elem_type_list | The list of element types that will be stored in the file. If the element name exits as a pre- defined constant (Common element type names.), that constant should be used. If a constant does not exist for the type, a similar naming pattern should be used (accepted name for type, first character uppercase, subsequent characters lowercase.) The element type index passed to mhdf_addElement is then an index into this list. The array may contain null entries to allow the caller some control over the assigned indices without creating dummy types which may confuse readers. |
elem_type_list_len | The length of elem_type_list . |
id_type | Type to use when creating datasets containing file IDs |
status | Passed back status of API call. |
void mhdf_fixFileDesc | ( | struct mhdf_FileDesc * | copy_ptr, |
const struct mhdf_FileDesc * | orig_addr | ||
) |
Fix nested pointers for copied/moved FileDesc struct.
This is a utility method to facility copying/moving/communicating struct FileDesc instances. The structure and all data it references are allocated in a single contiguous block of memory of size FileDesc::total_size. As such, the struct can be copied with a single memcpy, packed into a single network packet, communicated with a single MPI call, etc. However, the pointers contained within the struct will not be valid in the copied instance (they will still point into the original instance.) Given a pointer to the copied struct and the address of the original struct, this function will updated all contained pointers.
void mhdf_getElemName | ( | mhdf_FileHandle | file_handle, |
unsigned int | type_index, | ||
char * | buffer, | ||
size_t | buffer_size, | ||
mhdf_Status * | status | ||
) |
Given an element type Id, get the name. Fails if buffer is not of sufficient size.
file_handle | The file. |
type_index | The type index. Corresponds to indices into the element type list passed to mhdf_createFile. |
buffer | The buffer into which to copy the name. |
buffer_size | The length of buffer . |
status | Passed back status of API call. |
struct mhdf_FileDesc* mhdf_getFileSummary | ( | mhdf_FileHandle | file_handle, |
hid_t | file_id_type, | ||
mhdf_Status * | status | ||
) | [read] |
Get summary of data tables contained within file.
Returned struct, including all pointed-to data, is allocated in a single contiguous block of memory with a size equal to 'total_size'. Caller is responsible for freeing the returned struct FileDesc pointer (and *only* that pointer, not pointers nexted within the struct!). Caller may copy (e.g. MPI_BCast) entire struct as one contiguous block, assuming all nested pointers in the copy are updated to the correct relative offset from the beginning of the struct.
void mhdf_getNextStartId | ( | mhdf_FileHandle | file, |
mhdf_index_t * | start_id_out, | ||
mhdf_Status * | status | ||
) |
Get start ID that will be assigned to next created dataset.
Get the first_id parameter that will be returned from the next call to any of mhdf_createNodeCoords, mhdf_createConnectivity, mhdf_createPolyConnectivity, or mhdf_createSetMeta
mhdf_FileHandle mhdf_openFile | ( | const char * | filename, |
int | writable, | ||
unsigned long * | max_id, | ||
hid_t | id_type, | ||
mhdf_Status * | status | ||
) |
Open an existing file.
Open an existing HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss.
filename | The path and name of the file to open |
writable | If non-zero, open read-write. Otherwise read-only. |
status | Passed back status of API call. |
max_id | Used to pass back the maximum global ID used in the file. Provided as an indication to the caller of the size of the mesh. This parameter is optional. NULL may be passed. |
id_type | Type to use when creating datasets containing file IDs |
mhdf_FileHandle mhdf_openFileWithOpt | ( | const char * | filename, |
int | writable, | ||
unsigned long * | max_id, | ||
hid_t | id_type, | ||
hid_t | options, | ||
mhdf_Status * | status | ||
) |
Open an existing file with options.
Open an existing HDF mesh file. This handle must be closed with mhdf_closeFile
to avoid resource loss. This function allows the calling application to specify the HDF5 access property list that is passed to the HDF5 H5Fopen API. If this is passed as H5P_DEFAULT, the behavior is the same as mhdf_openFile . This argument is typically used to specify a parallel context for for writing the file in parallel.
filename | The path and name of the file to open |
writable | If non-zero, open read-write. Otherwise read-only. |
status | Passed back status of API call. |
max_id | Used to pass back the maximum global ID used in the file. Provided as an indication to the caller of the size of the mesh. This parameter is optional. NULL may be passed. |
options | The HDF5 access property list to use when opening the file. See the HDF5 documentation for H5Fopen. |
id_type | Type to use when creating datasets containing file IDs |
char** mhdf_readHistory | ( | mhdf_FileHandle | file, |
int * | num_records_out, | ||
mhdf_Status * | status | ||
) |
Read the file history as a list of strings.
Each entry is composed of four strings: application, version, date, and time.
Strings and array are allocated with malloc
. Caller must release them by calling free
file | The file. |
num_records_out | The length of the returned array. |
status | Passed back status of API call. |
void mhdf_writeHistory | ( | mhdf_FileHandle | file, |
const char ** | strings, | ||
int | num_strings, | ||
mhdf_Status * | status | ||
) |
Write the file history as a list of strings.
Each entry is composed of four strings: application, version, date, and time.
file | The file. |
strings | An array of null-terminated strings. |
num_strings | The length of strings |
status | Passed back status of API call. |