This module describes private pencil and public dtfft_pencil_t classes
Type bound constuctor for dtfft_pencil_t
Creates pencil object, that can be used to create dtFFT plans
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | starts(:) |
Local starts, starting from 0 for both C and Fortran |
||
integer(kind=int32), | intent(in) | :: | counts(:) |
Local counts of data, in elements |
Structure to hold pencil decomposition info
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int8), | public | :: | dim |
Aligned dimension id |
|||
integer(kind=int8), | public | :: | ndims | = | 0 |
Number of dimensions |
|
integer(kind=int32), | public, | allocatable | :: | starts(:) |
Local starts, starting from 0 for both C and Fortran |
||
integer(kind=int32), | public, | allocatable | :: | counts(:) |
Local counts of data, in elements |
||
integer(kind=int64), | public | :: | size |
Total number of elements in a pencil |
|||
logical, | private | :: | is_created | = | .false. |
Is pencil created |
Type bound constuctor for dtfft_pencil_t
private function create_pencil_t (starts, counts) | Creates pencil object, that can be used to create dtFFT plans |
final :: destroy_pencil_t |
procedure, private, pass(self) :: destroy => destroy_pencil_t_private |
Structure to hold pencil decomposition info
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=c_int8_t), | public | :: | dim |
Aligned dimension id |
|||
integer(kind=c_int8_t), | public | :: | ndims |
Number of dimensions |
|||
integer(kind=c_int32_t), | public | :: | starts(3) |
Local starts, starting from 0 for both C and Fortran |
|||
integer(kind=c_int32_t), | public | :: | counts(3) |
Local counts of data, in elements |
|||
integer(kind=c_size_t), | public | :: | size |
Total number of elements in a pencil |
Class that describes information about data layout
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int8), | public | :: | aligned_dim |
Position of aligned dimension. For example: X pencil aligned_dim = 1, Z pencil aligned_dim = 3 |
|||
integer(kind=int8), | public | :: | rank |
Rank of buffer: 2 or 3 |
|||
integer(kind=int32), | public, | allocatable | :: | starts(:) |
Local starts, starting from 0 for both C and Fortran |
||
integer(kind=int32), | public, | allocatable | :: | counts(:) |
Local counts of data, in elements |
||
logical, | public | :: | is_even |
Is data evenly distributed across processes |
procedure, public, pass(self) :: create | ../../ Creates pencil |
procedure, public, pass(self) :: destroy | ../../ Destroys pencil |
procedure, public, pass(self) :: make_public | ../../ Creates public object that users can use to create own FFT backends |
Class that describes information about data layout
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(MPI_Comm), | public, | allocatable | :: | comms(:) |
1D communicators for each dimension |
||
integer(kind=int32), | public, | allocatable | :: | starts(:) |
Local starts |
||
integer(kind=int32), | public, | allocatable | :: | counts(:) |
Local counts |
||
integer(kind=int32), | public, | allocatable | :: | dims(:) |
Global dimensions of entire region |
procedure, public, pass(self) :: create => create_pencil_init | ../../ Creates and validates pencil passed by user to plan constructors |
procedure, public, pass(self) :: destroy => destroy_pencil_init | ../../ Destroys pencil_init |
Determines transpose ID based on pencils
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pencil), | intent(in) | :: | send |
Send pencil |
||
type(pencil), | intent(in) | :: | recv |
Receive pencil |
Transpose ID
Checks if data is evenly distributed across processes
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | count |
Local count |
||
type(MPI_Comm), | intent(in) | :: | comm |
Grid communicator |
Creates public object that users can use to create own FFT backends
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pencil), | intent(in) | :: | self |
Pencil |
Creates pencil object, that can be used to create dtFFT plans
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | starts(:) |
Local starts, starting from 0 for both C and Fortran |
||
integer(kind=int32), | intent(in) | :: | counts(:) |
Local counts of data, in elements |
Creates and validates pencil passed by user to plan constructors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pencil_init), | intent(inout) | :: | self |
Internal pencil representation based on dtfft_pencil_t |
||
type(dtfft_pencil_t), | intent(in) | :: | pencil |
Pencil passed by user to plan constructors |
||
type(MPI_Comm), | intent(in) | :: | comm |
MPI Communicator passed to plan constructors |
Error code
Check if two pencols overlap in ndims-dimensional space
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | lbounds1(:) |
Lower bounds of first pencil |
||
integer(kind=int32), | intent(in) | :: | sizes1(:) |
Sizes of first pencil |
||
integer(kind=int32), | intent(in) | :: | lbounds2(:) |
Lower bounds of second pencil |
||
integer(kind=int32), | intent(in) | :: | sizes2(:) |
Sizes of second pencil |
||
integer(kind=int32), | intent(in) | :: | ndims |
Number of dimensions |
Check if the local pencils cover the global space without gaps
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | all_lbounds(:,:) |
Lower bounds of local pencils for each process |
||
integer(kind=int32), | intent(in) | :: | all_sizes(:,:) |
Sizes of local pencils for each process |
||
integer(kind=int32), | intent(in) | :: | global_dims(:) |
Global dimensions of the problem |
||
integer(kind=int32), | intent(in) | :: | comm_size |
Number of processes in the communicator |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | fixed_dims(:) | |||
integer(kind=int32), | intent(in) | :: | total_dims |
Converts Fortran pencil to C pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dtfft_pencil_t), | intent(in) | :: | pencil |
Fortran pencil |
||
type(dtfft_pencil_c), | intent(out) | :: | c_pencil |
C pencil |
Converts C pencil to Fortran pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dtfft_pencil_c), | intent(in) | :: | c_pencil |
C pencil |
||
type(dtfft_pencil_t), | intent(out) | :: | pencil |
Fortran pencil |
Obtain local starts and counts in real
and fourier
spaces
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pencil), | intent(in) | :: | pencils(:) |
Array of pencils |
||
integer(kind=int32), | intent(out), | optional | :: | in_starts(:) |
Start indexes in |
|
integer(kind=int32), | intent(out), | optional | :: | in_counts(:) |
Number of elements in |
|
integer(kind=int32), | intent(out), | optional | :: | out_starts(:) |
Start indexes in |
|
integer(kind=int32), | intent(out), | optional | :: | out_counts(:) |
Number of elements in |
|
integer(kind=int64), | intent(out), | optional | :: | alloc_size |
Minimal number of elements required to execute plan |
Creates pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pencil), | intent(inout) | :: | self |
Pencil |
||
integer(kind=int8), | intent(in) | :: | rank |
Rank of buffer |
||
integer(kind=int8), | intent(in) | :: | aligned_dim |
Position of aligned dimension |
||
integer(kind=int32), | intent(in) | :: | counts(:) |
Global counts |
||
type(MPI_Comm), | intent(in) | :: | comms(:) |
Grid communicators |
||
integer(kind=int32), | intent(in), | optional | :: | lstarts(:) |
Local starts |
|
integer(kind=int32), | intent(in), | optional | :: | lcounts(:) |
Local counts |
Destroys pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pencil), | intent(inout) | :: | self |
Pencil |
Computes local portions of data based on global count and position inside grid communicator
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | n_global |
Global number of points |
||
type(MPI_Comm), | intent(in) | :: | comm |
Grid communicator |
||
integer(kind=int32), | intent(out) | :: | start |
Local start |
||
integer(kind=int32), | intent(out) | :: | count |
Local count |
||
integer(kind=int32), | intent(in), | optional | :: | start_to_keep |
Start to keep in case of user defined decomposition |
|
integer(kind=int32), | intent(in), | optional | :: | size_to_keep |
Size to keep in case of user defined decomposition |
Destroys pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dtfft_pencil_t), | intent(inout) | :: | self |
Public pencil |
Destroys pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dtfft_pencil_t), | intent(inout) | :: | self |
Public pencil |
Destroys pencil_init
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pencil_init), | intent(inout) | :: | self |
Internal pencil representation based on dtfft_pencil_t |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(inout) | :: | ranks(:) | |||
integer(kind=int32), | intent(in) | :: | coords(:) |
Creates a new 1D communicator based on the fixed dimensions of the current pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | lbounds(:) |
Local starts of the current pencil |
||
integer(kind=int32), | intent(in) | :: | all_lbounds(:,:) |
Local starts of all processes |
||
integer(kind=int32), | intent(in) | :: | fixed_dims(:) |
Indices of fixed coordinates |
||
type(MPI_Comm), | intent(in) | :: | comm |
Original MPI communicator |
||
type(MPI_Comm), | intent(out) | :: | new_comm |
New 1D MPI communicator |