Source file inout.F90
The source file inout.F90 contains the routines to store and reload
a complete data set sufficient for a restart. For efficiency reasons the
data is split into a large number of files which can be accessed in parallel.
-
Subroutines input, output:
The subroutines input and output are the main entry points,
they read or write a complete data set from or to disk.
-
Subroutines readfield, writefield, readparticles, writeparticles:
Support routines to read/write field or particle data, called by input
and
output.
Switches:
-
head: This parameter defines the leading part of the name of the
output files. The usual choice is #define head 'p3d'.
-
nchannels: The parameter nchannels determines to how many
files the output is directed. For good performance on a T3E system use
#define
nchannels 32.
-
bufsize: The size of the internal transfer buffer, it should be
small compared to maxparticles (compare source file modules.F90)
to save memory but large enough for efficient operation. #define bufsize
5000 is the standard value. bufsize must not be altered between
storing and reloading the data.
-
USE_OLD_IO: This switch is kept for compatibility reasons and allows
to process data obtained with an earlier version of the code (version 1
with communication implemented in CRAY specific shmem routines).
Do not use it unless you want to use old data.
Remarks:
-
It is possible to read data from a previous run with a different domain
decomposition or number of processors, provided the total number of grid
points in all three directions in space is unchanged and the memory is
sufficiently large to store all particles.
-
To obtain acceptable I/O performance write the data to more than one file.
The parameter nchannel must not change between storing and reloading
the data. Using too many output files (e.g. 512) may overload the I/O hardware
of the system.
-
Every I/O channel is associated with a dedicated processor (proc_num=mod(nchannels-1,n_pes)),
which is carrying out all filesystem operations for the data belonging
to this channel, including the gathering and distribution from/to the corresponding
processors. For scalar and vector fields the channels are mapped on the
data with reference to the global mesh coordinates. More precisely,
the data grid is structured into x-y slices stacked in increasing z-direction
whereby channel c corresponds to all z-slices for which c=mod(z,nchannels)+1.
The particle data (rvi, rve)follow a different scheme which is based
on processor numbers. The particle ensemble contained in the particle buffer
of processor pe is read/written en bloc over channel c=mod(pe,nchannels)+1,
successively incrementing pe.