|
vlread_block
NAME
vlread_block - Read in a volume data file
and distribute the data blocks into all the processor's local memory
SYNOPSIS
#include <parvox.h>
vlvolume* vlread_block(char* filename, short
start_time, short end_time, short step,
short num_blocks, short idim, short jdim, short kdim,
void* voxel_info,
int flag )
DESCRIPTION
vlread_block()
reads in multiple time-steps, 3-D data files with file prefix filename.
filename
is a string format in C syntax. For instance, if the input files
are named input000.vox.nc, input001.vox.nc, etc.... filename should
be "input%03d.vox.nc". start_time,
end_time
and step indicates
the starting time step, the ending time step and the time step interval.
For instance, if we want to read every other time step starting from 100
to 200, start_time,
end_time,
and step
will be 100, 200, and 2, respectively. The NetCDF file has
a default extension ".vox.nc", if no extension is given in filename,
the system will add the extension automatically. The input file can
also be in raw format with a binary header of vlmeta_voxel4d
data structure. The raw data file has a default extension, ".vox.raw".
The file type is specified by flag.
flag
can be either VL_NETCDF or VLRAW. The raw file format is supported
for better input performance since the NetCDF library on the Cray T3D and
T3E is not scalable for more than 64 PEs. A utility program nc2raw
can be used to convert a NetCDF input file into a raw format. Note
that the raw file can only be used on the machine where the file was converted
since the header of the raw input file is machine dependent.
num_blocks,
idim,
jdim,
and kdim
define the block size for data decomposition. ParVox supports interleaving
block distribution. In other words, the volume is decomposed into
small blocks and the blocks are card dealt to each processor's local memory.
There are two ways to specify the block dimension, fixed number of blocks
per processor or fixed block size. If num_blocks
is a positive number, the first way, i.e., fixed number of blocks
per processor, is used. The system will determine the block size
based on the dimension of the volume and the total number of processors.
The algorithm will calculate a optimal block size closest a cubic shape;
due to the volume dimension, the algorithm may not be able to come out
with exactly the same number of blocks as specified. It may be one
more or less than the required number. If num_blocks
is less or equal to zero, idim,
jdim,
and kdim
will be used as the block dimension. Note that sometimes it is desirable
to select a fixed block dimension for the best data distribution, but each
processor will be assigned fewer number of blocks with increasing number
of processors; which may results in poor load balancing in some cases.
voxel_info
is a pointer to a data structure of
type vlmeta_voxel4d. vlmeta_voxel4d,
defined in vlmeta.h, is a data structure containing all the meta information
and the data of a volume. User has to declare a vlmeta_voxel4d
variable and pass its address to vlread_block(). vlread_block()
will fill in all the meta information by calling vlmget_dim4d(),
then calls vlcreate_volume() to create
the vlvolume data structure with the volume dimension defined in *voxel_info,
calculates the block size based on the given information, and then reads
in the data volume using a set of reader processors and redistributes the
data into its destined processors.
SEE ALSO
vlcreate_volume,
vlset_spacing, vlset_range,
vlmget_dim4d, vlmeta_intro
BACK TO INDEX
|
|