CAMP 1.0.0
Chemistry Across Multiple Phases
Functions/Subroutines
camp_mpi Module Reference

Wrapper functions for MPI. More...

Functions/Subroutines

logical function camp_mpi_support ()
 Whether MPI support is compiled in.
 
subroutine camp_mpi_check_ierr (ierr)
 Dies if ierr is not ok.
 
subroutine camp_mpi_init ()
 Initialize MPI.
 
subroutine camp_mpi_abort (status)
 Abort the program.
 
subroutine camp_mpi_finalize ()
 Shut down MPI.
 
subroutine camp_mpi_barrier (comm)
 Synchronize all processes.
 
integer function camp_mpi_rank (comm)
 Returns the rank of the current process.
 
integer function camp_mpi_size (comm)
 Returns the total number of processes.
 
subroutine camp_mpi_test ()
 Perform basic sanity checks on send/receive.
 
subroutine camp_mpi_bcast_integer (val, comm)
 Broadcast the given value from process 0 to all other processes.
 
subroutine camp_mpi_bcast_string (val, comm)
 Broadcast the given value from process 0 to all other processes.
 
subroutine camp_mpi_bcast_packed (val, comm)
 Broadcast the given value from process 0 to all other processes.
 
integer function camp_mpi_pack_size_integer (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_real (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_string (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_logical (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_complex (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_integer_array (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_real_array (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_string_array (val, comm)
 Determines the number of bytes required to pack the given value.
 
integer function camp_mpi_pack_size_real_array_2d (val, comm)
 Determines the number of bytes required to pack the given value.
 
subroutine camp_mpi_pack_integer (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_real (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_string (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_logical (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_complex (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_integer_array (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_real_array (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_string_array (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_pack_real_array_2d (buffer, position, val, comm)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_unpack_integer (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_real (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_string (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_logical (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_complex (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_integer_array (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_real_array (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_string_array (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_unpack_real_array_2d (buffer, position, val, comm)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_reduce_avg_real (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on the root process.
 
subroutine camp_mpi_transfer_real (from_val, to_val, from_proc, to_proc)
 Transfer the value between the given processes.
 
subroutine camp_mpi_transfer_integer (from_val, to_val, from_proc, to_proc)
 Transfer the value between the given processes.
 
subroutine camp_mpi_reduce_sum_integer (val, val_sum)
 Computes the sum of val across all processes, storing the result in val_sum on the root process.
 
subroutine camp_mpi_allreduce_sum_integer (val, val_sum)
 Computes the sum of val across all processes, storing the result in val_sum on all processes.
 
subroutine camp_mpi_reduce_avg_real_array (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on the root process.
 
subroutine camp_mpi_reduce_avg_real_array_2d (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on the root process.
 
subroutine camp_mpi_allreduce_average_real (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on all processes.
 
subroutine camp_mpi_allreduce_average_real_array (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on all processes.
 
subroutine camp_mpi_allreduce_min_integer (val, val_min)
 Computes the minimum of val across all processes, storing the result in val_min on all processes.
 
subroutine camp_mpi_allreduce_max_integer (val, val_max)
 Computes the maximum of val across all processes, storing the result in val_max on all processes.
 
subroutine camp_mpi_allreduce_min_real (val, val_min)
 Computes the minimum of val across all processes, storing the result in val_min on all processes.
 
subroutine camp_mpi_allreduce_max_real (val, val_max)
 Computes the maximum of val across all processes, storing the result in val_max on all processes.
 
logical function camp_mpi_allequal_integer (val)
 Returns whether all processors have the same value.
 
logical function camp_mpi_allequal_real (val)
 Returns whether all processors have the same value.
 
subroutine camp_mpi_alltoall_integer (send, recv)
 Does an all-to-all transfer of integers.
 
subroutine camp_mpi_allgather_integer_array (send, recv)
 Does an allgather of integer arrays (must be the same size on all processes).
 
subroutine camp_mpi_allgather_real_array (send, recv)
 Does an allgather of real arrays (must be the same size on all processes).
 

Detailed Description

Wrapper functions for MPI.

All of these functions can be called irrespective of whether MPI support was compiled in or not. If MPI support is not enabled then they do the obvious trivial thing (normally nothing).

Function/Subroutine Documentation

◆ camp_mpi_abort()

subroutine camp_mpi::camp_mpi_abort ( integer, intent(in)  status)

Abort the program.

Parameters
[in]statusStatus flag to abort with.

Definition at line 72 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allequal_integer()

logical function camp_mpi::camp_mpi_allequal_integer ( integer, intent(in)  val)

Returns whether all processors have the same value.

Parameters
[in]valValue to compare.

Definition at line 1710 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allequal_real()

logical function camp_mpi::camp_mpi_allequal_real ( real(kind=dp), intent(in)  val)

Returns whether all processors have the same value.

Parameters
[in]valValue to compare.

Definition at line 1734 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allgather_integer_array()

subroutine camp_mpi::camp_mpi_allgather_integer_array ( integer, dimension(:), intent(in)  send,
integer, dimension(:,:), intent(out)  recv 
)

Does an allgather of integer arrays (must be the same size on all processes).

Parameters
[in]sendValues to send on each process.
[out]recvValues to receive (will be the same on all processes.

Definition at line 1781 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_allgather_real_array()

subroutine camp_mpi::camp_mpi_allgather_real_array ( real(kind=dp), dimension(:), intent(in)  send,
real(kind=dp), dimension(:,:), intent(out)  recv 
)

Does an allgather of real arrays (must be the same size on all processes).

Parameters
[in]sendValues to send on each process.
[out]recvValues to receive (will be the same on all processes.

Definition at line 1816 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_allreduce_average_real()

subroutine camp_mpi::camp_mpi_allreduce_average_real ( real(kind=dp), intent(in)  val,
real(kind=dp), intent(out)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on all processes.

Parameters
[in]valValue to average.
[out]val_avgResult.

Definition at line 1570 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allreduce_average_real_array()

subroutine camp_mpi::camp_mpi_allreduce_average_real_array ( real(kind=dp), dimension(:), intent(in)  val,
real(kind=dp), dimension(:), intent(out)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on all processes.

Parameters
[in]valValue to average.
[out]val_avgResult.

Definition at line 1594 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_allreduce_max_integer()

subroutine camp_mpi::camp_mpi_allreduce_max_integer ( integer, intent(in)  val,
integer, intent(out)  val_max 
)

Computes the maximum of val across all processes, storing the result in val_max on all processes.

Parameters
[in]valValue to maximize.
[out]val_maxResult.

Definition at line 1642 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allreduce_max_real()

subroutine camp_mpi::camp_mpi_allreduce_max_real ( real(kind=dp), intent(in)  val,
real(kind=dp), intent(out)  val_max 
)

Computes the maximum of val across all processes, storing the result in val_max on all processes.

Parameters
[in]valValue to maximize.
[out]val_maxResult.

Definition at line 1688 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allreduce_min_integer()

subroutine camp_mpi::camp_mpi_allreduce_min_integer ( integer, intent(in)  val,
integer, intent(out)  val_min 
)

Computes the minimum of val across all processes, storing the result in val_min on all processes.

Parameters
[in]valValue to minimize.
[out]val_minResult.

Definition at line 1619 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allreduce_min_real()

subroutine camp_mpi::camp_mpi_allreduce_min_real ( real(kind=dp), intent(in)  val,
real(kind=dp), intent(out)  val_min 
)

Computes the minimum of val across all processes, storing the result in val_min on all processes.

Parameters
[in]valValue to minimize.
[out]val_minResult.

Definition at line 1665 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_allreduce_sum_integer()

subroutine camp_mpi::camp_mpi_allreduce_sum_integer ( integer, intent(in)  val,
integer, intent(out)  val_sum 
)

Computes the sum of val across all processes, storing the result in val_sum on all processes.

Parameters
[in]valValue to sum.
[out]val_sumResult.

Definition at line 1492 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_alltoall_integer()

subroutine camp_mpi::camp_mpi_alltoall_integer ( integer, dimension(:), intent(in)  send,
integer, dimension(size(send)), intent(out)  recv 
)

Does an all-to-all transfer of integers.

Parameters
[in]sendValues to send (must be one per process).
[out]recvValues to receive (must be one per process).

Definition at line 1758 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_barrier()

subroutine camp_mpi::camp_mpi_barrier ( integer, intent(in), optional  comm)

Synchronize all processes.

Parameters
[in]commMPI communicator

Definition at line 104 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_bcast_integer()

subroutine camp_mpi::camp_mpi_bcast_integer ( integer, intent(inout)  val,
integer, intent(in), optional  comm 
)

Broadcast the given value from process 0 to all other processes.

Parameters
[in,out]valValue to broadcast.
[in]commMPI communicator

Definition at line 316 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_bcast_packed()

subroutine camp_mpi::camp_mpi_bcast_packed ( character, dimension(:), intent(inout)  val,
integer, intent(in), optional  comm 
)

Broadcast the given value from process 0 to all other processes.

Parameters
[in,out]valValue to broadcast.
[in]commMPI communicator

Definition at line 370 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_bcast_string()

subroutine camp_mpi::camp_mpi_bcast_string ( character(len=*), intent(inout)  val,
integer, intent(in), optional  comm 
)

Broadcast the given value from process 0 to all other processes.

Parameters
[in,out]valValue to broadcast.
[in]commMPI communicator

Definition at line 343 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_check_ierr()

subroutine camp_mpi::camp_mpi_check_ierr ( integer, intent(in)  ierr)

Dies if ierr is not ok.

Parameters
[in]ierrMPI status code.

Definition at line 41 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_finalize()

subroutine camp_mpi::camp_mpi_finalize

Shut down MPI.

Definition at line 90 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_init()

subroutine camp_mpi::camp_mpi_init

Initialize MPI.

Definition at line 57 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_complex()

subroutine camp_mpi::camp_mpi_pack_complex ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
complex(kind=dc), intent(in)  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 824 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_integer()

subroutine camp_mpi::camp_mpi_pack_integer ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
integer, intent(in)  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 690 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_integer_array()

subroutine camp_mpi::camp_mpi_pack_integer_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
integer, dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 857 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_logical()

subroutine camp_mpi::camp_mpi_pack_logical ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
logical, intent(in)  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 791 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_real()

subroutine camp_mpi::camp_mpi_pack_real ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), intent(in)  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 723 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_real_array()

subroutine camp_mpi::camp_mpi_pack_real_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 898 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_real_array_2d()

subroutine camp_mpi::camp_mpi_pack_real_array_2d ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), dimension(:,:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 979 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_pack_size_complex()

integer function camp_mpi::camp_mpi_pack_size_complex ( complex(kind=dc), intent(in)  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 511 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_integer()

integer function camp_mpi::camp_mpi_pack_size_integer ( integer, intent(in)  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 397 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_integer_array()

integer function camp_mpi::camp_mpi_pack_size_integer_array ( integer, dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 539 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_logical()

integer function camp_mpi::camp_mpi_pack_size_logical ( logical, intent(in)  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 483 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_real()

integer function camp_mpi::camp_mpi_pack_size_real ( real(kind=dp), intent(in)  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 425 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_real_array()

integer function camp_mpi::camp_mpi_pack_size_real_array ( real(kind=dp), dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 577 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_real_array_2d()

integer function camp_mpi::camp_mpi_pack_size_real_array_2d ( real(kind=dp), dimension(:,:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 650 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_string()

integer function camp_mpi::camp_mpi_pack_size_string ( character(len=*), intent(in)  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 453 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_size_string_array()

integer function camp_mpi::camp_mpi_pack_size_string_array ( character(len=*), dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.
[in]commMPI communicator

Definition at line 615 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_string()

subroutine camp_mpi::camp_mpi_pack_string ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
character(len=*), intent(in)  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 756 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_pack_string_array()

subroutine camp_mpi::camp_mpi_pack_string_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
character(len=*), dimension(:), intent(in), allocatable  val,
integer, intent(in), optional  comm 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.
[in]commMPI communicator

Definition at line 938 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_rank()

integer function camp_mpi::camp_mpi_rank ( integer, intent(in), optional  comm)

Returns the rank of the current process.

Parameters
[in]commMPI communicator

Definition at line 127 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_reduce_avg_real()

subroutine camp_mpi::camp_mpi_reduce_avg_real ( real(kind=dp), intent(in)  val,
real(kind=dp), intent(out)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on the root process.

Parameters
[in]valValue to average.
[out]val_avgResult.

Definition at line 1365 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_reduce_avg_real_array()

subroutine camp_mpi::camp_mpi_reduce_avg_real_array ( real(kind=dp), dimension(:), intent(in)  val,
real(kind=dp), dimension(:), intent(out)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on the root process.

Parameters
[in]valValue to average.
[out]val_avgResult.

Definition at line 1515 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_reduce_avg_real_array_2d()

subroutine camp_mpi::camp_mpi_reduce_avg_real_array_2d ( real(kind=dp), dimension(:,:), intent(in)  val,
real(kind=dp), dimension(:,:), intent(out)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on the root process.

Parameters
[in]valValue to average.
[out]val_avgResult.

Definition at line 1542 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_reduce_sum_integer()

subroutine camp_mpi::camp_mpi_reduce_sum_integer ( integer, intent(in)  val,
integer, intent(out)  val_sum 
)

Computes the sum of val across all processes, storing the result in val_sum on the root process.

Parameters
[in]valValue to sum.
[out]val_sumResult.

Definition at line 1469 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_size()

integer function camp_mpi::camp_mpi_size ( integer, intent(in), optional  comm)

Returns the total number of processes.

Parameters
[in]commMPI communicator

Definition at line 153 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_support()

logical function camp_mpi::camp_mpi_support

Whether MPI support is compiled in.

Definition at line 28 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_test()

subroutine camp_mpi::camp_mpi_test

Perform basic sanity checks on send/receive.

Definition at line 179 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_transfer_integer()

subroutine camp_mpi::camp_mpi_transfer_integer ( integer, intent(in)  from_val,
integer, intent(out)  to_val,
integer, intent(in)  from_proc,
integer, intent(in)  to_proc 
)

Transfer the value between the given processes.

Parameters
[in]from_valValue to send.
[out]to_valVariable to send to.
[in]from_procProcess to send from.
[in]to_procProcess to send to.

Definition at line 1429 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_transfer_real()

subroutine camp_mpi::camp_mpi_transfer_real ( real(kind=dp), intent(in)  from_val,
real(kind=dp), intent(out)  to_val,
integer, intent(in)  from_proc,
integer, intent(in)  to_proc 
)

Transfer the value between the given processes.

Parameters
[in]from_valValue to send.
[out]to_valVariable to send to.
[in]from_procProcess to send from.
[in]to_procProcess to send to.

Definition at line 1390 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_unpack_complex()

subroutine camp_mpi::camp_mpi_unpack_complex ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
complex(kind=dc), intent(out)  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[out]valValue to pack.
[in]commMPI communicator

Definition at line 1165 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_integer()

subroutine camp_mpi::camp_mpi_unpack_integer ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
integer, intent(out)  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[out]valValue to pack.
[in]commMPI communicator

Definition at line 1022 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_integer_array()

subroutine camp_mpi::camp_mpi_unpack_integer_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
integer, dimension(:), intent(inout), allocatable  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.
[in]commMPI communicator

Definition at line 1200 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_logical()

subroutine camp_mpi::camp_mpi_unpack_logical ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
logical, intent(out)  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[out]valValue to pack.
[in]commMPI communicator

Definition at line 1130 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_real()

subroutine camp_mpi::camp_mpi_unpack_real ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), intent(out)  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[out]valValue to pack.
[in]commMPI communicator

Definition at line 1057 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_real_array()

subroutine camp_mpi::camp_mpi_unpack_real_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), dimension(:), intent(inout), allocatable  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.
[in]commMPI communicator

Definition at line 1241 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_real_array_2d()

subroutine camp_mpi::camp_mpi_unpack_real_array_2d ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
real(kind=dp), dimension(:,:), intent(inout), allocatable  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.
[in]commMPI communicator

Definition at line 1323 of file mpi.F90.

Here is the call graph for this function:

◆ camp_mpi_unpack_string()

subroutine camp_mpi::camp_mpi_unpack_string ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
character(len=*), intent(out)  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[out]valValue to pack.
[in]commMPI communicator

Definition at line 1092 of file mpi.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_unpack_string_array()

subroutine camp_mpi::camp_mpi_unpack_string_array ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
character(len=*), dimension(:), intent(inout), allocatable  val,
integer, intent(in), optional  comm 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.
[in]commMPI communicator

Definition at line 1282 of file mpi.F90.

Here is the call graph for this function: