next up previous
Next: Partition Quality Analysis Routines Up: PMDB User's Manual Previous: Visualization

Miscellaneous Routines

Reading and Writing Compressed Files from PMDB

PMDB has the capability to read and write files which are compressed with the UNIX compress or GNU's gzip utilities. Input files which are not found are automatically checked for the same files with .Z and .gz extensions. If the compressed version of the file is found, it is passed through the appropriate uncompression, and an uncompressed copy of each file is written to temporary space. Once the file has been read in, the uncompressed copy of the file is deleted.

On output, by default, files are not compressed. However, if the operator pmdb_set_output_compression() has been called, all output files are first written to temporary space, compressed with the desired utility, then moved into the desired location.


void pmdb_set_output_compression(
int compression_type)   /* IN */
This routine sets the compression type to be used in subsequent file writes. The following are the valid compression types:

ArgumentType of Compression Used
PMDB_UNCOMPRESSED_OUTPUTDo not compress output.
PMDB_GZIP_OUTPUTCompress using gzip
PMDB_GZIP9_OUTPUTCompress using gzip -9
PMDB_COMPRESS_OUTPUTCompress using compress

The default paths to the commands needed by PMDB to read and write the compressed files, and the default path to the temporary space to use, are defined in the PMDB header file pmdb_config.h at library-compile time. If the library is already compiled with command strings that are invalid, they can all be overwritten by setting the following environment variables:

Environment VariableCommand
PMDB_ZCAT_EXE_PATHPath to zcat command. It is best to use gunzip -c, if possible, since it can handle both UNIX compress and gzip format compressed files.
PMDB_ZCAT_TMP_PATHLocation to write temporary files. Having this on a local disk can significantly improve performance.
PMDB_GZIP_EXE_PATHPath to the gzip command.
PMDB_GZIP9_EXE_PATHPath to the gzip -9 command.
PMDB_COMPRESS_EXE_PATHPath to the compress command.
PMDB_MV_COMMANDPath to the mv command. This is used to move the compressed files from the temporary space to the desired output location. It must have the capability to move files across filesystems if the temp path and destination are on different filesystems.

Other operators


pMesh pmdb_get_pmesh(
pMeshPB pmeshpb)      /* IN */
Retrieves the Mesh Database mesh pointer for the mesh on each processor.


char *pmdb_version(
int *major,       /* OUT */
int *minor)       /* OUT */
This function retrieves the version information about the current version of PMDB. A major and minor version number are returned in major and minor respectively. The return value is a pointer to a string containing the current version information.


FILE *pmdb_gracefully_open(
char *file,      /* IN */
char *mode)      /* IN */
This function opens a file, just like fopen but with error checking provided.


long pmdb_total_entities(
pMeshPB pmeshpb, /* IN */
eType etype)     /* IN */
This function returns the total number of the given entity type etype, (Tvertex, Tedge, Tface, Tregion) in the distributed mesh across all processors.



Jim Teresco
Wed Nov 29 08:51:10 EST 1995