module fd4_globaldef_mod module fd4_vartab_mod module fd4_block_mod module fd4_mpi_modVariables:
integer (kind=i_k), public :: comm_count = 0 integer (kind=i8k), public :: comm_total_size integer (kind=MPI_ADDRESS_KIND), private, allocatable, dimension (:) :: displ integer, private, allocatable, dimension (:) :: blens integer, private, allocatable, dimension (:) :: typesSubroutines and functions:
public subroutine fd4_comm_build_type (b, bl_type, err, addr) public subroutine fd4_comm_build_array_type (ext, stride, sbnd, sdata_type, err) private subroutine fd4_comm_alloc_helpers (len)
Preprocessor options:
Author: Matthias Lieber
See also: module fd4_block
public subroutine fd4_comm_build_type (b, bl_type, err, addr) type (fd4_block), pointer :: b integer, intent(out) :: bl_type integer (kind=i_k), intent(out) :: err integer (kind=MPI_ADDRESS_KIND), optional, intent(out) :: addr end subroutine fd4_comm_build_typeParameters:
b | the block |
bl_type | the MPI datatype for the block |
err | error status: 0...ok |
addr | optionally return the base address of this type as returned by MPI_Get_address |
Build an MPI datatype for the fd4_block components:
The resulting data type is not commited! Use MPI_Type_free to free the type after use (i.e. send/recv). The MPI Standard says, one can free a type while a message is on the way (i.e. before MPI_Wait).
public subroutine fd4_comm_build_array_type (ext, stride, sbnd, sdata_type, err) integer (kind=i_k), intent(in), dimension (0:3) :: ext integer (kind=i_k), intent(in), dimension (:,:) :: stride integer (kind=i_k), intent(in), dimension (3,2) :: sbnd integer, intent(out) :: sdata_type integer (kind=i_k), intent(out) :: err end subroutine fd4_comm_build_array_typeParameters:
ext | extents of the sdata array |
stride | stride to select subsets of the array for the datatype |
sbnd | bounds to select a spatial subset |
sdata_type | the MPI datatype for the array |
err | error status: 0...ok |
The stride on 1st dimension is defined with stride, e.g.:
stride(1,1:2) = (/ 1,2 /) ! start end end index of one contiguous subsection stride(2,1:2) = (/ 4,4 /) stride(3,1:2) = (/ 7,9 /)selects the following values from dimension 0 of the array, assuming size 9:
123456789 xx x xxx
The implementation uses MPI_Type_create_subarray (MPI-2) unless FD4_NO_MPI_TYPE_CREATE_SUBARRAY is set. The resulting data type is not commited!
private subroutine fd4_comm_alloc_helpers (len) integer, intent(in) :: len end subroutine fd4_comm_alloc_helpersAllocate module variables blens, types, displ.
Internal routine.