MPIClass Module


Uses


Contents


Derived Types

type, public :: comment

Components

TypeVisibility AttributesNameInitial
character(len=200), public :: comment

type, public :: MPI_

Components

TypeVisibility AttributesNameInitial
integer, public :: ierr
integer, public :: MyRank
integer, public :: PeTot
integer, public :: Comm1
integer, public :: Comm2
integer, public :: Comm3
integer, public :: Comm4
integer, public :: Comm5
integer, public, allocatable:: Comm(:)
integer, public, allocatable:: key(:)
integer, public :: LapTimeStep
real(kind=8), public :: stime
real(kind=8), public :: etime
real(kind=8), public :: laptime(1000)
type(comment), public :: comments(1000)

Type-Bound Procedures

procedure, public :: Start => StartMPI
procedure, public :: Barrier => BarrierMPI
procedure, public, Pass :: readMPIInt
procedure, public, Pass :: readMPIReal
generic, public :: read => readMPIInt, readMPIReal
procedure, public, Pass :: BcastMPIInt
procedure, public, Pass :: BcastMPIReal
generic, public :: Bcast => BcastMPIInt, BcastMPIReal
procedure, public, Pass :: GatherMPIInt
procedure, public, Pass :: GatherMPIReal
generic, public :: Gather => GatherMPIInt, GatherMPIReal
procedure, public, Pass :: ScatterMPIInt
procedure, public, Pass :: ScatterMPIReal
generic, public :: Scatter => ScatterMPIInt, ScatterMPIReal
procedure, public, Pass :: AllGatherMPIInt
procedure, public, Pass :: AllGatherMPIReal
generic, public :: AllGather => AllGatherMPIInt, AllGatherMPIReal
procedure, public, Pass :: AlltoAllMPIInt
procedure, public, Pass :: AlltoAllMPIReal
generic, public :: AlltoAll => AlltoAllMPIInt, AlltoAllMPIReal
procedure, public, Pass :: ReduceMPIInt
procedure, public, Pass :: ReduceMPIReal
generic, public :: Reduce => ReduceMPIInt, ReduceMPIReal
procedure, public, Pass :: AllReduceMPIInt
procedure, public, Pass :: AllReduceMPIReal
generic, public :: AllReduce => AllReduceMPIInt, AllReduceMPIReal
procedure, public :: free => FreeMPI
procedure, public :: split => SplitMPI
procedure, public :: copy => CopyMPI
procedure, public :: End => EndMPI
procedure, public :: getLapTime => getLapTimeMPI
procedure, public :: showLapTime => showLapTimeMPI
procedure, public :: GetInfo => GetMPIInfo

Subroutines

public subroutine StartMPI(obj, NumOfComm)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(in), optional :: NumOfComm

public subroutine readMPIInt(obj, val, ExecRank, Msg)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(out) :: val
integer, intent(in), optional :: ExecRank
character(len=*), intent(in), optional :: Msg

public subroutine readMPIReal(obj, val, ExecRank, Msg)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(out) :: val
integer, intent(in), optional :: ExecRank
character(len=*), intent(in), optional :: Msg

public subroutine GetMPIInfo(obj)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj

public subroutine BarrierMPI(obj)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj

public subroutine BcastMPIInt(obj, From, val)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: From
integer, intent(inout) :: val

public subroutine BcastMPIReal(obj, From, val)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: From
real(kind=8), intent(inout) :: val

public subroutine GatherMPIInt(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id, To)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id
integer, intent(in), optional :: To

public subroutine GatherMPIReal(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id, To)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id
integer, intent(in), optional :: To

public subroutine ScatterMPIInt(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id, From)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id
integer, intent(in), optional :: From

public subroutine ScatterMPIReal(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id, From)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id
integer, intent(in), optional :: From

public subroutine AllGatherMPIInt(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id

public subroutine AllGatherMPIReal(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id

public subroutine AlltoAllMPIInt(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id

public subroutine AlltoAllMPIReal(obj, sendobj, sendcount, recvobj, recvcount, send_start_id, recv_start_id)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
integer, intent(in) :: sendcount
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: recvcount
integer, intent(in), optional :: send_start_id
integer, intent(in), optional :: recv_start_id

public subroutine ReduceMPIInt(obj, sendobj, recvobj, count, start, To, max, min, sum, prod, land, band, lor, bor, lxor, bxor, maxloc, minloc)

, count, MPI_INTEGER, ToID, MPI_MAX, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_MIN, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_SUM, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_PROD, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_LAND, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID,MPI_BAND , MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_LOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID,MPI_BOR , MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_LXOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_BXOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_MAXLOC, MPI_COMM_WORLD, obj%ierr) , count, MPI_INTEGER, ToID, MPI_MINLOC, MPI_COMM_WORLD, obj%ierr)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: count
integer, intent(in), optional :: start
integer, intent(in), optional :: To
logical, intent(in), optional :: max
logical, intent(in), optional :: min
logical, intent(in), optional :: sum
logical, intent(in), optional :: prod
logical, intent(in), optional :: land
logical, intent(in), optional :: band
logical, intent(in), optional :: lor
logical, intent(in), optional :: bor
logical, intent(in), optional :: lxor
logical, intent(in), optional :: bxor
logical, intent(in), optional :: maxloc
logical, intent(in), optional :: minloc

public subroutine ReduceMPIReal(obj, sendobj, recvobj, count, start, To, max, min, sum, prod, land, band, lor, bor, lxor, bxor, maxloc, minloc)

, count, MPI_REAL8, ToID, MPI_MAX, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_MIN, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_SUM, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_PROD, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_LAND, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID,MPI_BAND , MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_LOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID,MPI_BOR , MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_LXOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_BXOR, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_MAXLOC, MPI_COMM_WORLD, obj%ierr) , count, MPI_REAL8, ToID, MPI_MINLOC, MPI_COMM_WORLD, obj%ierr)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: count
integer, intent(in), optional :: start
integer, intent(in), optional :: To
logical, intent(in), optional :: max
logical, intent(in), optional :: min
logical, intent(in), optional :: sum
logical, intent(in), optional :: prod
logical, intent(in), optional :: land
logical, intent(in), optional :: band
logical, intent(in), optional :: lor
logical, intent(in), optional :: bor
logical, intent(in), optional :: lxor
logical, intent(in), optional :: bxor
logical, intent(in), optional :: maxloc
logical, intent(in), optional :: minloc

public subroutine AllReduceMPIInt(obj, sendobj, recvobj, count, start, max, min, sum, prod, land, band, lor, bor, lxor, bxor, maxloc, minloc)

, count, MPI_INTEGER, MPI_MAX, MPI_COMM_WORLD, obj%ierr)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(inout) :: sendobj(:)
integer, intent(inout) :: recvobj(:)
integer, intent(in) :: count
integer, intent(in), optional :: start
logical, intent(in), optional :: max
logical, intent(in), optional :: min
logical, intent(in), optional :: sum
logical, intent(in), optional :: prod
logical, intent(in), optional :: land
logical, intent(in), optional :: band
logical, intent(in), optional :: lor
logical, intent(in), optional :: bor
logical, intent(in), optional :: lxor
logical, intent(in), optional :: bxor
logical, intent(in), optional :: maxloc
logical, intent(in), optional :: minloc

public subroutine AllReduceMPIReal(obj, sendobj, recvobj, count, start, max, min, sum, prod, land, band, lor, bor, lxor, bxor, maxloc, minloc)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
real(kind=8), intent(inout) :: sendobj(:)
real(kind=8), intent(inout) :: recvobj(:)
integer, intent(in) :: count
integer, intent(in), optional :: start
logical, intent(in), optional :: max
logical, intent(in), optional :: min
logical, intent(in), optional :: sum
logical, intent(in), optional :: prod
logical, intent(in), optional :: land
logical, intent(in), optional :: band
logical, intent(in), optional :: lor
logical, intent(in), optional :: bor
logical, intent(in), optional :: lxor
logical, intent(in), optional :: bxor
logical, intent(in), optional :: maxloc
logical, intent(in), optional :: minloc

public subroutine EndMPI(obj)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj

public subroutine getLapTimeMPI(obj, comment)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
character(len=*), intent(in), optional :: comment

public subroutine showLapTimeMPI(obj, cLength, rank)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(in), optional :: cLength
integer, intent(in), optional :: rank

public subroutine CopyMPI(obj, OriginComm, NewCommLayerID)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(in), optional :: OriginComm
integer, intent(in), optional :: NewCommLayerID

public subroutine SplitMPI(obj, OriginComm, NewCommLayerID, key)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(in), optional :: OriginComm

call MPI_COMM_SPLIT(input(default=MPI_COMM_WORLD,option=OriginComm),&

integer, intent(in), optional :: NewCommLayerID

call MPI_COMM_SPLIT(input(default=MPI_COMM_WORLD,option=OriginComm),&

integer, intent(in), optional :: key

call MPI_COMM_SPLIT(input(default=MPI_COMM_WORLD,option=OriginComm),&

public subroutine FreeMPI(obj, CommLayerID)

Arguments

Type IntentOptional AttributesName
class(MPI_), intent(inout) :: obj
integer, intent(in), optional :: CommLayerID

call MPI_COMM_FREE(input(default=MPI_COMM_WORLD,option=obj%Comm(CommLayerID) ), obj%ierr)

call MPI_COMM_FREE(MPI_COMM_WORLD, obj%ierr)