PartMC 2.1.1
|
Wrapper functions for MPI. More...
Functions/Subroutines | |
logical | pmc_mpi_support () |
Whether MPI support is compiled in. | |
subroutine | pmc_mpi_check_ierr (ierr) |
Dies if ierr is not ok. | |
subroutine | pmc_mpi_init () |
Initialize MPI. | |
subroutine | pmc_mpi_abort (status) |
Abort the program. | |
subroutine | pmc_mpi_finalize () |
Shut down MPI. | |
subroutine | pmc_mpi_barrier () |
Synchronize all processes. | |
integer | pmc_mpi_rank () |
Returns the rank of the current process. | |
integer | pmc_mpi_size () |
Returns the total number of processes. | |
subroutine | pmc_mpi_test () |
Perform basic sanity checks on send/receive. | |
subroutine | pmc_mpi_bcast_integer (val) |
Broadcast the given value from process 0 to all other processes. | |
subroutine | pmc_mpi_bcast_string (val) |
Broadcast the given value from process 0 to all other processes. | |
subroutine | pmc_mpi_bcast_packed (val) |
Broadcast the given value from process 0 to all other processes. | |
integer | pmc_mpi_pack_size_integer (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_real (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_string (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_logical (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_complex (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_integer_array (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_real_array (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_string_array (val) |
Determines the number of bytes required to pack the given value. | |
integer | pmc_mpi_pack_size_real_array_2d (val) |
Determines the number of bytes required to pack the given value. | |
subroutine | pmc_mpi_pack_integer (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_real (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_string (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_logical (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_complex (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_integer_array (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_real_array (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_string_array (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_pack_real_array_2d (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_integer (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_real (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_string (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_logical (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_complex (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_integer_array (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_real_array (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_string_array (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_real_array_2d (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | pmc_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 | pmc_mpi_transfer_real (from_val, to_val, from_proc, to_proc) |
Transfer the value between the given processes. | |
subroutine | pmc_mpi_transfer_integer (from_val, to_val, from_proc, to_proc) |
Transfer the value between the given processes. | |
subroutine | pmc_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 | pmc_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 | pmc_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 | pmc_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 | pmc_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 | pmc_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. |
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).
subroutine pmc_mpi::pmc_mpi_abort | ( | integer,intent(in) | status | ) |
Abort the program.
status | Status flag to abort with. |
subroutine pmc_mpi::pmc_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.
val | Value to average. |
val_avg | Result. |
subroutine pmc_mpi::pmc_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.
val | Value to average. |
val_avg | Result. |
subroutine pmc_mpi::pmc_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.
val | Value to sum. |
val_sum | Result. |
subroutine pmc_mpi::pmc_mpi_barrier | ( | ) |
Synchronize all processes.
subroutine pmc_mpi::pmc_mpi_bcast_integer | ( | integer,intent(inout) | val | ) |
Broadcast the given value from process 0 to all other processes.
val | Value to broadcast. |
subroutine pmc_mpi::pmc_mpi_bcast_packed | ( | character,dimension(:),intent(inout) | val | ) |
Broadcast the given value from process 0 to all other processes.
val | Value to broadcast. |
subroutine pmc_mpi::pmc_mpi_bcast_string | ( | character(len=*),intent(inout) | val | ) |
Broadcast the given value from process 0 to all other processes.
val | Value to broadcast. |
subroutine pmc_mpi::pmc_mpi_check_ierr | ( | integer,intent(in) | ierr | ) |
Dies if ierr
is not ok.
ierr | MPI status code. |
subroutine pmc_mpi::pmc_mpi_finalize | ( | ) |
Shut down MPI.
subroutine pmc_mpi::pmc_mpi_init | ( | ) |
Initialize MPI.
subroutine pmc_mpi::pmc_mpi_pack_complex | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
complex(kind=dc),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_integer | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
integer,intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_integer_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
integer,dimension(:),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_logical | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
logical,intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_real | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_real_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),dimension(:),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_real_array_2d | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),dimension(:,:),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_complex | ( | complex(kind=dc),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_integer | ( | integer,intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_integer_array | ( | integer,dimension(:),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_logical | ( | logical,intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_real | ( | real(kind=dp),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_real_array | ( | real(kind=dp),dimension(:),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_real_array_2d | ( | real(kind=dp),dimension(:,:),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_string | ( | character(len=*),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
integer pmc_mpi::pmc_mpi_pack_size_string_array | ( | character(len=*),dimension(:),intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_string | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
character(len=*),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_pack_string_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
character(len=*),dimension(:),intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
integer pmc_mpi::pmc_mpi_rank | ( | ) |
Returns the rank of the current process.
subroutine pmc_mpi::pmc_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.
val | Value to average. |
val_avg | Result. |
subroutine pmc_mpi::pmc_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.
val | Value to average. |
val_avg | Result. |
subroutine pmc_mpi::pmc_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.
val | Value to average. |
val_avg | Result. |
subroutine pmc_mpi::pmc_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.
val | Value to sum. |
val_sum | Result. |
integer pmc_mpi::pmc_mpi_size | ( | ) |
Returns the total number of processes.
logical pmc_mpi::pmc_mpi_support | ( | ) |
Whether MPI support is compiled in.
subroutine pmc_mpi::pmc_mpi_test | ( | ) |
Perform basic sanity checks on send/receive.
subroutine pmc_mpi::pmc_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.
from_val | Value to send. |
to_val | Variable to send to. |
from_proc | Process to send from. |
to_proc | Process to send to. |
subroutine pmc_mpi::pmc_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.
from_val | Value to send. |
to_val | Variable to send to. |
from_proc | Process to send from. |
to_proc | Process to send to. |
subroutine pmc_mpi::pmc_mpi_unpack_complex | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
complex(kind=dc),intent(out) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_integer | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
integer,intent(out) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_integer_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
integer,dimension(:),pointer | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_logical | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
logical,intent(out) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_real | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),intent(out) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_real_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),dimension(:),pointer | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_real_array_2d | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
real(kind=dp),dimension(:,:),pointer | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_string | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
character(len=*),intent(out) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |
subroutine pmc_mpi::pmc_mpi_unpack_string_array | ( | character,dimension(:),intent(inout) | buffer, |
integer,intent(inout) | position, | ||
character(len=*),dimension(:),pointer | val | ||
) |
Unpacks the given value from the buffer, advancing position.
buffer | Memory buffer. |
position | Current buffer position. |
val | Value to pack. |