dftd3_mpi_utils Module

Thin wrappers around the MPI calls used by s-dftd3.

This is the only place besides dftd3_feature that is preprocessed. Without MPI support every wrapper reports the missing feature in the error handler.



Interfaces

public interface mpi_allreduce_sum

Sum a real quantity over all ranks of a communicator, in place

  • private subroutine allreduce_sum_rank1(comm, val, error)

    Sum an array over all ranks of a communicator

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: comm

    MPI communicator handle

    real(kind=wp), intent(inout), contiguous :: val(:)

    Values to reduce

    type(error_type), intent(out), allocatable :: error

    Error handling

  • private subroutine allreduce_sum_rank2(comm, val, error)

    Sum a matrix over all ranks of a communicator

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: comm

    MPI communicator handle

    real(kind=wp), intent(inout), contiguous, target :: val(:,:)

    Values to reduce

    type(error_type), intent(out), allocatable :: error

    Error handling


Subroutines

public subroutine get_mpi_comm_info(comm, rank, nranks, error)

Determine rank and size of a communicator

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator handle, users of mpi_f08 pass comm%mpi_val

integer, intent(out) :: rank

Zero-based rank of the calling process

integer, intent(out) :: nranks

Number of processes in the communicator

type(error_type), intent(out), allocatable :: error

Error handling