This module describes transpose_plan class
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int8), | private, | save | :: | FORWARD_PLAN_IDS(3) |
Default data types for forward transpositions |
||
| integer(kind=int8), | private, | save | :: | BACKWARD_PLAN_IDS(3) |
Default data types for backward transpositions |
||
| logical, | private, | save | :: | ARE_DATATYPES_SET | = | .false. |
Are default data types set |
Transpose Plan class This class is a container for transposition plans
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(dtfft_backend_t), | private | :: | backend |
Backend |
|||
| type(backend_helper), | private | :: | helper |
Backend helper |
|||
| logical, | private | :: | is_z_slab |
Z-slab optimization flag (for 3D transforms) |
|||
| integer(kind=int64), | private | :: | min_buffer_size |
Minimal buffer size for transposition |
|||
| type(dtfft_platform_t), | private | :: | platform |
Platform used for transposition |
|||
| type(dtfft_stream_t), | private | :: | stream |
CUDA stream |
|||
| type(c_ptr), | private | :: | aux |
Auxiliary memory |
|||
| real(kind=real32), | private, | pointer | :: | paux(:) |
Pointer to auxiliary memory |
||
| logical, | private | :: | is_aux_alloc | = | .false. |
Is auxiliary memory allocated |
|
| type(plan_t), | private, | allocatable | :: | plans(:) |
Plans for each transposition |
| procedure, public, non_overridable, pass(self) :: create | ../../ Creates transpose plan |
| procedure, public, non_overridable, pass(self) :: execute | ../../ Executes transposition |
| procedure, public, non_overridable, pass(self) :: execute_end | ../../ Finishes asynchronous transposition |
| procedure, public, non_overridable, pass(self) :: get_async_active | ../../ Returns .true. if any of the plans is running asynchronously |
| procedure, public, non_overridable, pass(self) :: destroy | ../../ Destroys transpose plan |
| procedure, public, non_overridable, pass(self) :: get_aux_size | ../../ Returns auxiliary buffer size |
| procedure, public, non_overridable, pass(self) :: get_backend | ../../ Returns backend id |
| procedure, public, non_overridable, pass(self) :: get_z_slab | ../../ Returns .true. if Z-slab optimization is enabled |
| procedure, public, non_overridable, pass(self) :: mem_alloc | ../../ Allocates memory based on selected backend |
| procedure, public, non_overridable, pass(self) :: mem_free | ../../ Frees memory allocated with mem_alloc |
This type is a container for allocatable transpose handles
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| class(abstract_transpose_handle), | public, | allocatable | :: | p |
Transpose handle |
Creates transposition plan
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
||
| type(dtfft_platform_t), | intent(in) | :: | platform |
Platform to create plan for |
||
| integer(kind=int32), | intent(in) | :: | dims(:) |
Global sizes of the transform requested |
||
| type(MPI_Comm), | intent(in) | :: | base_comm |
Base communicator |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
|
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
| type(MPI_Comm), | intent(out) | :: | cart_comm |
Cartesian communicator |
||
| type(MPI_Comm), | intent(out) | :: | comms(:) |
Array of 1d communicators |
||
| type(pencil), | intent(out) | :: | pencils(:) |
Data distributing meta |
||
| type(pencil_init), | intent(in), | optional | :: | ipencil |
Pencil passed by user |
Error code
Returns .true. if any of the plans is running asynchronously
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
Returns .true. if Z-slab optimization is enabled
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
Creates forward and backward transpose plans for backend DTFFT_BACKEND_MPI_DATATYPE based on source and target data distributions and,
executes them DTFFT_MEASURE_ITERS times ( 4 * DTFFT_MEASURE_ITERS iterations total ) + 4 * DTFFT_MEASURE_WARMUP_ITERS warmup iterations
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(pencil), | intent(in) | :: | from |
Source meta |
||
| type(pencil), | intent(in) | :: | to |
Target meta |
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Basic MPI Datatype |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store Basic MPI Datatype |
||
| integer(kind=int8), | intent(in) | :: | transpose_name_id |
ID of transpose name (from -3 to 3, except 0) |
||
| real(kind=real32), | intent(inout) | :: | a(:) |
Source buffer |
||
| real(kind=real32), | intent(inout) | :: | b(:) |
Target buffer |
||
| integer(kind=int8), | intent(out) | :: | forward_id |
Best forward plan ID |
||
| integer(kind=int8), | intent(out) | :: | backward_id |
Best backward plan ID |
Elapsed time for best plans selected
Creates transpose plan for backend DTFFT_BACKEND_MPI_DATATYPE and executes it DTFFT_MEASURE_WARMUP_ITERS + DTFFT_MEASURE_ITERS times
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(pencil), | intent(in) | :: | from |
Source meta |
||
| type(pencil), | intent(in) | :: | to |
Target meta |
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Basic MPI Datatype |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store Basic MPI Datatype |
||
| integer(kind=int8), | intent(in) | :: | datatype_id |
ID of transpose (1 or 2) |
||
| integer(kind=int8), | intent(in) | :: | transpose_name_id |
ID of transpose name (from -3 to 3, except 0) |
||
| real(kind=real32), | intent(inout) | :: | a(:) |
Source buffer |
||
| real(kind=real32), | intent(inout) | :: | b(:) |
Target buffer |
Execution time [ms]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(MPI_Comm), | intent(in) | :: | comm | |||
| real(kind=real32), | intent(in) | :: | elapsed_time | |||
| integer(kind=int32), | intent(in) | :: | n_iters | |||
| integer(kind=int32), | intent(in), | optional | :: | space_count |
Returns maximum auxiliary memory size needed by transpose plan
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
Returns maximum auxiliary memory size needed by plans
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plan_t), | intent(in) | :: | plans(:) |
Transpose plans |
Maximum auxiliary memory size needed
Returns plan GPU backend
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
Executes transposition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
||
| type(c_ptr), | intent(in) | :: | in |
Incoming buffer |
||
| type(c_ptr), | intent(in) | :: | out |
Resulting buffer |
||
| type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Type of transpose to execute |
||
| type(async_exec_t), | intent(in) | :: | exec_type |
Type of execution (sync/async) |
||
| integer(kind=int32), | intent(out), | optional | :: | error_code |
Error code |
Finishes asynchronous transposition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
||
| type(c_ptr), | intent(in) | :: | in |
Incoming buffer |
||
| type(c_ptr), | intent(in) | :: | out |
Resulting buffer |
||
| type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Type of transpose |
||
| integer(kind=int32), | intent(out) | :: | error_code |
Error code |
Destroys transposition plans
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
Allocates array of plans
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plan_t), | intent(inout) | :: | plans(:) |
Plans to allocate |
||
| type(dtfft_backend_t), | intent(in) | :: | backend |
Backend to use |
Destroys array of plans
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plan_t), | intent(inout) | :: | plans(:) |
Plans to destroy |
Runs through all possible grid decompositions and selects the best one based on the lowest average execution time
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform |
Platform to use |
||
| integer(kind=int32), | intent(in) | :: | dims(:) |
Global sizes of the transform requested |
||
| integer(kind=int32), | intent(in) | :: | transposed_dims(:,:) |
Transposed dimensions |
||
| type(MPI_Comm), | intent(in) | :: | base_comm |
3D comm |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
How thoroughly |
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
| type(dtfft_stream_t), | intent(in) | :: | stream |
Stream to use |
||
| integer(kind=int8), | intent(inout) | :: | best_forward_ids(:) |
Best Datatype ids for forward plan |
||
| integer(kind=int8), | intent(inout) | :: | best_backward_ids(:) |
Best Datatype ids for backward plan |
||
| integer(kind=int32), | intent(out) | :: | best_decomposition(:) |
Best decomposition found |
||
| type(dtfft_backend_t), | intent(in), | optional | :: | backend |
GPU Backend to test. Should be passed only when effort is |
|
| real(kind=real32), | intent(out), | optional | :: | min_execution_time |
Elapsed time for best plan selected |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | best_backend |
Best backend selected |
Creates cartesian grid and runs various backends on it. Returns best backend and execution time
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform |
Platform to create plan for |
||
| integer(kind=int32), | intent(in) | :: | dims(:) |
Global sizes of the transform requested |
||
| integer(kind=int32), | intent(in) | :: | transposed_dims(:,:) |
Transposed dimensions |
||
| type(MPI_Comm), | intent(in) | :: | base_comm |
Basic communicator to create 3d grid from |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
How thoroughly |
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| integer(kind=int32), | intent(in) | :: | comm_dims(:) |
Number of processors in each dimension |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
| type(dtfft_stream_t), | intent(in) | :: | stream |
Stream to use |
||
| logical, | intent(in) | :: | is_z_slab |
Is Z-slab optimization enabled |
||
| integer(kind=int8), | intent(inout) | :: | best_forward_ids(:) |
Best Datatype ids for forward plan |
||
| integer(kind=int8), | intent(inout) | :: | best_backward_ids(:) |
Best Datatype ids for backward plan |
||
| type(dtfft_backend_t), | intent(in), | optional | :: | backend |
GPU Backend to test. Should be passed only when effort is |
|
| real(kind=real32), | intent(out), | optional | :: | best_time |
Elapsed time for best plan selected |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | best_backend |
Best backend selected for the grid |
Runs autotune for all backends Symmetric heap can be allocated after nvshmem_init, which is done during plan creation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform |
Platform to create plan for |
||
| type(MPI_Comm), | intent(in) | :: | comms(:) |
1D comms |
||
| type(MPI_Comm), | intent(in) | :: | cart_comm |
3D Cartesian comm |
||
| type(dtfft_effort_t), | intent(in) | :: | effort | |||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| type(pencil), | intent(in) | :: | pencils(:) |
Source meta |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
| type(dtfft_stream_t), | intent(in) | :: | stream |
Stream to use |
||
| logical, | intent(in) | :: | is_z_slab |
Is Z-slab optimization enabled |
||
| integer(kind=int8), | intent(inout) | :: | best_forward_ids(:) |
Best Datatype ids for forward plan |
||
| integer(kind=int8), | intent(inout) | :: | best_backward_ids(:) |
Best Datatype ids for backward plan |
||
| type(dtfft_backend_t), | intent(in), | optional | :: | backend |
GPU Backend to test. Should be passed only when effort is |
|
| real(kind=real32), | intent(out), | optional | :: | best_time |
Elapsed time for best backend |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | best_backend |
Best backend selected |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(backend_helper), | intent(inout) | :: | helper | |||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| type(pencil), | intent(in) | :: | pencils(:) |
Source meta |
||
| integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
| logical, | intent(in) | :: | is_z_slab |
Is Z-slab optimization enabled |
||
| integer(kind=int8), | intent(out) | :: | best_forward_ids(:) |
Best Datatype ids for forward plan |
||
| integer(kind=int8), | intent(out) | :: | best_backward_ids(:) |
Best Datatype ids for backward plan |
||
| real(kind=real32), | intent(inout) | :: | a(:) |
Source buffer |
||
| real(kind=real32), | intent(inout) | :: | b(:) |
Target buffer |
||
| real(kind=real32), | intent(out) | :: | elapsed_time |
Elapsed time for best plans selected in [ms] |
Allocates auxiliary memory according to the backend and sets it to the plans
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform | |||
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(dtfft_backend_t), | intent(in) | :: | backend |
GPU backend |
||
| type(MPI_Comm), | intent(in) | :: | cart_comm |
Cartesian communicator |
||
| type(c_ptr), | intent(inout) | :: | aux |
Allocatable auxiliary memory |
||
| real(kind=real32), | intent(inout), | pointer | :: | paux(:) |
Pointer to auxiliary memory |
|
| type(plan_t), | intent(in) | :: | plans(:) | |||
| logical | :: | is_aux_alloc |
Is auxiliary memory allocated |
Creates cartesian communicator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | transposed_dims(:,:) |
Global counts in transposed coordinates |
||
| type(MPI_Comm), | intent(in) | :: | old_comm |
Communicator to create cartesian from |
||
| integer(kind=int32), | intent(in) | :: | comm_dims(:) |
Dims in cartesian communicator |
||
| type(MPI_Comm), | intent(out) | :: | comm |
Cartesian communicator |
||
| type(MPI_Comm), | intent(out) | :: | local_comms(:) |
1d communicators in cartesian communicator |
||
| type(pencil), | intent(out) | :: | pencils(:) |
Data distributing meta |
||
| type(pencil_init), | intent(in), | optional | :: | ipencil |
Pencil passed by user |
Creates cartesian communicator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(MPI_Comm), | intent(in) | :: | old_comm |
Communicator to create cartesian from |
||
| integer(kind=int32), | intent(in) | :: | comm_dims(:) |
Dims in cartesian communicator |
||
| type(MPI_Comm), | intent(out) | :: | comm |
Cartesian communicator |
||
| type(MPI_Comm), | intent(out) | :: | local_comms(:) |
1d communicators in cartesian communicator |
||
| type(pencil_init), | intent(in), | optional | :: | ipencil |
Pencil passed by user |
Allocates memory based on selected backend
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
||
| type(MPI_Comm), | intent(in) | :: | comm |
MPI communicator |
||
| integer(kind=int64), | intent(in) | :: | alloc_bytes |
Number of bytes to allocate |
||
| type(c_ptr), | intent(out) | :: | ptr |
Pointer to the allocated memory |
||
| integer(kind=int32), | intent(out) | :: | error_code |
Error code |
Frees memory allocated with mem_alloc
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(inout) | :: | self |
Transposition class |
||
| type(c_ptr), | intent(in) | :: | ptr |
Pointer to the memory to free |
||
| integer(kind=int32), | intent(out) | :: | error_code |
Error code |
Allocates memory based on backend
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform | |||
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(dtfft_backend_t), | intent(in) | :: | backend |
GPU backend |
||
| type(MPI_Comm), | intent(in) | :: | comm |
MPI communicator |
||
| integer(kind=int64), | intent(in) | :: | alloc_bytes |
Number of bytes to allocate |
||
| type(c_ptr), | intent(out) | :: | ptr |
Pointer to the allocated memory |
||
| integer(kind=int32), | intent(out) | :: | error_code |
Error code |
Frees memory based on backend
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_platform_t), | intent(in) | :: | platform | |||
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(dtfft_backend_t), | intent(in) | :: | backend |
GPU backend |
||
| type(c_ptr), | intent(in) | :: | ptr |
Pointer to the memory to free |
||
| integer(kind=int32), | intent(out) | :: | error_code |
Error code |