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 |
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 |
Should Z-slab be used if possible |
||
integer(kind=int32), | private, | save | :: | n_measure_warmup_iters_from_env |
Number of warmup iterations for measurements |
||
integer(kind=int32), | private, | save | :: | n_measure_iters_from_env |
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 decomposition 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 obtained from environ |
||
integer(kind=int32), | private, | save | :: | mpi_enabled_from_env |
Should we use MPI backends during autotune or not |
||
integer(kind=int32), | private, | save | :: | nccl_enabled_from_env |
Should we use NCCL backends during autotune or not |
||
integer(kind=int32), | private, | save | :: | nvshmem_enabled_from_env |
Should we use NVSHMEM backends during autotune or not |
||
integer(kind=int32), | private, | save | :: | pipelined_enabled_from_env |
Should we use pipelined backends during autotune or not |
||
integer(kind=int32), | private, | save | :: | kernel_optimization_enabled_from_env |
Should we enable kernel block optimization during autotune or not |
||
integer(kind=int32), | private, | save | :: | n_configs_to_test_from_env |
Number of blocks to test during nvrtc kernel autotune |
||
integer(kind=int32), | private, | save | :: | forced_kernel_optimization_from_env | |||
type(dtfft_backend_t), | private, | parameter | :: | DEFAULT_GPU_BACKEND | = | DTFFT_BACKEND_NCCL |
Default GPU backend |
type(dtfft_stream_t), | private, | save | :: | main_stream |
Default dtFFT CUDA stream |
||
type(dtfft_stream_t), | private, | save | :: | custom_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_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_GPU_BACKEND |
Default GPU 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. |
|
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_mpi_backends |
Should MPI GPU Backends be enabled when |
|
logical, | intent(in), | optional | :: | enable_pipelined_backends |
Should pipelined GPU 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 |
Environment variable value
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 |
Environment variable value
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. |
|||
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_mpi_backends |
Should MPI GPU Backends be enabled when |
|||
logical(kind=c_bool), | public | :: | enable_pipelined_backends |
Should pipelined GPU 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, n_measure_warmup_iters, n_measure_iters, platform, stream, 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
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
Returns GPU backend set by the user or default one
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. |
|
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_mpi_backends |
Should MPI GPU Backends be enabled when |
|
logical, | intent(in), | optional | :: | enable_pipelined_backends |
Should pipelined GPU 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
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 |
Environment variable value
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 |
Environment variable value
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