This module describes transpose_plan class
Transpose Plan class This class is a container for transposition plans
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(dtfft_backend_t), | public | :: | backend |
Backend |
|||
| type(backend_helper), | public | :: | helper |
Backend helper |
|||
| integer(kind=int64), | public | :: | min_buffer_size |
Minimal buffer size for transposition |
|||
| type(dtfft_platform_t), | public | :: | platform |
Platform used for transposition |
|||
| type(dtfft_stream_t), | public | :: | stream |
CUDA stream |
|||
| type(reshape_container), | public, | allocatable | :: | plans(:) |
Plans for each reshape operation |
||
| type(string), | public, | allocatable | :: | names(:) |
Names of each reshape operation |
||
| integer(kind=int32), | public, | allocatable | :: | colors(:) | |||
| logical, | private | :: | is_z_slab |
Is Z-slab optimization enabled |
|||
| logical, | private | :: | is_y_slab |
Is Y-slab optimization enabled |
| procedure, public, pass(self), non_overridable :: init | ../../ Initializes reshape plan base |
| procedure, public, pass(self), non_overridable :: get_async_active | ../../ Returns .true. if any of the plans is running asynchronously |
| procedure, public, pass(self), non_overridable :: get_aux_bytes | ../../ Returns auxiliary buffer size |
| procedure, public, pass(self), non_overridable :: is_aux_needed | ../../ Returns .true. if aux buffer is needed |
| procedure, public, pass(self), non_overridable :: get_backend | ../../ Returns backend id |
| procedure, public, pass(self), non_overridable :: report_backends | ../../ Reports backends used by each plan. Should be used only for adaptive backend |
| procedure, public, pass(self), non_overridable :: is_nvshmem | |
| procedure, public, pass(self), non_overridable :: execute | ../../ Executes reshape |
| procedure, public, pass(self), non_overridable :: execute_end | ../../ Finishes asynchronous reshape |
| procedure, public, pass(self), non_overridable :: mem_alloc | ../../ Allocates memory |
| procedure, public, pass(self), non_overridable :: mem_free | ../../ Frees memory |
| procedure, public, pass(self) :: destroy | ../../ Destroys reshape plan |
| procedure, public, pass(self) :: report_compression | ../../ Reports compression statistics |
| procedure, public, non_overridable, pass(self) :: create | ../../ Creates transpose plan |
| procedure, public, non_overridable, pass(self) :: get_z_slab | ../../ Returns .true. if Z-slab optimization is enabled |
| procedure, public, non_overridable, pass(self) :: get_y_slab | ../../ Returns .true. if Y-slab optimization is enabled |
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 Z-slab optimization is enabled
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
Returns .true. if Y-slab optimization is enabled
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transpose_plan), | intent(in) | :: | self |
Transposition class |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(MPI_Comm), | intent(in) | :: | cart_comm |
3D Cartesian comm |
||
| type(create_args), | intent(inout) | :: | create_kwargs |
Create arguments |
||
| type(pencil), | intent(in) | :: | pencils(:) |
Layouts |
||
| type(backend_helper), | intent(inout) | :: | helper | |||
| logical, | intent(in) | :: | is_z_slab |
Is Z-slab optimization enabled |
||
| logical, | intent(in) | :: | is_y_slab |
Is Y-slab optimization enabled |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
Effort level for the plan creation |
||
| type(dtfft_stream_t), | intent(in) | :: | stream |
Stream to use |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | fmodes(:) |
Best transpose modes for forward plan |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | bmodes(:) |
Best transpose modes for backward plan |
Creates transpose plan for backend, specified by create_kwargs and executes it DTFFT_MEASURE_WARMUP_ITERS + DTFFT_MEASURE_ITERS times
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(create_args), | intent(inout) | :: | create_kwargs | |||
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(pencil), | intent(in) | :: | from |
Source meta |
||
| type(pencil), | intent(in) | :: | to |
Target meta |
||
| integer(kind=int8), | intent(in) | :: | transpose_name_id |
ID of transpose name (from -3 to 3, except 0) |
Execution time [ms]
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 |
||
| type(MPI_Comm), | intent(in) | :: | base_comm |
3D comm |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
Effort level for the plan creation |
||
| type(dtfft_transpose_mode_t), | intent(in) | :: | transpose_mode |
Transpose mode to use |
||
| 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 |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | fmodes(:) |
Best transpose modes for forward plan |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | bmodes(:) |
Best transpose modes 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 |
|
| type(dtfft_transpose_mode_t), | intent(out), | optional | :: | best_transpose_mode |
Best transpose mode selected |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | fbacks(:) |
Best backends for forward plans |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | bbacks(:) |
Best backends for backward plans |
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 |
||
| type(MPI_Comm), | intent(in) | :: | base_comm |
Basic communicator to create 3d grid from |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
Effort level for the plan creation |
||
| type(dtfft_transpose_mode_t), | intent(in) | :: | transpose_mode |
Transpose mode to use |
||
| 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 |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | fmodes(:) |
Best transpose modes for forward plan |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | bmodes(:) |
Best transpose modes 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 |
|
| type(dtfft_transpose_mode_t), | intent(out), | optional | :: | best_transpose_mode |
Best transpose mode selected |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | fbacks(:) |
Best backends for forward plans |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | bbacks(:) |
Best backends for backward plans |
Runs autotune for all backends
| 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 |
Effort level for the plan creation |
||
| type(dtfft_transpose_mode_t), | intent(in) | :: | transpose_mode |
Transpose mode to use |
||
| type(MPI_Datatype), | intent(in) | :: | base_dtype |
Base MPI_Datatype |
||
| type(pencil), | intent(in) | :: | pencils(:) |
Layouts |
||
| 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 |
||
| logical, | intent(in) | :: | is_y_slab |
Is Y-slab optimization enabled |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | fmodes(:) |
Best transpose modes for forward plan |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | bmodes(:) |
Best transpose modes 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(dtfft_transpose_mode_t), | intent(out), | optional | :: | best_transpose_mode |
Best transpose mode selected |
|
| type(dtfft_backend_t), | intent(out), | optional | :: | fbacks(:) | ||
| type(dtfft_backend_t), | intent(out), | optional | :: | bbacks(:) |
Executes autotuning over all single transpose plans and returns best transpose modes and their execution times
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_backend_t), | intent(in) | :: | base_backend |
Backend to test |
||
| type(dtfft_effort_t), | intent(in) | :: | effort |
Effort level for the plan creation |
||
| type(create_args), | intent(inout) | :: | create_kwargs |
Create arguments |
||
| type(backend_helper), | intent(inout) | :: | helper |
Base MPI_Datatype |
||
| type(pencil), | intent(in) | :: | pencils(:) |
Pencils metadata |
||
| logical, | intent(in) | :: | is_z_slab |
Is Z-slab optimization enabled |
||
| logical, | intent(in) | :: | is_y_slab |
Is Y-slab optimization enabled |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | fmodes(:) |
Best transpose modes for forward plan |
||
| type(dtfft_transpose_mode_t), | intent(inout) | :: | bmodes(:) |
Best transpose modes for backward plan |
||
| real(kind=real32), | intent(out) | :: | ftimes(:) |
Elapsed time for best forward plans selected in [ms] |
||
| real(kind=real32), | intent(out) | :: | btimes(:) |
Elapsed time for best backward plans selected in [ms] |
||
| logical, | intent(in), | optional | :: | phase_created |
Whether caliper phase was created |
Creates forward and backward transpose plans for backend, specified by create_kwargs, 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(dtfft_backend_t), | intent(in) | :: | base_backend | |||
| type(dtfft_effort_t), | intent(in) | :: | effort | |||
| type(create_args), | intent(inout) | :: | create_kwargs | |||
| type(backend_helper), | intent(inout) | :: | helper |
Backend helper |
||
| type(pencil), | intent(in) | :: | from |
Source meta |
||
| type(pencil), | intent(in) | :: | to |
Target meta |
||
| integer(kind=int8), | intent(in) | :: | transpose_name_id |
ID of transpose name (from -3 to 3, except 0) |
||
| type(dtfft_transpose_mode_t), | intent(out) | :: | fmode |
Best forward plan ID |
||
| type(dtfft_transpose_mode_t), | intent(out) | :: | bmode |
Best backward plan ID |
||
| real(kind=real32), | intent(out) | :: | forward_time |
Forward plan execution time |
||
| real(kind=real32), | intent(out) | :: | backward_time |
Backward plan execution time |
Returns data and communicator permutations for given number of dimensions
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(in) | :: | ndims |
Number of dimensions |
||
| integer(kind=int8), | intent(out), | allocatable | :: | dperm(:,:) |
Data permutations |
|
| integer(kind=int8), | intent(out), | allocatable | :: | cperm(:,:) |
Communicator permutations |
Creates cartesian communicator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | dims(:) |
Global dimensions |
||
| 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 |