DISPATCH
mpi_io_mod Module Reference

Module for handling blocking and non-blocking MPI parallel I/O to a single file. The module is initialized by specifying the chunk size (which can be 1- or 3-dimensional). A chunk could be just a patch, or a single chunk of data per rank. More...

Data Types

type  iwrite_list_t
 
type  iwrite_t
 
type  mpi_io_t
 

Variables

character(len=32), save fmt ='(1x,a,4i8,1p,5e12.3)'
 
type(mpi_io_t), public mpi_io
 

Detailed Description

Module for handling blocking and non-blocking MPI parallel I/O to a single file. The module is initialized by specifying the chunk size (which can be 1- or 3-dimensional). A chunk could be just a patch, or a single chunk of data per rank.

The module can be used to handle any collection of patches, by using the patchid number to map each patch into the file. If the patch sizes are fixed, this is a unique mapping, and if each snapshot is written into a separate file this is also sufficiently general. The header part of the file may be written to a separate file.

Typical multi-threaded use:

type(mpi_file_t):: file ! holds file info type(mpi_io_t):: thread_io ! holds thread info !$omp threadprivate (thread_io) ! threadprivate data type ... call fileopenw ('some_file.dat') ! implicit MPI barrier call thread_iouse (file) ! all threads use the same file ... call thread_ioinit (snapshot_size, patch_size) ! define offset factors call thread_iowrite (patch_data, iout1, id1) ! write snapshot iout1, patch id1 ... call thread_ioread (patch_data, iout2, id2) ! read snapshot iout2, patch id2 ... !$omp barrier ! all threads must agree call fileclose ! implicit MPI barrier