This repository contains a case study of parallel I/O kernel from the WRF climate simulation model.
Below is an exmaple.
autoreconf -i
./configure \
--with-mpi=${HOME}/mpich/4.1.1 \
--with-pnetcdf=${HOME}/pnetcdf/1.12.3 \
--prefix=${HOME}/WRF_IO
# or on Perlmutter:
MPICC=cc \
MPICXX=CC \
./configure \
--with-pnetcdf=${HOME}/pnetcdf/1.12.3 \
--prefix=${HOME}/WRF_IO
make
make install--with-mpi=/path/to/implementation
The installation prefix path for MPI implementation.
--with-pnetcdf[=INC,LIB | =DIR]
Provide the PnetCDF installation path(s):
--with-pnetcdf=INC,LIB for include and lib paths
separated by a comma. --with-pnetcdf=DIR for the
path containing include/ and lib/ subdirectories.
[default: enabled]
--enable-logging Enable logging feature. Process 0 will log some important
events (creating a file, writing a file, etc)
[default: disabled]
--enable-debug Enable WRF_IO internal debug mode. (compile with -g -O0
option) [default: disabled]
HDF5 is not yet supported.
# the following export might be redundent
exdport LD_LIBRARY_PATH=${PNC_DIR}/lib:${LD_LIBRARY_PATH}
# mpirun -np [num_processes] [path/to/wrf_io] [path/to/config.json]
# a config.json file is available under examples folder
mpirun -np 2 wrf_io config.json
# content of config.json
cat config.json
{
"api": "pnc_nb",
"strategy": "canonical",
"ts_total": 360,
"ts_hist_interval": 30,
"ts_rst_interval": 3600,
"ts_per_hist_file": 10000,
"e_we": 55,
"e_sn": 67,
"sleep_seconds": 0,
"out_prefix": "./wrfout_",
"var_def_file": "./header.json",
"debug_level": 30
}api: currently only supportpnc_nb, which stands for PnetCDF non-blocking apis. Will support PnetCDF blocking apis, HDF5, etc in the future.strategy: currently not used.ts_total: num of total simulation time steps.ts_hist_interval: the wrf_io program will write to the history file everyts_hist_intervaltime steps. So the toal time steps of history file(s) would be1 + int(ts_total / ts_hist_interval).ts_rst_interval: the wrf_io program will write to the restart file everyts_rst_intervaltime steps. Ifts_rst_interval > ts_total, then no restart file will be generated.ts_per_hist_file: how many time steps a history file can maximumly contain.e_weande_sn: grid sizessleep_seconds: time to sleep per time step, to simulate computation. Currently not used.out_prefix: prefix of output files, for example, we can set to/pscratch/sd/u/user_name/FS_1M_8/wrf_io_var_def_file: path to theheader.jsonfile. Theheader.jsonfile is the json version of a NetCDF file header. An exampleheader.jsonis under theexamplesfolder, which is produced by converting the header of a valid WRF output (exmamples/header.txt) using the python programexamples/parse_header.py.debug_level: (later will be renamed tologging_level) possible options:0,10,20,30, and40. The higher the more details when process 0 outputs logging. Only takes effect when the program is configured with--enable-logging.
For both the config.json file and the header.json file,
WRF_IO will use process 0 to read the files, and broadcast the contents to other processes.
- add profiling
- add other I/O options (pnc-b, hdf5, adios, etc)