mod_mpi_wrapper.f90 Source File


Files dependent on this one

sourcefile~~mod_mpi_wrapper.f90~~AfferentGraph sourcefile~mod_mpi_wrapper.f90 mod_mpi_wrapper.f90 sourcefile~m_octree_mg_1d.f90 m_octree_mg_1d.f90 sourcefile~m_octree_mg_1d.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~m_octree_mg_2d.f90 m_octree_mg_2d.f90 sourcefile~m_octree_mg_2d.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~m_octree_mg_3d.f90 m_octree_mg_3d.f90 sourcefile~m_octree_mg_3d.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_amr_fct.f90 mod_amr_fct.f90 sourcefile~mod_amr_fct.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_coarsen_refine.f90 mod_coarsen_refine.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_amr_fct.f90 sourcefile~mod_functions_forest.f90 mod_functions_forest.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_functions_forest.f90 sourcefile~mod_ghostcells_update.f90 mod_ghostcells_update.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_load_balance.f90 mod_load_balance.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_load_balance.f90 sourcefile~mod_functions_connectivity.f90 mod_functions_connectivity.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_functions_connectivity.f90 sourcefile~mod_initialize_amr.f90 mod_initialize_amr.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_initialize_amr.f90 sourcefile~mod_multigrid_coupling.f90 mod_multigrid_coupling.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_multigrid_coupling.f90 sourcefile~mod_refine.f90 mod_refine.f90 sourcefile~mod_coarsen_refine.f90->sourcefile~mod_refine.f90 sourcefile~mod_convert.f90 mod_convert.f90 sourcefile~mod_convert.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_convert.f90->sourcefile~mod_functions_forest.f90 sourcefile~mod_convert_files.f90 mod_convert_files.f90 sourcefile~mod_convert_files.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_fix_conserve.f90 mod_fix_conserve.f90 sourcefile~mod_fix_conserve.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_functions_forest.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_functions_forest.f90->sourcefile~mod_functions_connectivity.f90 sourcefile~mod_ghostcells_update.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_input_output.f90 mod_input_output.f90 sourcefile~mod_input_output.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_input_output.f90->sourcefile~mod_convert_files.f90 sourcefile~mod_input_output.f90->sourcefile~mod_functions_forest.f90 sourcefile~mod_input_output.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_slice.f90 mod_slice.f90 sourcefile~mod_input_output.f90->sourcefile~mod_slice.f90 sourcefile~mod_collapse.f90 mod_collapse.f90 sourcefile~mod_input_output.f90->sourcefile~mod_collapse.f90 sourcefile~mod_particles.f90 mod_particles.f90 sourcefile~mod_input_output.f90->sourcefile~mod_particles.f90 sourcefile~mod_load_balance.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_load_balance.f90->sourcefile~mod_functions_forest.f90 sourcefile~mod_particle_base.f90 mod_particle_base.f90 sourcefile~mod_particle_base.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~mod_particle_base.f90->sourcefile~mod_slice.f90 sourcefile~mod_slice.f90->sourcefile~mod_mpi_wrapper.f90 sourcefile~agile.f90 agile.f90 sourcefile~agile.f90->sourcefile~mod_convert.f90 sourcefile~agile.f90->sourcefile~mod_convert_files.f90 sourcefile~agile.f90->sourcefile~mod_fix_conserve.f90 sourcefile~agile.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~agile.f90->sourcefile~mod_input_output.f90 sourcefile~mod_advance.f90 mod_advance.f90 sourcefile~agile.f90->sourcefile~mod_advance.f90 sourcefile~mod_amr_grid.f90 mod_amr_grid.f90 sourcefile~agile.f90->sourcefile~mod_amr_grid.f90 sourcefile~mod_initialize.f90 mod_initialize.f90 sourcefile~agile.f90->sourcefile~mod_initialize.f90 sourcefile~agile.f90->sourcefile~mod_initialize_amr.f90 sourcefile~agile.f90->sourcefile~mod_multigrid_coupling.f90 sourcefile~agile.f90->sourcefile~mod_particles.f90 sourcefile~mod_advance.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_advance.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_advance.f90->sourcefile~mod_particles.f90 sourcefile~mod_amr_grid.f90->sourcefile~mod_amr_fct.f90 sourcefile~mod_amr_grid.f90->sourcefile~mod_coarsen_refine.f90 sourcefile~mod_amr_grid.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_amr_grid.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_amr_grid.f90->sourcefile~mod_particles.f90 sourcefile~mod_collapse.f90->sourcefile~mod_slice.f90 sourcefile~mod_constrained_transport.f90 mod_constrained_transport.f90 sourcefile~mod_constrained_transport.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_constrained_transport.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_finite_volume_ffhd.f90 mod_finite_volume_ffhd.f90 sourcefile~mod_finite_volume_ffhd.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_finite_volume_hd.f90 mod_finite_volume_hd.f90 sourcefile~mod_finite_volume_hd.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_finite_volume_mhd.f90 mod_finite_volume_mhd.f90 sourcefile~mod_finite_volume_mhd.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_finite_volume_srhd.f90 mod_finite_volume_srhd.f90 sourcefile~mod_finite_volume_srhd.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_functions_connectivity.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_initialize.f90->sourcefile~mod_amr_fct.f90 sourcefile~mod_initialize.f90->sourcefile~mod_fix_conserve.f90 sourcefile~mod_initialize.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_initialize.f90->sourcefile~mod_input_output.f90 sourcefile~mod_initialize_amr.f90->sourcefile~mod_functions_forest.f90 sourcefile~mod_initialize_amr.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_initialize_amr.f90->sourcefile~mod_constrained_transport.f90 sourcefile~mod_initialize_amr.f90->sourcefile~mod_functions_connectivity.f90 sourcefile~mod_initialize_amr.f90->sourcefile~mod_multigrid_coupling.f90 sourcefile~mod_multigrid_coupling.f90->sourcefile~m_octree_mg_3d.f90 sourcefile~mod_particle_advect.f90 mod_particle_advect.f90 sourcefile~mod_particle_advect.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_particle_gca.f90 mod_particle_gca.f90 sourcefile~mod_particle_gca.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_particle_lorentz.f90 mod_particle_lorentz.f90 sourcefile~mod_particle_lorentz.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_particle_sample.f90 mod_particle_sample.f90 sourcefile~mod_particle_sample.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_particles.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_particles.f90->sourcefile~mod_particle_advect.f90 sourcefile~mod_particles.f90->sourcefile~mod_particle_gca.f90 sourcefile~mod_particles.f90->sourcefile~mod_particle_lorentz.f90 sourcefile~mod_particles.f90->sourcefile~mod_particle_sample.f90 sourcefile~mod_point_searching.f90 mod_point_searching.f90 sourcefile~mod_point_searching.f90->sourcefile~mod_particle_base.f90 sourcefile~mod_refine.f90->sourcefile~mod_amr_fct.f90 sourcefile~mod_refine.f90->sourcefile~mod_initialize_amr.f90 sourcefile~mod_source_ffhd.f90 mod_source_ffhd.f90 sourcefile~mod_source_ffhd.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_source_hd.f90 mod_source_hd.f90 sourcefile~mod_source_hd.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_source_mhd.f90 mod_source_mhd.f90 sourcefile~mod_source_mhd.f90->sourcefile~mod_ghostcells_update.f90 sourcefile~mod_source_srhd.f90 mod_source_srhd.f90 sourcefile~mod_source_srhd.f90->sourcefile~mod_ghostcells_update.f90

Source Code

module mod_mpi_wrapper
  ! This module is a temporary workaround for a bug in NVHPC 25.3:
  ! The runtime can fail when an offset is given to a buffer used in MPI
  ! commands. By using these wrappers, the actual MPI call has no offset.

  use mpi
  implicit none
  private

  public :: mpi_file_read_wrapper
  public :: mpi_file_read_at_wrapper
  public :: mpi_file_write_wrapper
  public :: mpi_irecv_wrapper
  public :: mpi_isend_wrapper
  public :: mpi_recv_wrapper
  public :: mpi_send_wrapper

contains

  subroutine mpi_file_read_wrapper(fh, buf, count, datatype, status, ierror)
    integer, intent(in)                              :: fh, count, datatype
    type(*), intent(inout)                           :: buf(..)
    integer, dimension(MPI_STATUS_SIZE), intent(out) :: status
    integer, optional, intent(out)                   :: ierror

    call MPI_FILE_READ(fh, buf, count, datatype, status, ierror)
  end subroutine mpi_file_read_wrapper

  subroutine mpi_file_read_at_wrapper(fh, offset, buf, count, datatype, status, ierror)
    integer, intent(in)                              :: fh, count, datatype
    integer(MPI_OFFSET_KIND), intent(in)             :: offset
    type(*), intent(inout)                           :: buf(..)
    integer, dimension(MPI_STATUS_SIZE), intent(out) :: status
    integer, optional, intent(out)                   :: ierror

    call MPI_FILE_READ(fh, buf, count, datatype, status, ierror)
  end subroutine mpi_file_read_at_wrapper

  subroutine mpi_file_write_wrapper(fh, buf, count, datatype, status, ierror)
    integer, intent(in)                              :: fh, count, datatype
    type(*), intent(in)                              :: buf(..)
    integer, dimension(MPI_STATUS_SIZE), intent(out) :: status
    integer, optional, intent(out)                   :: ierror

    call MPI_FILE_WRITE(fh, buf, count, datatype, status, ierror)
  end subroutine mpi_file_write_wrapper

  subroutine mpi_irecv_wrapper(buf, count, datatype, source, tag, comm, request, ierror)
    integer, intent(in)            :: count, source, tag, datatype, comm
    type(*), intent(inout)         :: buf(..)
    integer, intent(out)           :: request
    integer, optional, intent(out) :: ierror

    call MPI_IRECV(buf, count, datatype, source, tag, comm, request, ierror)
  end subroutine mpi_irecv_wrapper

  subroutine mpi_isend_wrapper(buf, count, datatype, dest, tag, comm, request, ierror)
    integer, intent(in)            :: count, dest, tag, datatype, comm
    type(*), intent(in)            :: buf(..)
    integer, intent(out)           :: request
    integer, optional, intent(out) :: ierror

    call MPI_ISEND(buf, count, datatype, dest, tag, comm, request, ierror)
  end subroutine mpi_isend_wrapper

  subroutine mpi_recv_wrapper(buf, count, datatype, source, tag, comm, status, ierror)
    integer, intent(in)                              :: count, source, tag, datatype, comm
    type(*), intent(inout)                           :: buf(..)
    integer, dimension(MPI_STATUS_SIZE), intent(out) :: status
    integer, optional, intent(out)                   :: ierror

    call MPI_RECV(buf, count, datatype, source, tag, comm, status, ierror)
  end subroutine mpi_recv_wrapper

  subroutine mpi_send_wrapper(buf, count, datatype, dest, tag, comm, ierror)
    integer, intent(in)            :: count, dest, tag, datatype, comm
    type(*), intent(in)            :: buf(..)
    integer, optional, intent(out) :: ierror

    call MPI_SEND(buf, count, datatype, dest, tag, comm, ierror)
  end subroutine mpi_send_wrapper

end module mod_mpi_wrapper