Configuration module for dtFFT. It handles both runtime (environment variables) and compile-time (dtfft_config_t) configurations.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | private, | save | :: | is_init_called | = | .false. |
Has init_internal already been called or not |
| integer(kind=int32), | private, | save | :: | log_enabled_from_env | = | VARIABLE_NOT_SET |
Should we log messages to stdout or not |
| type(dtfft_platform_t), | private, | save | :: | platform_from_env | = | PLATFORM_NOT_SET |
Platform obtained from environ |
| integer(kind=int32), | private, | save | :: | z_slab_from_env | = | VARIABLE_NOT_SET |
Should Z-slab be used if possible |
| integer(kind=int32), | private, | save | :: | y_slab_from_env | = | VARIABLE_NOT_SET |
Should Y-slab be used if possible |
| integer(kind=int32), | private, | save | :: | n_measure_warmup_iters_from_env | = | VARIABLE_NOT_SET |
Number of warmup iterations for measurements |
| integer(kind=int32), | private, | save | :: | n_measure_iters_from_env | = | VARIABLE_NOT_SET |
Number of measurement iterations |
| logical, | private, | save | :: | is_log_enabled | = | .false. |
Should we print additional information during plan creation |
| logical, | private, | save | :: | is_z_slab_enabled | = | .true. |
Should we use Z-slab optimization or not |
| logical, | private, | save | :: | is_y_slab_enabled | = | .false. |
Should we use Y-slab optimization or not |
| type(dtfft_platform_t), | private, | save | :: | platform | = | DTFFT_PLATFORM_HOST |
Default platform |
| integer(kind=int32), | private, | save | :: | n_measure_warmup_iters | = | 2 |
Number of warmup iterations for measurements |
| integer(kind=int32), | private, | save | :: | n_measure_iters | = | 5 |
Number of measurement iterations |
| type(dtfft_backend_t), | private, | save | :: | backend_from_env | = | BACKEND_NOT_SET |
Backend obtained from environ |
| integer(kind=int32), | private, | save | :: | datatype_enabled_from_env | = | VARIABLE_NOT_SET |
Should we use MPI Datatype backend during autotune or not |
| integer(kind=int32), | private, | save | :: | mpi_enabled_from_env | = | VARIABLE_NOT_SET |
Should we use MPI backends during autotune or not |
| integer(kind=int32), | private, | save | :: | pipelined_enabled_from_env | = | VARIABLE_NOT_SET |
Should we use pipelined backends during autotune or not |
| integer(kind=int32), | private, | save | :: | kernel_optimization_enabled_from_env | = | VARIABLE_NOT_SET |
Should we enable kernel block optimization during autotune or not |
| integer(kind=int32), | private, | save | :: | n_configs_to_test_from_env | = | VARIABLE_NOT_SET |
Number of blocks to test during nvrtc kernel autotune |
| integer(kind=int32), | private, | save | :: | forced_kernel_optimization_from_env | = | VARIABLE_NOT_SET |
Should we force kernel optimization even when effort is not DTFFT_PATIENT |
| integer(kind=int32), | private, | save | :: | nccl_enabled_from_env | = | VARIABLE_NOT_SET |
Should we use NCCL backends during autotune or not |
| integer(kind=int32), | private, | save | :: | nvshmem_enabled_from_env | = | VARIABLE_NOT_SET |
Should we use NVSHMEM backends during autotune or not |
| type(dtfft_backend_t), | private, | parameter | :: | DEFAULT_BACKEND | = | BACKEND_NOT_SET |
Default backend when cuda is enabled |
| type(dtfft_stream_t), | private, | save | :: | main_stream | = | NULL_STREAM |
Default dtFFT CUDA stream |
| type(dtfft_stream_t), | private, | save | :: | custom_stream | = | NULL_STREAM |
CUDA stream set by the user |
| logical, | private, | save | :: | is_stream_created | = | .false. |
Is the default stream created? |
| logical, | private, | save | :: | is_custom_stream | = | .false. |
Is the custom stream provided by the user? |
| logical, | private, | save | :: | is_datatype_enabled | = | .true. |
Should we use MPI Datatype backend or not |
| logical, | private, | save | :: | is_pipelined_enabled | = | .true. |
Should we use pipelined backends or not |
| logical, | private, | save | :: | is_mpi_enabled | = | .false. |
Should we use MPI backends or not |
| logical, | private, | save | :: | is_nccl_enabled | = | .true. |
Should we use NCCL backends or not |
| logical, | private, | save | :: | is_nvshmem_enabled | = | .true. |
Should we use NCCL backends or not |
| logical, | private, | save | :: | is_kernel_optimization_enabled | = | .true. |
Should we use kernel optimization or not |
| integer(kind=int32), | private, | save | :: | n_configs_to_test | = | 5 |
Number of different NVRTC kernel configurations to try during autotune |
| logical, | private, | save | :: | is_forced_kernel_optimization | = | .false. |
Should we use forced kernel optimization or not |
| type(dtfft_backend_t), | private, | save | :: | backend | = | DEFAULT_BACKEND |
Default backend |
| character(len=26), | private, | parameter | :: | UPPER_ALPHABET | = | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
Upper case alphabet. |
| character(len=26), | private, | parameter | :: | LOWER_ALPHABET | = | 'abcdefghijklmnopqrstuvwxyz' |
Lower case alphabet. |
Interface to create a new configuration
Creates a new configuration
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in), | optional | :: | enable_log |
Should dtFFT use Z-slab optimization or not. |
|
| logical, | intent(in), | optional | :: | enable_z_slab |
Should dtFFT use Z-slab optimization or not. |
|
| logical, | intent(in), | optional | :: | enable_y_slab |
Should dtFFT use Y-slab optimization or not. |
|
| integer(kind=int32), | intent(in), | optional | :: | n_measure_warmup_iters |
Number of warmup iterations for measurements |
|
| integer(kind=int32), | intent(in), | optional | :: | n_measure_iters |
Number of measurement iterations |
|
| type(dtfft_platform_t), | intent(in), | optional | :: | platform |
Selects platform to execute plan. |
|
| type(dtfft_stream_t), | intent(in), | optional | :: | stream |
Main CUDA stream that will be used in dtFFT. |
|
| type(dtfft_backend_t), | intent(in), | optional | :: | backend |
Backend that will be used by dtFFT when |
|
| logical, | intent(in), | optional | :: | enable_datatype_backend |
Should |
|
| logical, | intent(in), | optional | :: | enable_mpi_backends |
Should MPI Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_pipelined_backends |
Should pipelined backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_nccl_backends |
Should NCCL Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_nvshmem_backends |
Should NVSHMEM Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_kernel_optimization |
Should dtFFT try to optimize NVRTC kernel block size during autotune or not. |
|
| integer(kind=int32), | intent(in), | optional | :: | n_configs_to_test |
Number of top theoretical best performing blocks of threads to test for transposition kernels when |
|
| logical, | intent(in), | optional | :: | force_kernel_optimization |
Whether to force kernel optimization when |
Constructed dtFFT config ready to be set by call to dtfft_set_config
Obtains environment variable
Base function of obtaining dtFFT environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
Obtains string environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| character(len=*), | intent(in) | :: | default |
Name of environment variable without prefix |
||
| type(string), | intent(in) | :: | valid_values(:) |
List of valid variable values |
Base Integer function of obtaining dtFFT environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| integer(kind=int32), | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
||
| integer(kind=int32), | intent(in), | optional | :: | valid_values(:) |
List of valid values |
|
| integer(kind=int32), | intent(in), | optional | :: | min_valid_value |
Mininum valid value. Usually 0 or 1 |
Obtains int8 environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| integer(kind=int8), | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
||
| integer(kind=int32), | intent(in) | :: | valid_values(:) |
List of valid values |
Obtains logical environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| logical, | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
Returns value from configuration unless environment variable is set
Returns value from configuration unless environment variable is set
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in) | :: | from_conf |
Value from configuration |
||
| integer(kind=int32), | intent(in) | :: | from_env |
Value from environment variable |
Returns value from configuration unless environment variable is set
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | from_conf |
Value from configuration |
||
| integer(kind=int32), | intent(in) | :: | from_env |
Value from environment variable |
Type that can be used to set additional configuration parameters to dtFFT
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical(kind=c_bool), | public | :: | enable_log |
Should dtFFT print additional information during plan creation or not. |
|||
| logical(kind=c_bool), | public | :: | enable_z_slab |
Should dtFFT use Z-slab optimization or not. |
|||
| logical(kind=c_bool), | public | :: | enable_y_slab |
Should dtFFT use Y-slab optimization or not. |
|||
| integer(kind=c_int32_t), | public | :: | n_measure_warmup_iters |
Number of warmup iterations to execute when effort level is higher or equal to |
|||
| integer(kind=c_int32_t), | public | :: | n_measure_iters |
Number of iterations to execute when effort level is higher or equal to |
|||
| type(dtfft_platform_t), | public | :: | platform |
Selects platform to execute plan. |
|||
| type(dtfft_stream_t), | public | :: | stream |
Main CUDA stream that will be used in dtFFT. |
|||
| type(dtfft_backend_t), | public | :: | backend |
Backend that will be used by dtFFT when |
|||
| logical(kind=c_bool), | public | :: | enable_datatype_backend |
Should |
|||
| logical(kind=c_bool), | public | :: | enable_mpi_backends |
Should MPI Backends be enabled when |
|||
| logical(kind=c_bool), | public | :: | enable_pipelined_backends |
Should pipelined backends be enabled when |
|||
| logical(kind=c_bool), | public | :: | enable_nccl_backends |
Should NCCL Backends be enabled when |
|||
| logical(kind=c_bool), | public | :: | enable_nvshmem_backends |
Should NVSHMEM Backends be enabled when |
|||
| logical(kind=c_bool), | public | :: | enable_kernel_optimization |
Should dtFFT try to optimize NVRTC kernel block size when |
|||
| integer(kind=c_int32_t), | public | :: | n_configs_to_test |
Number of top theoretical best performing blocks of threads to test for transposition kernels
when |
|||
| logical(kind=c_bool), | public | :: | force_kernel_optimization |
Whether to force kernel optimization when |
Interface to create a new configuration
| private pure function config_constructor (enable_log, enable_z_slab, enable_y_slab, n_measure_warmup_iters, n_measure_iters, platform, stream, backend, enable_datatype_backend, enable_mpi_backends, enable_pipelined_backends, enable_nccl_backends, enable_nvshmem_backends, enable_kernel_optimization, n_configs_to_test, force_kernel_optimization) | Creates a new configuration |
Checks if MPI is initialized and loads environment variables
Whether logging is enabled or not
Result flag
Whether Z-slab optimization is enabled or not
Result flag
Whether Y-slab optimization is enabled or not
Result flag
Returns the number of warmup iterations
Result
Returns the number of measurement iterations
Result
Returns either the custom provided by user or creates a new one
Whether MPI Datatype backend is enabled or not
Result flag
Whether pipelined backends are enabled or not
Result flag
Whether MPI backends are enabled or not
Result flag
Whether NCCL backends are enabled or not
Result flag
Whether nvshmem backends are enabled or not
Result flag
Whether kernel optimization is enabled or not
Result flag
Returns the number of configurations to test
Result
Whether forced kernel optimization is enabled or not
Result flag
Obtains datatype id from environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
Creates a new configuration
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in), | optional | :: | enable_log |
Should dtFFT use Z-slab optimization or not. |
|
| logical, | intent(in), | optional | :: | enable_z_slab |
Should dtFFT use Z-slab optimization or not. |
|
| logical, | intent(in), | optional | :: | enable_y_slab |
Should dtFFT use Y-slab optimization or not. |
|
| integer(kind=int32), | intent(in), | optional | :: | n_measure_warmup_iters |
Number of warmup iterations for measurements |
|
| integer(kind=int32), | intent(in), | optional | :: | n_measure_iters |
Number of measurement iterations |
|
| type(dtfft_platform_t), | intent(in), | optional | :: | platform |
Selects platform to execute plan. |
|
| type(dtfft_stream_t), | intent(in), | optional | :: | stream |
Main CUDA stream that will be used in dtFFT. |
|
| type(dtfft_backend_t), | intent(in), | optional | :: | backend |
Backend that will be used by dtFFT when |
|
| logical, | intent(in), | optional | :: | enable_datatype_backend |
Should |
|
| logical, | intent(in), | optional | :: | enable_mpi_backends |
Should MPI Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_pipelined_backends |
Should pipelined backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_nccl_backends |
Should NCCL Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_nvshmem_backends |
Should NVSHMEM Backends be enabled when |
|
| logical, | intent(in), | optional | :: | enable_kernel_optimization |
Should dtFFT try to optimize NVRTC kernel block size during autotune or not. |
|
| integer(kind=int32), | intent(in), | optional | :: | n_configs_to_test |
Number of top theoretical best performing blocks of threads to test for transposition kernels when |
|
| logical, | intent(in), | optional | :: | force_kernel_optimization |
Whether to force kernel optimization when |
Constructed dtFFT config ready to be set by call to dtfft_set_config
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_backend_t), | intent(in) | :: | back |
Returns value from configuration unless environment variable is set
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in) | :: | from_conf |
Value from configuration |
||
| integer(kind=int32), | intent(in) | :: | from_env |
Value from environment variable |
Returns value from configuration unless environment variable is set
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | from_conf |
Value from configuration |
||
| integer(kind=int32), | intent(in) | :: | from_env |
Value from environment variable |
Base function of obtaining dtFFT environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
Obtains string environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| character(len=*), | intent(in) | :: | default |
Name of environment variable without prefix |
||
| type(string), | intent(in) | :: | valid_values(:) |
List of valid variable values |
Base Integer function of obtaining dtFFT environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| integer(kind=int32), | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
||
| integer(kind=int32), | intent(in), | optional | :: | valid_values(:) |
List of valid values |
|
| integer(kind=int32), | intent(in), | optional | :: | min_valid_value |
Mininum valid value. Usually 0 or 1 |
Obtains int8 environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| integer(kind=int8), | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
||
| integer(kind=int32), | intent(in) | :: | valid_values(:) |
List of valid values |
Obtains logical environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Name of environment variable without prefix |
||
| logical, | intent(in) | :: | default |
Default value in case env is not set or it has wrong value |
Creates a new configuration and sets default values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_config_t), | intent(out) | :: | config |
Configuration to create |
Sets configuration parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dtfft_config_t), | intent(in) | :: | config |
Configuration to set |
||
| integer(kind=int32), | intent(out), | optional | :: | error_code |
Error code |
Destroy the default stream if it was created