piovdc Module

@file piovdc.F90 @author Yannick Polius ypolius@ucar.edu @version $Revision$ @date $LastChangedDate$ @brief The piovdc library for writing Vapor Data Collection (VDC) 2 data files https://wiki.ucar.edu/display/dasg/PIOVDC
@details The piovdc library is used to write VDC2 data files in a parallel manner using PIO. After the prerequisite library functions are used, a call to pio_writedarray is made, writing the passed data to an on disk VDC2 collection.
PRE-REQUISITES:
VDF meta-file must be generated, using either rawtovdf or vdfcreate if advanced features (wavelet type, compression ratios, or boundary type) are needed VDF file requires VDC version to be 2, and requires the Waveletname, WaveletBoundaryMode, CompressionRations, and NumTransforms to be set.
POST-EFFECTS:
After a successful write, VDC2 data will be in a directory located in the same directory as the vdf file, using the vdf name, appended with _data (ex. ghost.vdf generates VDC2 data in the dir ghost_data in the vdf dir) If no compression is enabled, a single, uncompressed file will be generated using PIO instead of a VDC


Uses


Variables

Type Visibility Attributes Name Initial
integer(kind=i4), public :: vdc_dims(3)
integer(kind=i4), public :: vdc_bsize(3)
integer(kind=i4), public :: vdc_ts
integer(kind=PIO_OFFSET), public :: vdc_iostart(3)
integer(kind=PIO_OFFSET), public :: vdc_iocount(3)

Subroutines

public subroutine adjust_bounds(global_dims, start, count, rank)

@brief subroutine checks start/count for out of bounds, adjusts if the start/count is too high, zeroes start if it is invalid POST-EFFECTS:
all start/counts are now legal, non-IO tasks have zeroed start counts @param[in] global_dims int(3) global grid dimensions @param[in] rank int rank of current MPI task @param[inout] start int(3) current MPI task global start @param[inout] count int(3) current MPI task global count

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in), dimension(:) :: global_dims
integer(kind=PIO_OFFSET), intent(inout), dimension(:) :: start
integer(kind=PIO_OFFSET), intent(inout), dimension(:) :: count
integer(kind=i4), intent(in) :: rank

public subroutine auto_get_start_count(rank, nioprocs, block_dims, start, count, bsize, data_dims)

@brief subroutine that, given a global grid, VDC blocksize, and max # of nioprocs, will automatically create an VDC optimized IO decomposition that uses the most possible IO tasks POST-EFFECTS:
Each MPI Task is now either and IO task or a computational task. IO tasks have nonzero start/counts @param[in] rank int rank of the current MPI task @param[inout] nioprocs int represents the max possible # of IO procs, @algorithm will try to get as close as possible to this # and return it in nioprocs @param[in] blockdims int(3) global grid dimensions represented as VDC blocks @param[out] start int(3) iostart for the current MPI task @param[out] count int(3) iocount for the current MPI task @param[in] bsize int(3) VDC block size

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: rank
integer(kind=i4), intent(inout) :: nioprocs
real(kind=r4), intent(in), dimension(:) :: block_dims
integer(kind=PIO_OFFSET), intent(out) :: start(3)
integer(kind=PIO_OFFSET), intent(out) :: count(3)
integer(kind=i4), intent(in), dimension(:) :: bsize
integer(kind=i4), intent(in), dimension(:) :: data_dims

public subroutine init_vdc2(rank, data_dims, vdc_bsize, iostart, iocount, ioprocs)

@brief subroutine that prepares the global grid to be split by the auto_start_count routine POST-EFFECTS:
A valid IO decomposition is created that can be used with PIO @param[in] rank int rank of the current @param[in] data_dims int(3) size of the global grid @param[in] vdc_bsize int(3) VDC block size @param[out] iostart int(3) IO start for the current MPI task @param[out] iocount int(3) IO count for the current MPI task @param[inout] ioprocs int max # of IO procs, gets returned as the actual # used

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: rank
integer(kind=i4), intent(in), dimension(:) :: data_dims
integer(kind=i4), intent(in), dimension(:) :: vdc_bsize
integer(kind=PIO_OFFSET), intent(out) :: iostart(3)
integer(kind=PIO_OFFSET), intent(out) :: iocount(3)
integer(kind=i4), intent(inout) :: ioprocs