Class mpi_wrapper
In: setup/mpi_wrapper.f90

MPI 関連ルーチン

MPI related routines

Note that Japanese and English are described in parallel.

MPI 関係の変数の管理と MPI 関係ラッパールーチンのモジュール.

This is a module containing MPI-related variables and wrapper routines.

Procedures List

!$ ! RadiationFluxDennouAGCM :放射フラックスの計算
!$ ! RadiationFinalize :終了処理 (モジュール内部の変数の割り付け解除)
!$ ! ———— :————
!$ ! RadiationFluxDennouAGCM :Calculate radiation flux
!$ ! RadiationFinalize :Termination (deallocate variables in this module)

NAMELIST

!$ ! NAMELIST#radiation_DennouAGCM_nml

Methods

Included Modules

dc_types mpi

Public Instance methods

Subroutine :

MPI の終了処理

Finalization of MPI

[Source]

  subroutine MPIWrapperFinalize
    !
    ! MPI の終了処理
    !
    ! Finalization of MPI
    !

    ! モジュール引用 ; USE statements
    !

    ! 作業変数
    ! Work variables
    !
    integer :: ierr

    call mpi_finalize( ierr )

  end subroutine MPIWrapperFinalize
Subroutine :
idep :integer , intent(in )
: Process number of departure
im :integer , intent(in )
: Size of 1st dimension of received data
buf( im ) :real(DP), intent(out)
: Array to be received
ireq :integer , intent(out)
: Request number

1D 倍精度配列の非ブロッキング通信(受信)

Non-blocking transfer (receive) of real(8) 1D array

[Source]

  subroutine MPIWrapperIRecv_dble_1d( idep, im, buf, ireq )
    !
    ! 1D 倍精度配列の非ブロッキング通信(受信)
    !
    ! Non-blocking transfer (receive) of real(8) 1D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idep
                              ! Process number of departure
    integer , intent(in ) :: im
                              ! Size of 1st dimension of received data
    real(DP), intent(out) :: buf( im )
                              ! Array to be received
    integer , intent(out) :: ireq
                              ! Request number


    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_irecv( buf, isize, mpi_double_precision, idep, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperIRecv_dble_1d
Subroutine :
idep :integer , intent(in )
: Process number of destination
im :integer , intent(in )
: Size of 1st dimension of received data
jm :integer , intent(in )
: Size of 2nd dimension of received data
buf( im, jm ) :real(DP), intent(out)
: Array to be received
ireq :integer , intent(out)
: Request number

2D 倍精度配列の非ブロッキング通信(受信)

Non-blocking transfer (receive) of real(8) 2D array

[Source]

  subroutine MPIWrapperIRecv_dble_2d( idep, im, jm, buf, ireq )
    !
    ! 2D 倍精度配列の非ブロッキング通信(受信)
    !
    ! Non-blocking transfer (receive) of real(8) 2D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idep
                              ! Process number of destination
    integer , intent(in ) :: im
                              ! Size of 1st dimension of received data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of received data
    real(DP), intent(out) :: buf( im, jm )
                              ! Array to be received
    integer , intent(out) :: ireq
                              ! Request number

    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_irecv( buf, isize, mpi_double_precision, idep, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperIRecv_dble_2d
Subroutine :
idep :integer , intent(in )
: Process number of departure
im :integer , intent(in )
: Size of 1st dimension of received data
jm :integer , intent(in )
: Size of 2nd dimension of received data
km :integer , intent(in )
: Size of 3rd dimension of received data
buf( im, jm, km ) :real(DP), intent(out)
: Array to be received
ireq :integer , intent(out)
: Request number

3D 倍精度配列の非ブロッキング通信(受信)

Non-blocking transfer (receive) of real(8) 3D array

[Source]

  subroutine MPIWrapperIRecv_dble_3d( idep, im, jm, km, buf, ireq )
    !
    ! 3D 倍精度配列の非ブロッキング通信(受信)
    !
    ! Non-blocking transfer (receive) of real(8) 3D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idep
                              ! Process number of departure
    integer , intent(in ) :: im
                              ! Size of 1st dimension of received data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of received data
    integer , intent(in ) :: km
                              ! Size of 3rd dimension of received data
    real(DP), intent(out) :: buf( im, jm, km )
                              ! Array to be received
    integer , intent(out) :: ireq
                              ! Request number


    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_irecv( buf, isize, mpi_double_precision, idep, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperIRecv_dble_3d
Subroutine :
idep :integer , intent(in )
: Process number of departure
im :integer , intent(in )
: Size of 1st dimension of received data
jm :integer , intent(in )
: Size of 2nd dimension of received data
km :integer , intent(in )
: Size of 3rd dimension of received data
lm :integer , intent(in )
: Size of 4th dimension of received data
buf( im, jm, km, lm ) :real(DP), intent(out)
: Array to be received
ireq :integer , intent(out)
: Request number

4D 倍精度配列の非ブロッキング通信(受信)

Non-blocking transfer (receive) of real(8) 4D array

[Source]

  subroutine MPIWrapperIRecv_dble_4d( idep, im, jm, km, lm, buf, ireq )
    !
    ! 4D 倍精度配列の非ブロッキング通信(受信)
    !
    ! Non-blocking transfer (receive) of real(8) 4D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idep
                              ! Process number of departure
    integer , intent(in ) :: im
                              ! Size of 1st dimension of received data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of received data
    integer , intent(in ) :: km
                              ! Size of 3rd dimension of received data
    integer , intent(in ) :: lm
                              ! Size of 4th dimension of received data
    real(DP), intent(out) :: buf( im, jm, km, lm )
                              ! Array to be received
    integer , intent(out) :: ireq
                              ! Request number

    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_irecv( buf, isize, mpi_double_precision, idep, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperIRecv_dble_4d
Subroutine :
idest :integer , intent(in )
: Process number of destination
im :integer , intent(in )
: Size of 1st dimension of sent data
buf( im ) :real(DP), intent(in )
: Array to be sent
ireq :integer , intent(out)
: Request number

1D 倍精度配列の非ブロッキング通信(送信)

Non-blocking transfer (send) of real(8) 1D array

[Source]

  subroutine MPIWrapperISend_dble_1d( idest, im, buf, ireq )
    !
    ! 1D 倍精度配列の非ブロッキング通信(送信)
    !
    ! Non-blocking transfer (send) of real(8) 1D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idest
                              ! Process number of destination
    integer , intent(in ) :: im
                              ! Size of 1st dimension of sent data
    real(DP), intent(in ) :: buf( im )
                              ! Array to be sent
    integer , intent(out) :: ireq
                              ! Request number

    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_isend( buf, isize, mpi_double_precision, idest, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperISend_dble_1d
Subroutine :
idest :integer , intent(in )
: Process number of destination
im :integer , intent(in )
: Size of 1st dimension of sent data
jm :integer , intent(in )
: Size of 2nd dimension of sent data
buf( im, jm ) :real(DP), intent(in )
: Array to be sent
ireq :integer , intent(out)
: Request number

2D 倍精度配列の非ブロッキング通信(送信)

Non-blocking transfer (send) of real(8) 2D array

[Source]

  subroutine MPIWrapperISend_dble_2d( idest, im, jm, buf, ireq )
    !
    ! 2D 倍精度配列の非ブロッキング通信(送信)
    !
    ! Non-blocking transfer (send) of real(8) 2D array
    !

    ! モジュール引用 ; USE statements
    !


    integer , intent(in ) :: idest
                              ! Process number of destination
    integer , intent(in ) :: im
                              ! Size of 1st dimension of sent data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of sent data
    real(DP), intent(in ) :: buf( im, jm )
                              ! Array to be sent
    integer , intent(out) :: ireq
                              ! Request number


    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_isend( buf, isize, mpi_double_precision, idest, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperISend_dble_2d
Subroutine :
idest :integer , intent(in )
: Process number of destination
im :integer , intent(in )
: Size of 1st dimension of sent data
jm :integer , intent(in )
: Size of 2nd dimension of sent data
km :integer , intent(in )
: Size of 3rd dimension of sent data
buf( im, jm, km ) :real(DP), intent(in )
: Array to be sent
ireq :integer , intent(out)
: Request number

3D 倍精度配列の非ブロッキング通信(送信)

Non-blocking transfer (send) of real(8) 3D array

[Source]

  subroutine MPIWrapperISend_dble_3d( idest, im, jm, km, buf, ireq )
    !
    ! 3D 倍精度配列の非ブロッキング通信(送信)
    !
    ! Non-blocking transfer (send) of real(8) 3D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idest
                              ! Process number of destination
    integer , intent(in ) :: im
                              ! Size of 1st dimension of sent data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of sent data
    integer , intent(in ) :: km
                              ! Size of 3rd dimension of sent data
    real(DP), intent(in ) :: buf( im, jm, km )
                              ! Array to be sent
    integer , intent(out) :: ireq
                              ! Request number


    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_isend( buf, isize, mpi_double_precision, idest, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperISend_dble_3d
Subroutine :
idest :integer , intent(in )
: Process number of destination
im :integer , intent(in )
: Size of 1st dimension of sent data
jm :integer , intent(in )
: Size of 2nd dimension of sent data
km :integer , intent(in )
: Size of 3rd dimension of sent data
lm :integer , intent(in )
: Size of 4th dimension of sent data
buf( im, jm, km, lm ) :real(DP), intent(in )
: Array to be sent
ireq :integer , intent(out)
: Request number

4D 倍精度配列の非ブロッキング通信(送信)

Non-blocking transfer (send) of real(8) 4D array

[Source]

  subroutine MPIWrapperISend_dble_4d( idest, im, jm, km, lm, buf, ireq )
    !
    ! 4D 倍精度配列の非ブロッキング通信(送信)
    !
    ! Non-blocking transfer (send) of real(8) 4D array
    !

    ! モジュール引用 ; USE statements
    !

    integer , intent(in ) :: idest
                              ! Process number of destination
    integer , intent(in ) :: im
                              ! Size of 1st dimension of sent data
    integer , intent(in ) :: jm
                              ! Size of 2nd dimension of sent data
    integer , intent(in ) :: km
                              ! Size of 3rd dimension of sent data
    integer , intent(in ) :: lm
                              ! Size of 4th dimension of sent data
    real(DP), intent(in ) :: buf( im, jm, km, lm )
                              ! Array to be sent
    integer , intent(out) :: ireq
                              ! Request number


    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: isize

    isize = size( buf )

    call mpi_isend( buf, isize, mpi_double_precision, idest, 1, mpi_comm_world, ireq, ierr )

  end subroutine MPIWrapperISend_dble_4d
Subroutine :

MPI の初期化

Initialization of MPI

[Source]

  subroutine MPIWrapperInit
    !
    ! MPI の初期化
    !
    ! Initialization of MPI
    !

    ! モジュール引用 ; USE statements
    !


    ! 作業変数
    ! Work variables
    !
    integer :: ierr

!    nprocs = 1
!    myrank = 0

    call mpi_init( ierr )
    call mpi_comm_size( mpi_comm_world, nprocs, ierr )
    call mpi_comm_rank( mpi_comm_world, myrank, ierr )

  end subroutine MPIWrapperInit
Subroutine :
ireq :integer, intent(inout)
: request number

MPI 通信終了まで待機

Wait finishing MPI transfer

[Source]

  subroutine MPIWrapperWait( ireq )
    !
    ! MPI 通信終了まで待機
    !
    ! Wait finishing MPI transfer
    !

    ! モジュール引用 ; USE statements
    !


    integer, intent(inout) :: ireq
                               ! request number

    ! 作業変数
    ! Work variables
    !
    integer :: ierr
    integer :: istatus( MPI_STATUS_SIZE )

    call mpi_wait( ireq, istatus, ierr )

  end subroutine MPIWrapperWait
myrank
Variable :
myrank = 0 :integer, save, public
: My rank
nprocs
Variable :
nprocs = 1 :integer, save, public
: Number of MPI processes