debug_io_mpi

Module

Description

$Id$

!! debug_io_mpi.f90 !!!

Parallel debug-IO via MPI2 (i.e. write to a single file in data/allprocs)

The file format written by output() (and used, e.g. in var.dat) consists of the followinig Fortran records:

  1. data(mxgrid,mygrid,mzgrid,nvar)

  2. t(1), x(mxgrid), y(mygrid), z(mzgrid), dx(1), dy(1), dz(1)

  3. deltay(1) [optional: if lshear==.true.]

Here nvar denotes the number of slots, i.e. 1 for one scalar field, 3 for one vector field, 8 for var.dat in the case of MHD with entropy.

11-Dec-2011/Bourdin.KIS: moved debug-IO from ‘io_mpio’ into separate module

Quick access

Variables:

data_start, fhandle, io_filetype, io_filetype_v, io_initialized, io_memtype, io_memtype_v, output_pencil, output_penciled_scal_c, output_penciled_vect_c

Routines:

commit_gridio_types(), commit_io_type_vect(), commit_io_type_vect_1d(), output_pencil_scal(), output_pencil_vect(), output_scal(), output_vect(), read_grid_data(), write_grid_data(), write_record_info()

Needed modules

Variables

  • debug_io/data_start [integer,optional/default=4]
  • debug_io/fhandle [integer]
  • debug_io/ierr [integer]
  • debug_io/io_filetype [integer]
  • debug_io/io_filetype_v [integer]
  • debug_io/io_initialized [logical,optional/default=.false.]
  • debug_io/io_memtype [integer]
  • debug_io/io_memtype_v [integer]
  • debug_io/lun_input [integer,public/optional/default=89]
  • debug_io/lun_output [integer,public/optional/default=92]
  • debug_io/output [public]

    Overload the `output’ function

  • debug_io/output_pencil [public]

    Overload the `output_pencil’ function

  • debug_io/output_penciled_scal_c [external]
  • debug_io/output_penciled_vect_c [external]
  • debug_io/status (mpi_status_size) [integer]

Subroutines and functions

subroutine  debug_io/commit_io_type_vect(nv)

For a new value of nv, commit MPI types needed for output_vect(). If called with the same value of nv as the previous time, do nothing. 20-sep-02/wolf: coded

Parameters:

nv [integer,in]

Called from:

output_vect(), commit_io_type_vect(), commit_io_type_vect_1d()

Call to:

stop_it(), register_io(), commit_io_type_vect(), write_record_info(), output_penciled_vect_c(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/commit_io_type_vect_1d(nr, nv)

For a new value of nv, commit MPI types needed for output_vect(). If called with the same value of nv as the previous time, do nothing. 20-sep-02/wolf: coded

Parameters:
  • nr [integer,in]

  • nv [integer,in]

Call to:

stop_it(), register_io(), commit_io_type_vect(), write_record_info(), output_penciled_vect_c(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/output_vect(file, a, nv)
Write snapshot file; currently without ghost zones and grid.

Looks like we need to commit the MPI type anew each time we are called,

since nv may vary.

20-sep-02/wolf: coded

Parameters:
  • file [character,in] :: not used

  • a (mx,my,mz,nv) [real,in]

  • nv [integer,in,]

Use :

mpicomm (stop_it())

Call to:

stop_it(), register_io(), commit_io_type_vect(), write_record_info(), output_penciled_vect_c(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/output_scal(file, a, nv)

Write snapshot file; currently without ghost zones and grid

20-sep-02/wolf: coded

Parameters:
  • file [character,in] :: not used

  • a (mx,my,mz) [real,in]

  • nv [integer,in]

Use :

mpicomm (stop_it())

Call to:

stop_it(), register_io(), write_record_info(), output_penciled_vect_c(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/output_pencil_vect(file, a, ndim)

Write snapshot file of penciled vector data (for debugging). Wrapper to the C routine output_penciled_vect_c.

15-feb-02/wolf: coded

$ use OMP_lib, only: omp_in_parallel

Parameters:
  • file [character,in] :: not used

  • a (nx,ndim) [real,in]

  • ndim [integer,in,]

Call to:

output_penciled_vect_c(), stop_it(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/output_pencil_scal(file, a, ndim)

Write snapshot file of penciled scalar data (for debugging). Wrapper to the C routine output_penciled_scal_c.

15-feb-02/wolf: coded

Parameters:
  • file [character,in] :: not used

  • a (nx) [real,in]

  • ndim [integer,in]

Use :

mpicomm (stop_it())

Call to:

stop_it(), output_penciled_scal_c(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/write_record_info(file, nv)

Add record markers and time to file, so it looks as similar as possible/necessary to a file written by io_dist.f90. Currently, we don’t handle writing the grid, but that does not seem to be used anyway.

Parameters:
  • file [character,in] :: not used

  • nv [integer,in]

Use :

mpicomm (stop_it())

Called from:

output_vect(), output_scal(), commit_io_type_vect(), commit_io_type_vect_1d()

Call to:

stop_it(), commit_gridio_types(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/commit_gridio_types(nglobal, nlocal, mlocal, ipvar, filetype, memtype)

define MPI data types needed for MPI-IO of grid files 20-sep-02/wolf: coded

Parameters:
  • nglobal [integer]

  • nlocal [integer]

  • mlocal [integer]

  • ipvar [integer]

  • filetype [integer]

  • memtype [integer]

Called from:

output_vect(), output_scal(), output_pencil_vect(), output_pencil_scal(), commit_io_type_vect(), commit_io_type_vect_1d(), write_record_info(), commit_gridio_types(), write_grid_data(), read_grid_data()

Call to:

commit_gridio_types(), stop_it(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/write_grid_data(file, nglobal, nlocal, mlocal, ipvar, var)

write grid positions for var to file 20-sep-02/wolf: coded

Parameters:
  • file [character] :: not used

  • nglobal [integer]

  • nlocal [integer]

  • mlocal [integer]

  • ipvar [integer]

  • var (*) [real] :: x, y or z

Use :

mpicomm (stop_it())

Called from:

output_vect(), output_scal(), output_pencil_vect(), output_pencil_scal(), commit_io_type_vect(), commit_io_type_vect_1d(), write_record_info(), commit_gridio_types(), write_grid_data(), read_grid_data()

Call to:

commit_gridio_types(), stop_it(), write_grid_data(), outlog(), read_grid_data()

subroutine  debug_io/read_grid_data(file, nglobal, nlocal, mlocal, ipvar, var)

read grid positions for var to file 20-sep-02/wolf: coded

Parameters:
  • file [character] :: not used

  • nglobal [integer]

  • nlocal [integer]

  • mlocal [integer]

  • ipvar [integer]

  • var (*) [real] :: x, y or z

Called from:

output_vect(), output_scal(), output_pencil_vect(), output_pencil_scal(), commit_io_type_vect(), commit_io_type_vect_1d(), write_record_info(), commit_gridio_types(), write_grid_data(), read_grid_data()

Call to:

commit_gridio_types(), write_grid_data(), outlog(), read_grid_data(), stop_it()

subroutine  debug_io/wgrid(file)

Write processor-local part of grid coordinates. 21-jan-02/wolf: coded

Parameters:

file [character]

Use :

cdata (directory(), dx(), dy(), dz())

Call to:

write_grid_data(), outlog(), read_grid_data(), stop_it()

subroutine  debug_io/rgrid(file)

Read processor-local part of grid coordinates. 21-jan-02/wolf: coded

Parameters:

file [character]

Use :

cdata (directory(), dx(), dy(), dz(), ip())

Call to:

read_grid_data(), stop_it(), outlog()