dtfft 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dtfft-3.2.0/CMakeLists.txt +553 -0
- dtfft-3.2.0/LICENSE +674 -0
- dtfft-3.2.0/PKG-INFO +135 -0
- dtfft-3.2.0/README.md +125 -0
- dtfft-3.2.0/cmake/CheckFFTWFeatures.cmake +12 -0
- dtfft-3.2.0/cmake/CheckFortranFeatures.cmake +37 -0
- dtfft-3.2.0/cmake/CheckMPIFeatures.cmake +127 -0
- dtfft-3.2.0/cmake/CheckNCCLFeatures.cmake +59 -0
- dtfft-3.2.0/cmake/FindFFTW.cmake +419 -0
- dtfft-3.2.0/cmake/FindNCCL.cmake +55 -0
- dtfft-3.2.0/cmake/dtfftConfig.cmake.in +27 -0
- dtfft-3.2.0/include/dtfft.f03 +9 -0
- dtfft-3.2.0/include/dtfft.h +1412 -0
- dtfft-3.2.0/include/dtfft.hpp +2238 -0
- dtfft-3.2.0/include/dtfft_config.h.in +195 -0
- dtfft-3.2.0/pyproject.toml +10 -0
- dtfft-3.2.0/ruff.toml +46 -0
- dtfft-3.2.0/setup.cfg +4 -0
- dtfft-3.2.0/setup.py +209 -0
- dtfft-3.2.0/src/CMakeLists.txt +55 -0
- dtfft-3.2.0/src/dtfft.F90 +226 -0
- dtfft-3.2.0/src/dtfft_abstract_backend.F90 +483 -0
- dtfft-3.2.0/src/dtfft_abstract_compressor.F90 +330 -0
- dtfft-3.2.0/src/dtfft_abstract_executor.F90 +245 -0
- dtfft-3.2.0/src/dtfft_abstract_kernel.F90 +456 -0
- dtfft-3.2.0/src/dtfft_abstract_reshape_handle.F90 +221 -0
- dtfft-3.2.0/src/dtfft_backend_cufftmp.F90 +180 -0
- dtfft-3.2.0/src/dtfft_backend_mpi.F90 +672 -0
- dtfft-3.2.0/src/dtfft_backend_nccl.F90 +141 -0
- dtfft-3.2.0/src/dtfft_compressor_zfp.F90 +319 -0
- dtfft-3.2.0/src/dtfft_config.F90 +992 -0
- dtfft-3.2.0/src/dtfft_errors.F90 +312 -0
- dtfft-3.2.0/src/dtfft_helpers.c +53 -0
- dtfft-3.2.0/src/dtfft_kernel_device.F90 +412 -0
- dtfft-3.2.0/src/dtfft_kernel_host.F90 +469 -0
- dtfft-3.2.0/src/dtfft_nvrtc_block_optimizer.F90 +784 -0
- dtfft-3.2.0/src/dtfft_nvrtc_module.F90 +584 -0
- dtfft-3.2.0/src/dtfft_nvrtc_module_cache.F90 +184 -0
- dtfft-3.2.0/src/dtfft_parameters.F90 +775 -0
- dtfft-3.2.0/src/dtfft_pencil.F90 +1082 -0
- dtfft-3.2.0/src/dtfft_plan.F90 +2758 -0
- dtfft-3.2.0/src/dtfft_reshape_handle_datatype.F90 +862 -0
- dtfft-3.2.0/src/dtfft_reshape_handle_generic.F90 +863 -0
- dtfft-3.2.0/src/dtfft_reshape_plan.F90 +595 -0
- dtfft-3.2.0/src/dtfft_reshape_plan_base.F90 +803 -0
- dtfft-3.2.0/src/dtfft_transpose_plan.F90 +1184 -0
- dtfft-3.2.0/src/dtfft_utils.F90 +730 -0
- dtfft-3.2.0/src/include/_dtfft_cuda.h +42 -0
- dtfft-3.2.0/src/include/_dtfft_kernel_host_block_routines.inc +1077 -0
- dtfft-3.2.0/src/include/_dtfft_kernel_host_routines.inc +1262 -0
- dtfft-3.2.0/src/include/_dtfft_mem_alloc_free.inc +157 -0
- dtfft-3.2.0/src/include/_dtfft_mpi.h +19 -0
- dtfft-3.2.0/src/include/_dtfft_private.h +140 -0
- dtfft-3.2.0/src/include/_dtfft_profile.h +20 -0
- dtfft-3.2.0/src/interfaces/CMakeLists.txt +9 -0
- dtfft-3.2.0/src/interfaces/api/CMakeLists.txt +25 -0
- dtfft-3.2.0/src/interfaces/api/dtfft_api.F90 +797 -0
- dtfft-3.2.0/src/interfaces/api/dtfft_api.h +179 -0
- dtfft-3.2.0/src/interfaces/api/dtfft_api_c.c +461 -0
- dtfft-3.2.0/src/interfaces/api/dtfft_api_cxx.cpp +765 -0
- dtfft-3.2.0/src/interfaces/api/dtfft_api_py.cpp +639 -0
- dtfft-3.2.0/src/interfaces/external/CMakeLists.txt +38 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_cuda.F90 +401 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_cuda_runtime.F90 +931 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_cufft.F90 +410 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_nccl.F90 +430 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_nvrtc.F90 +356 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_nvshmem.F90 +223 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_nvtx.F90 +93 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_nvtx3.c +25 -0
- dtfft-3.2.0/src/interfaces/external/dtfft_interface_zfp.F90 +364 -0
- dtfft-3.2.0/src/interfaces/fft/CMakeLists.txt +15 -0
- dtfft-3.2.0/src/interfaces/fft/cufft/CMakeLists.txt +7 -0
- dtfft-3.2.0/src/interfaces/fft/cufft/dtfft_executor_cufft_m.F90 +151 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/CMakeLists.txt +27 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/args_create.i90 +13 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/args_execute.i90 +4 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/dtfft_executor_fftw_m.F90 +269 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/dtfft_interface_fftw_m.F90 +136 -0
- dtfft-3.2.0/src/interfaces/fft/fftw/dtfft_interface_fftw_native_m.F90 +15 -0
- dtfft-3.2.0/src/interfaces/fft/mkl/CMakeLists.txt +25 -0
- dtfft-3.2.0/src/interfaces/fft/mkl/dtfft_executor_mkl_m.F90 +202 -0
- dtfft-3.2.0/src/interfaces/fft/mkl/dtfft_interface_mkl.c +57 -0
- dtfft-3.2.0/src/interfaces/fft/mkl/dtfft_interface_mkl_m.F90 +155 -0
- dtfft-3.2.0/src/interfaces/fft/mkl/dtfft_interface_mkl_native_m.F90 +40 -0
- dtfft-3.2.0/src/interfaces/fft/vkfft/CMakeLists.txt +31 -0
- dtfft-3.2.0/src/interfaces/fft/vkfft/dtfft_executor_vkfft_m.F90 +175 -0
- dtfft-3.2.0/src/interfaces/fft/vkfft/dtfft_interface_vkfft_m.F90 +123 -0
- dtfft-3.2.0/src/interfaces/fft/vkfft/dtfft_interface_vkfft_native.c +91 -0
- dtfft-3.2.0/src/interfaces/python/README.md +78 -0
- dtfft-3.2.0/src/interfaces/python/README_sdist.md +87 -0
- dtfft-3.2.0/src/interfaces/python/__init__.py +848 -0
- dtfft-3.2.0/src/interfaces/python/__init__.pyi +310 -0
- dtfft-3.2.0/src/interfaces/python/_dtfft.pyi +717 -0
- dtfft-3.2.0/src/interfaces/python/_dtfft_test_utils.pyi +238 -0
- dtfft-3.2.0/src/interfaces/python/dtfft.egg-info/PKG-INFO +135 -0
- dtfft-3.2.0/src/interfaces/python/dtfft.egg-info/SOURCES.txt +148 -0
- dtfft-3.2.0/src/interfaces/python/dtfft.egg-info/dependency_links.txt +1 -0
- dtfft-3.2.0/src/interfaces/python/dtfft.egg-info/requires.txt +2 -0
- dtfft-3.2.0/src/interfaces/python/dtfft.egg-info/top_level.txt +1 -0
- dtfft-3.2.0/src/tests/CMakeLists.txt +28 -0
- dtfft-3.2.0/src/tests/test_compression.F90 +186 -0
- dtfft-3.2.0/src/tests/test_device_kernels.F90 +108 -0
- dtfft-3.2.0/src/tests/test_host_kernels.F90 +389 -0
- dtfft-3.2.0/tests/CMakeLists.txt +91 -0
- dtfft-3.2.0/tests/c/test_c2c_2d_cxx.cpp +228 -0
- dtfft-3.2.0/tests/c/test_c2c_2d_float_c.c +179 -0
- dtfft-3.2.0/tests/c/test_c2c_3d_c.c +295 -0
- dtfft-3.2.0/tests/c/test_c2c_3d_float_cxx.cpp +162 -0
- dtfft-3.2.0/tests/c/test_r2c_2d_cxx.cpp +161 -0
- dtfft-3.2.0/tests/c/test_r2c_2d_float_c.c +170 -0
- dtfft-3.2.0/tests/c/test_r2c_3d_c.c +222 -0
- dtfft-3.2.0/tests/c/test_r2c_3d_float_cxx.cpp +224 -0
- dtfft-3.2.0/tests/c/test_r2r_2d_cxx.cpp +127 -0
- dtfft-3.2.0/tests/c/test_r2r_2d_float_c.c +163 -0
- dtfft-3.2.0/tests/c/test_r2r_3d_c.c +164 -0
- dtfft-3.2.0/tests/c/test_r2r_3d_float_cxx.cpp +217 -0
- dtfft-3.2.0/tests/c/test_utils.h +93 -0
- dtfft-3.2.0/tests/cuda_utils.cu +56 -0
- dtfft-3.2.0/tests/fortran/test_c2c_2d_f.F90 +168 -0
- dtfft-3.2.0/tests/fortran/test_c2c_2d_float_f.F90 +152 -0
- dtfft-3.2.0/tests/fortran/test_c2c_3d_f.F90 +198 -0
- dtfft-3.2.0/tests/fortran/test_c2c_3d_float_f.F90 +196 -0
- dtfft-3.2.0/tests/fortran/test_pencils_f.F90 +227 -0
- dtfft-3.2.0/tests/fortran/test_r2c_2d_f.F90 +205 -0
- dtfft-3.2.0/tests/fortran/test_r2c_2d_float_f.F90 +176 -0
- dtfft-3.2.0/tests/fortran/test_r2c_3d_f.F90 +179 -0
- dtfft-3.2.0/tests/fortran/test_r2c_3d_float_f.F90 +211 -0
- dtfft-3.2.0/tests/fortran/test_r2r_2d_f.F90 +150 -0
- dtfft-3.2.0/tests/fortran/test_r2r_2d_float_f.F90 +146 -0
- dtfft-3.2.0/tests/fortran/test_r2r_3d_f.F90 +196 -0
- dtfft-3.2.0/tests/fortran/test_r2r_3d_float_f.F90 +293 -0
- dtfft-3.2.0/tests/include/check_and_report.inc +56 -0
- dtfft-3.2.0/tests/include/h2d.inc +46 -0
- dtfft-3.2.0/tests/include/scale.inc +37 -0
- dtfft-3.2.0/tests/install/CMakeLists.txt +22 -0
- dtfft-3.2.0/tests/install/main.F90 +16 -0
- dtfft-3.2.0/tests/install/main.c +5 -0
- dtfft-3.2.0/tests/install/main.cxx +6 -0
- dtfft-3.2.0/tests/python/CMakeLists.txt +40 -0
- dtfft-3.2.0/tests/python/test_c2c_3d_py.py +112 -0
- dtfft-3.2.0/tests/python/test_compression_config_py.py +150 -0
- dtfft-3.2.0/tests/python/test_pencil_api_py.py +98 -0
- dtfft-3.2.0/tests/python/test_plan_properties_py.py +169 -0
- dtfft-3.2.0/tests/python/test_r2c_2d_py.py +77 -0
- dtfft-3.2.0/tests/python/test_r2r_3d_float_py.py +99 -0
- dtfft-3.2.0/tests/python/test_r2r_kinds_py.py +141 -0
- dtfft-3.2.0/tests/python/test_request_async_py.py +129 -0
- dtfft-3.2.0/tests/python/test_utils_py.cpp +157 -0
- dtfft-3.2.0/tests/test_utils.F90 +445 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.25)
|
|
2
|
+
project(dtfft VERSION 3.2.0
|
|
3
|
+
DESCRIPTION "Library to perform FFT on a distributed memory cluster."
|
|
4
|
+
HOMEPAGE_URL "https://github.com/ShatrovOA/dtFFT"
|
|
5
|
+
LANGUAGES Fortran C CXX)
|
|
6
|
+
|
|
7
|
+
# make sure that the default is a RELEASE
|
|
8
|
+
if (NOT CMAKE_BUILD_TYPE)
|
|
9
|
+
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
|
|
10
|
+
"Choose the type of build, options are: None Debug Release."
|
|
11
|
+
FORCE)
|
|
12
|
+
endif (NOT CMAKE_BUILD_TYPE)
|
|
13
|
+
|
|
14
|
+
set(CMAKE_C_STANDARD 11)
|
|
15
|
+
set(CMAKE_CXX_STANDARD 14)
|
|
16
|
+
set(C_STANDARD_REQUIRED ON)
|
|
17
|
+
set(CXX_STANDARD_REQUIRED ON)
|
|
18
|
+
|
|
19
|
+
# FFT Libraries
|
|
20
|
+
option(DTFFT_WITH_FFTW "Build dtFFT with FFTW support" OFF)
|
|
21
|
+
option(DTFFT_WITH_MKL "Build dtFFT with MKL DFTI support" OFF)
|
|
22
|
+
option(DTFFT_WITH_CUFFT "Build dtFFT with cuFFT support" OFF)
|
|
23
|
+
option(DTFFT_WITH_VKFFT "Build dtFFT with VkFFT support" OFF)
|
|
24
|
+
|
|
25
|
+
option(DTFFT_BUILD_TESTS "Create dtFFT tests" OFF)
|
|
26
|
+
option(DTFFT_BUILD_SHARED "Build shared library" ON)
|
|
27
|
+
option(DTFFT_BUILD_C_CXX_API "Create C API" ON)
|
|
28
|
+
option(DTFFT_BUILD_PYTHON_API "Create Python API" OFF)
|
|
29
|
+
|
|
30
|
+
option(DTFFT_ENABLE_COVERAGE "Create coverage with gcov utility" OFF)
|
|
31
|
+
option(DTFFT_USE_MPI "Use Fortran `mpi` module instead of `mpi_f08`" OFF)
|
|
32
|
+
option(DTFFT_ENABLE_PERSISTENT_COMM "Enable MPI persistent calls" OFF)
|
|
33
|
+
option(DTFFT_WITH_PROFILER "Build dtFFT with profiler support" OFF)
|
|
34
|
+
option(DTFFT_WITH_RMA "Enable support of MPI RMA backends" OFF)
|
|
35
|
+
option(DTFFT_ENABLE_INPUT_CHECK "Enable checks for user input for all dtFFT functions" ON)
|
|
36
|
+
|
|
37
|
+
# Device libraries
|
|
38
|
+
option(DTFFT_WITH_CUDA "Build dtFFT with CUDA support" OFF)
|
|
39
|
+
option(DTFFT_WITH_MOCK_ENABLED "Mock GPU libraries calls with CPU implementations for testing and debugging without GPU hardware" OFF)
|
|
40
|
+
option(DTFFT_WITH_NCCL "Build dtFFT with NCCL support.
|
|
41
|
+
Enabling this option when nvfortran compiler detected and DTFFT_WITH_CUDA=ON
|
|
42
|
+
requires to set NCCL_ROOT enviroment variable to find custom installation of NCCL" OFF)
|
|
43
|
+
option(DTFFT_WITHOUT_NCCL "Build dtFFT without NCCL support.
|
|
44
|
+
Disables automatic NCCL usage when nvfortran compiler detected AND DTFFT_WITH_CUDA=ON" OFF)
|
|
45
|
+
option(DTFFT_WITHOUT_NVSHMEM "Build dtFFT without NVSHMEM-enabled backends.
|
|
46
|
+
Disables automatic NVSHMEM usage when nvfortran compiler detected AND DTFFT_WITH_CUDA=ON" OFF)
|
|
47
|
+
option(DTFFT_ENABLE_DEVICE_CHECKS "Enable error checking for all GPU libraries calls" ON)
|
|
48
|
+
|
|
49
|
+
# Compression libraries
|
|
50
|
+
option(DTFFT_WITH_ZFP "Enable ZFP support for data compression" OFF)
|
|
51
|
+
|
|
52
|
+
# OpenMP options
|
|
53
|
+
option(DTFFT_WITH_OPENMP "Enable OpenMP parallelization for generic approach" OFF)
|
|
54
|
+
option(DTFFT_WITH_FFTW_THREADS "Enable threads support of FFTW library instead of OpenMP" OFF)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
|
|
58
|
+
|
|
59
|
+
find_package(MPI REQUIRED)
|
|
60
|
+
if(MPI_Fortran_HAVE_F08_MODULE)
|
|
61
|
+
if(DTFFT_USE_MPI)
|
|
62
|
+
add_compile_definitions(DTFFT_USE_MPI)
|
|
63
|
+
endif()
|
|
64
|
+
else()
|
|
65
|
+
if(NOT DTFFT_USE_MPI)
|
|
66
|
+
message(FATAL_ERROR "Requested `mpi_f08` module is missing. Try configure with -DDTFFT_USE_MPI=ON")
|
|
67
|
+
endif()
|
|
68
|
+
if(NOT MPI_Fortran_HAVE_F90_MODULE)
|
|
69
|
+
message(FATAL_ERROR "Neither `mpi_f08` nor `mpi` modules were found.." )
|
|
70
|
+
endif()
|
|
71
|
+
add_compile_definitions(DTFFT_USE_MPI)
|
|
72
|
+
endif()
|
|
73
|
+
|
|
74
|
+
if ( DTFFT_USE_MPI )
|
|
75
|
+
set(mpi_mod "mpi")
|
|
76
|
+
else()
|
|
77
|
+
set(mpi_mod "mpi_f08")
|
|
78
|
+
endif()
|
|
79
|
+
|
|
80
|
+
if( CMAKE_BUILD_TYPE MATCHES Release)
|
|
81
|
+
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
|
82
|
+
|
|
83
|
+
include(CheckIPOSupported)
|
|
84
|
+
check_ipo_supported(RESULT result)
|
|
85
|
+
if(result)
|
|
86
|
+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
87
|
+
endif()
|
|
88
|
+
endif()
|
|
89
|
+
|
|
90
|
+
if(DTFFT_BUILD_SHARED)
|
|
91
|
+
add_library(dtfft SHARED)
|
|
92
|
+
else()
|
|
93
|
+
add_library(dtfft STATIC)
|
|
94
|
+
endif()
|
|
95
|
+
set_target_properties(dtfft PROPERTIES LINKER_LANGUAGE Fortran)
|
|
96
|
+
|
|
97
|
+
include(CheckMPIFeatures)
|
|
98
|
+
|
|
99
|
+
# if ( DTFFT_USE_MPI )
|
|
100
|
+
# set(HAVE_MPI_INT64 OFF)
|
|
101
|
+
# else()
|
|
102
|
+
# check_int64_supported(${MPI_Fortran_MODULE_DIR} ${MPI_Fortran_LIBRARIES})
|
|
103
|
+
# endif()
|
|
104
|
+
# if ( HAVE_MPI_INT64 )
|
|
105
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:CNT_KIND=MPI_COUNT_KIND;ADDR_KIND=MPI_ADDRESS_KIND>)
|
|
106
|
+
# else()
|
|
107
|
+
# message(WARNING "MPI 64bit integer indexing is disabled. Overflows might occur if MPI Backends will be used")
|
|
108
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:CNT_KIND=int32;ADDR_KIND=int32>)
|
|
109
|
+
# endif()
|
|
110
|
+
|
|
111
|
+
if ( DTFFT_ENABLE_INPUT_CHECK )
|
|
112
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:ENABLE_INPUT_CHECK>)
|
|
113
|
+
endif()
|
|
114
|
+
|
|
115
|
+
include(CheckFortranFeatures)
|
|
116
|
+
|
|
117
|
+
check_assumed_rank_and_type()
|
|
118
|
+
check_block_statement()
|
|
119
|
+
|
|
120
|
+
if (NOT HAVE_ASSUMED_RANK_AND_TYPE OR NOT HAVE_BLOCK_STATEMENT)
|
|
121
|
+
message(FATAL_ERROR "Both assumed-rank arrays and Block statement are required")
|
|
122
|
+
endif()
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
check_ompi_fix_required("${MPI_C_INCLUDE_DIRS}")
|
|
126
|
+
check_mpich_fix_required("${MPI_C_INCLUDE_DIRS}")
|
|
127
|
+
|
|
128
|
+
if ( OMPI_FIX_REQUIRED )
|
|
129
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:OMPI_FIX_REQUIRED>)
|
|
130
|
+
message(STATUS "OpenMPI < 5 detected. Applying workaround for Collective non-blocking calls")
|
|
131
|
+
endif()
|
|
132
|
+
if ( MPICH_FIX_REQUIRED AND NOT DTFFT_USE_MPI )
|
|
133
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:MPICH_FIX_REQUIRED>)
|
|
134
|
+
message(STATUS "MPICH < 4.1 detected. Applying workaround for MPI_Waitsome 0 indexes returned")
|
|
135
|
+
endif()
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
if ( DTFFT_ENABLE_PERSISTENT_COMM )
|
|
139
|
+
check_persistent_collectives("${MPI_Fortran_MODULE_DIR}" "${MPI_Fortran_LIBRARIES}" ${mpi_mod})
|
|
140
|
+
|
|
141
|
+
# Preprocessor used for gpu p2p algorithms, e.g. MPI_Send_init
|
|
142
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:ENABLE_PERSISTENT_COMM>)
|
|
143
|
+
if ( HAVE_PERSISTENT_COLLECTIVES )
|
|
144
|
+
message(STATUS "Persistent communications ENABLED")
|
|
145
|
+
# This preprocessor is used for collective persistent functions, e.g. MPI_Alltoall_init
|
|
146
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:ENABLE_PERSISTENT_COLLECTIVES>)
|
|
147
|
+
else()
|
|
148
|
+
message(WARNING "MPI implementation do not support collective persistent functions")
|
|
149
|
+
endif()
|
|
150
|
+
endif()
|
|
151
|
+
|
|
152
|
+
if ( DTFFT_WITH_RMA )
|
|
153
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:DTFFT_WITH_RMA>)
|
|
154
|
+
endif()
|
|
155
|
+
|
|
156
|
+
if( NOT DTFFT_WITH_FFTW
|
|
157
|
+
AND NOT DTFFT_WITH_MKL
|
|
158
|
+
AND NOT DTFFT_WITH_CUFFT
|
|
159
|
+
AND NOT DTFFT_WITH_VKFFT
|
|
160
|
+
)
|
|
161
|
+
set ( DTFFT_TRANSPOSE_ONLY ON )
|
|
162
|
+
endif()
|
|
163
|
+
if ( DTFFT_WITH_VKFFT OR DTFFT_WITH_CUFFT )
|
|
164
|
+
set( DTFFT_WITH_CUDA ON )
|
|
165
|
+
endif()
|
|
166
|
+
|
|
167
|
+
if ( DTFFT_WITH_OPENMP )
|
|
168
|
+
find_package(OpenMP REQUIRED COMPONENTS Fortran)
|
|
169
|
+
target_compile_definitions(dtfft PRIVATE DTFFT_WITH_OPENMP)
|
|
170
|
+
target_link_libraries(dtfft PRIVATE OpenMP::OpenMP_Fortran)
|
|
171
|
+
endif()
|
|
172
|
+
|
|
173
|
+
if (DTFFT_WITH_MOCK_ENABLED)
|
|
174
|
+
set(NCCL_FOUND TRUE)
|
|
175
|
+
set(USE_NCCL ON)
|
|
176
|
+
endif()
|
|
177
|
+
|
|
178
|
+
if(DTFFT_WITH_CUDA AND NOT DTFFT_WITH_MOCK_ENABLED)
|
|
179
|
+
find_package(CUDAToolkit 11.0 REQUIRED)
|
|
180
|
+
# Not linking CUDA::nvrtc due to implicit link of cuda_driver by cmake
|
|
181
|
+
# target_link_libraries(dtfft PRIVATE CUDA::nvrtc)
|
|
182
|
+
target_link_libraries(dtfft PUBLIC CUDA::cudart)
|
|
183
|
+
target_link_libraries(dtfft PRIVATE ${CMAKE_DL_LIBS})
|
|
184
|
+
|
|
185
|
+
if ( NOT DTFFT_ENABLE_DEVICE_CHECKS )
|
|
186
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:DEVICE_NO_ERROR_CHECK>)
|
|
187
|
+
endif()
|
|
188
|
+
|
|
189
|
+
if( CMAKE_Fortran_COMPILER_ID MATCHES NVHPC )
|
|
190
|
+
# Get the directory two levels up
|
|
191
|
+
get_filename_component(PARENT_DIR "${CMAKE_Fortran_COMPILER}" DIRECTORY) # /compilers/bin/
|
|
192
|
+
get_filename_component(PARENT_DIR "${PARENT_DIR}" DIRECTORY) # /compilers
|
|
193
|
+
get_filename_component(PARENT_DIR "${PARENT_DIR}" DIRECTORY) # /
|
|
194
|
+
set(NVHPC_CMAKE_PATH "${PARENT_DIR}/cmake")
|
|
195
|
+
list(APPEND CMAKE_PREFIX_PATH "${NVHPC_CMAKE_PATH}")
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
set(WITH_HPC_SDK ON)
|
|
199
|
+
set(NVHPC_CUDA_VERSION "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}")
|
|
200
|
+
endif()
|
|
201
|
+
|
|
202
|
+
set(NCCL_FOUND FALSE)
|
|
203
|
+
if (WITH_HPC_SDK)
|
|
204
|
+
if (DTFFT_WITHOUT_NCCL)
|
|
205
|
+
message(STATUS "NCCL support disabled via DTFFT_WITHOUT_NCCL")
|
|
206
|
+
else()
|
|
207
|
+
if (DTFFT_WITH_NCCL)
|
|
208
|
+
message(STATUS "DTFFT_WITH_NCCL overrides NVHPC default NCCL search")
|
|
209
|
+
find_package(NCCL REQUIRED) # Use FindNCCL.cmake
|
|
210
|
+
endif()
|
|
211
|
+
|
|
212
|
+
# If DTFFT_WITH_NCCL is OFF or manual search failed, try NVHPC
|
|
213
|
+
if (NOT NCCL_FOUND)
|
|
214
|
+
|
|
215
|
+
find_package(NVHPC REQUIRED COMPONENTS NCCL)
|
|
216
|
+
if (NVHPC_FOUND AND TARGET NVHPC::NCCL)
|
|
217
|
+
message(STATUS "Using NCCL from NVHPC SDK")
|
|
218
|
+
set(NCCL_FOUND TRUE)
|
|
219
|
+
get_target_property(NCCL_INCLUDE_DIRS NVHPC::NCCL INTERFACE_INCLUDE_DIRECTORIES)
|
|
220
|
+
get_target_property(NCCL_LIBRARIES NVHPC::NCCL INTERFACE_LINK_LIBRARIES)
|
|
221
|
+
else()
|
|
222
|
+
message(WARNING "NVHPC compiler detected, but NCCL not found. Consider DTFFT_WITH_NCCL=ON with NCCL_ROOT or DTFFT_WITHOUT_NCCL=ON")
|
|
223
|
+
endif()
|
|
224
|
+
endif()
|
|
225
|
+
endif()
|
|
226
|
+
else()
|
|
227
|
+
# Non-NVHPC compiler: DTFFT_WITHOUT_NCCL ignored
|
|
228
|
+
if (DTFFT_WITH_NCCL)
|
|
229
|
+
find_package(NCCL REQUIRED) # Use FindNCCL.cmake
|
|
230
|
+
endif()
|
|
231
|
+
endif()
|
|
232
|
+
|
|
233
|
+
# If NCCL found, check features
|
|
234
|
+
if (NCCL_FOUND)
|
|
235
|
+
# Find CUDA Toolkit for NCCL feature checks
|
|
236
|
+
include(CheckNCCLFeatures)
|
|
237
|
+
check_nccl_features("${NCCL_INCLUDE_DIRS}" "${NCCL_LIBRARIES}"
|
|
238
|
+
"${CUDAToolkit_INCLUDE_DIRS}" "${CUDAToolkit_LIBRARY_DIR}")
|
|
239
|
+
|
|
240
|
+
set(USE_NCCL ON)
|
|
241
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:DTFFT_WITH_NCCL>)
|
|
242
|
+
if ( NCCL_HAVE_MEMALLOC )
|
|
243
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:NCCL_HAVE_MEMALLOC>)
|
|
244
|
+
endif()
|
|
245
|
+
if ( NCCL_HAVE_COMMREGISTER )
|
|
246
|
+
target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:NCCL_HAVE_COMMREGISTER>)
|
|
247
|
+
endif()
|
|
248
|
+
# target_include_directories(dtfft PRIVATE ${NCCL_INCLUDE_DIRS})
|
|
249
|
+
target_link_libraries(dtfft PRIVATE ${NCCL_LIBRARIES})
|
|
250
|
+
endif()
|
|
251
|
+
|
|
252
|
+
# if ( DTFFT_USE_MPI )
|
|
253
|
+
# set(HAVE_MPI_INT64 OFF)
|
|
254
|
+
# else()
|
|
255
|
+
# check_int64_supported("${MPI_Fortran_MODULE_DIR}" "${MPI_Fortran_LIBRARIES}")
|
|
256
|
+
# endif()
|
|
257
|
+
# if ( HAVE_MPI_INT64 )
|
|
258
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:CNT_KIND=MPI_COUNT_KIND;ADDR_KIND=MPI_ADDRESS_KIND>)
|
|
259
|
+
# else()
|
|
260
|
+
# message(WARNING "MPI 64bit integer indexing is disabled. Overflows might occur if MPI Backends will be used")
|
|
261
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:CNT_KIND=int32;ADDR_KIND=int32>)
|
|
262
|
+
# endif()
|
|
263
|
+
|
|
264
|
+
set(USE_NVSHMEM OFF)
|
|
265
|
+
if( WITH_HPC_SDK AND NOT DTFFT_WITHOUT_NVSHMEM)
|
|
266
|
+
find_package(NVHPC REQUIRED COMPONENTS MATH)
|
|
267
|
+
# if ( TARGET NVHPC::NVSHMEM_COMPAT )
|
|
268
|
+
# get_target_property(NVSHMEM_LIBS NVHPC::NVSHMEM_COMPAT INTERFACE_LINK_LIBRARIES)
|
|
269
|
+
# else()
|
|
270
|
+
# get_target_property(NVSHMEM_LIBS NVHPC::NVSHMEM INTERFACE_LINK_LIBRARIES)
|
|
271
|
+
# endif()
|
|
272
|
+
# get_target_property(cufftmp_libs NVHPC::CUFFTMP INTERFACE_LINK_LIBRARIES)
|
|
273
|
+
# foreach(lib ${cufftmp_libs})
|
|
274
|
+
# message(STATUS "${lib}")
|
|
275
|
+
# endforeach()
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
# Get nvshmem_device.a and link it directly
|
|
279
|
+
# message(STATUS "NVSHMEM_LIBS = ${NVSHMEM_LIBS}")
|
|
280
|
+
# foreach(lib ${NVSHMEM_LIBS})
|
|
281
|
+
|
|
282
|
+
# if ( lib MATCHES "nvshmem_host" )
|
|
283
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:NVSHMEM_HOST_LIB="${lib}">)
|
|
284
|
+
# endif()
|
|
285
|
+
# if ( lib MATCHES "nvshmem_device" )
|
|
286
|
+
# message(STATUS "linking ${lib}")
|
|
287
|
+
# target_link_libraries(dtfft PRIVATE ${lib})
|
|
288
|
+
# endif()
|
|
289
|
+
# endforeach()
|
|
290
|
+
|
|
291
|
+
set(USE_NVSHMEM ON)
|
|
292
|
+
# target_compile_definitions(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran,C>:DTFFT_WITH_NVSHMEM>)
|
|
293
|
+
target_link_libraries(dtfft PUBLIC NVHPC::CUFFTMP)
|
|
294
|
+
if ( CMAKE_Fortran_COMPILER_VERSION LESS "24.7")
|
|
295
|
+
target_link_libraries(dtfft PRIVATE CUDA::nvml)
|
|
296
|
+
endif()
|
|
297
|
+
endif()
|
|
298
|
+
endif()
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
target_link_libraries(dtfft PUBLIC MPI::MPI_Fortran)
|
|
302
|
+
|
|
303
|
+
if ( DTFFT_WITH_PROFILER )
|
|
304
|
+
target_compile_definitions(dtfft PRIVATE DTFFT_WITH_PROFILER)
|
|
305
|
+
if ( DTFFT_WITH_CUDA AND NOT DTFFT_WITH_MOCK_ENABLED )
|
|
306
|
+
target_link_libraries(dtfft PRIVATE CUDA::nvtx3)
|
|
307
|
+
else()
|
|
308
|
+
find_package( caliper REQUIRED )
|
|
309
|
+
message(STATUS "Found caliper: ${caliper_DIR}")
|
|
310
|
+
target_link_libraries(dtfft PUBLIC caliper)
|
|
311
|
+
endif()
|
|
312
|
+
endif()
|
|
313
|
+
|
|
314
|
+
set(DTFFT_WITH_COMPRESSION OFF)
|
|
315
|
+
if ( DTFFT_WITH_ZFP )
|
|
316
|
+
target_compile_definitions(dtfft PRIVATE DTFFT_WITH_ZFP)
|
|
317
|
+
find_package( zfp REQUIRED )
|
|
318
|
+
message(STATUS "Found zfp: ${zfp_DIR}")
|
|
319
|
+
target_link_libraries(dtfft PRIVATE zfp::zfp)
|
|
320
|
+
set(DTFFT_WITH_COMPRESSION ON)
|
|
321
|
+
if ( ZFP_WITH_CUDA )
|
|
322
|
+
target_compile_definitions(dtfft PRIVATE ZFP_WITH_CUDA)
|
|
323
|
+
endif()
|
|
324
|
+
if ( ZFP_WITH_OPENMP AND DTFFT_WITH_OPENMP )
|
|
325
|
+
target_compile_definitions(dtfft PRIVATE ZFP_WITH_OPENMP)
|
|
326
|
+
endif()
|
|
327
|
+
endif()
|
|
328
|
+
|
|
329
|
+
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g")
|
|
330
|
+
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
|
|
331
|
+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -std=f2018 -pedantic-errors -fbacktrace -Wall")
|
|
332
|
+
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -Og -g -Waliasing -Wampersand -Wconversion -Wsurprising \
|
|
333
|
+
-Wintrinsics-std -Wtabs -Wintrinsic-shadow -Wline-truncation -Wtarget-lifetime -Winteger-division -Wreal-q-constant -Wunused \
|
|
334
|
+
-Wrealloc-lhs-all -Wdo-subscript -Wundefined-do-loop -Wextra -ggdb -fopt-info -fopt-info-optall-optimized -fbacktrace -fdump-fortran-optimized\
|
|
335
|
+
-ftree-vectorize -Wimplicit-interface -Wunused-parameter -fcheck=all -ffpe-trap=invalid,zero,overflow,underflow -ffpe-summary=none \
|
|
336
|
+
-Warray-bounds -Wimplicit-procedure -Wunderflow -Wuninitialized -fimplicit-none -fdump-core -finit-real=nan")
|
|
337
|
+
|
|
338
|
+
if(DTFFT_RUNNING_CICD)
|
|
339
|
+
set(DTFFT_ENABLE_COVERAGE ON)
|
|
340
|
+
endif()
|
|
341
|
+
if(DTFFT_ENABLE_COVERAGE)
|
|
342
|
+
if ( CMAKE_BUILD_TYPE MATCHES "Release" )
|
|
343
|
+
message(FATAL_ERROR "Coverage can only be performed with debug build")
|
|
344
|
+
endif()
|
|
345
|
+
set(DTFFT_BUILD_TESTS ON)
|
|
346
|
+
|
|
347
|
+
find_program(LCOV_PATH lcov)
|
|
348
|
+
if ( NOT LCOV_PATH )
|
|
349
|
+
message(FATAL_ERROR "Unable to find lcov utility")
|
|
350
|
+
endif()
|
|
351
|
+
message(STATUS "Found lcov: ${LCOV_PATH}")
|
|
352
|
+
|
|
353
|
+
string(REPLACE "." ";" GCOV_VERSION ${CMAKE_C_COMPILER_VERSION})
|
|
354
|
+
list(LENGTH GCOV_VERSION len)
|
|
355
|
+
list(GET GCOV_VERSION 0 GCOV_VERSION_MAJOR)
|
|
356
|
+
find_program( GCOV_PATH gcov-${GCOV_VERSION_MAJOR} )
|
|
357
|
+
if ( NOT GCOV_PATH )
|
|
358
|
+
message(FATAL_ERROR "Unable to find gcov utility")
|
|
359
|
+
endif()
|
|
360
|
+
message(STATUS "Found gcov: ${GCOV_PATH}")
|
|
361
|
+
|
|
362
|
+
if (NOT DTFFT_RUNNING_CICD)
|
|
363
|
+
find_program(GENHTML_PATH genhtml)
|
|
364
|
+
if ( GENHTML_PATH )
|
|
365
|
+
set(GENHTML_COMMAND ${GENHTML_PATH} coverage.info --output-directory coverage_html)
|
|
366
|
+
endif()
|
|
367
|
+
endif()
|
|
368
|
+
|
|
369
|
+
if ( DTFFT_WITH_CUDA AND NOT SKIP_CUDA_COVERAGE )
|
|
370
|
+
add_custom_target(coverage
|
|
371
|
+
COMMAND DTFFT_PLATFORM=cuda ${CMAKE_MAKE_PROGRAM} test
|
|
372
|
+
COMMAND DTFFT_PLATFORM=host ${CMAKE_MAKE_PROGRAM} test
|
|
373
|
+
COMMAND ${LCOV_PATH} --capture --directory "CMakeFiles" --output-file coverage.info --gcov-tool ${GCOV_PATH}
|
|
374
|
+
COMMAND ${LCOV_PATH} --ignore-errors unused --remove coverage.info '/usr/*' '/opt/*' 'src/interfaces/external/*' --output-file coverage.info
|
|
375
|
+
COMMAND ${GENHTML_COMMAND}
|
|
376
|
+
# '${PROJECT_SOURCE_DIR}/include/*'
|
|
377
|
+
)
|
|
378
|
+
else()
|
|
379
|
+
add_custom_target(coverage
|
|
380
|
+
COMMAND ${CMAKE_MAKE_PROGRAM} test
|
|
381
|
+
COMMAND ${LCOV_PATH} --capture --directory "CMakeFiles" --output-file coverage.info --gcov-tool ${GCOV_PATH}
|
|
382
|
+
COMMAND ${LCOV_PATH} --ignore-errors unused --remove coverage.info '/usr/*' '/opt/*' 'src/interfaces/external/*' --output-file coverage.info
|
|
383
|
+
COMMAND ${GENHTML_COMMAND}
|
|
384
|
+
# '${PROJECT_SOURCE_DIR}/include/*'
|
|
385
|
+
)
|
|
386
|
+
endif()
|
|
387
|
+
|
|
388
|
+
target_link_libraries(dtfft PRIVATE gcov)
|
|
389
|
+
set_target_properties(dtfft
|
|
390
|
+
PROPERTIES
|
|
391
|
+
COMPILE_FLAGS "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
|
|
392
|
+
LINK_FLAGS "--coverage"
|
|
393
|
+
)
|
|
394
|
+
endif()
|
|
395
|
+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel OR CMAKE_Fortran_COMPILER_ID MATCHES IntelLLVM)
|
|
396
|
+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -free")
|
|
397
|
+
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check bounds -ftrapuv -debug all -gen-interfaces -traceback -warn all")
|
|
398
|
+
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -Ofast")
|
|
399
|
+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES NVHPC)
|
|
400
|
+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mbackslash -traceback -Mcontiguous -Mnodepchk")
|
|
401
|
+
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -Mchkstk")
|
|
402
|
+
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -Ofast -Mnobounds")
|
|
403
|
+
endif()
|
|
404
|
+
|
|
405
|
+
if( CMAKE_C_COMPILER_ID MATCHES GNU )
|
|
406
|
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic -Wall -Wextra")
|
|
407
|
+
elseif(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_C_COMPILER_ID MATCHES IntelLLVM)
|
|
408
|
+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast")
|
|
409
|
+
elseif(CMAKE_C_COMPILER_ID MATCHES NVHPC)
|
|
410
|
+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast")
|
|
411
|
+
endif()
|
|
412
|
+
|
|
413
|
+
if( CMAKE_CXX_COMPILER_ID MATCHES GNU )
|
|
414
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wall -Wextra")
|
|
415
|
+
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES IntelLLVM)
|
|
416
|
+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast")
|
|
417
|
+
elseif(CMAKE_CXX_COMPILER_ID MATCHES NVHPC)
|
|
418
|
+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast")
|
|
419
|
+
endif()
|
|
420
|
+
|
|
421
|
+
math(EXPR DTFFT_VERSION_CODE
|
|
422
|
+
"${PROJECT_VERSION_MAJOR} * 100000 + ${PROJECT_VERSION_MINOR} * 1000 + ${PROJECT_VERSION_PATCH}"
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
if ( NCCL_FOUND )
|
|
426
|
+
SET(DTFFT_WITH_NCCL ON)
|
|
427
|
+
else()
|
|
428
|
+
SET(DTFFT_WITH_NCCL OFF)
|
|
429
|
+
endif()
|
|
430
|
+
if ( USE_NVSHMEM )
|
|
431
|
+
SET(DTFFT_WITH_NVSHMEM ON)
|
|
432
|
+
else()
|
|
433
|
+
SET(DTFFT_WITH_NVSHMEM OFF)
|
|
434
|
+
endif()
|
|
435
|
+
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
|
436
|
+
SET(DTFFT_DEBUG ON)
|
|
437
|
+
else()
|
|
438
|
+
SET(DTFFT_DEBUG OFF)
|
|
439
|
+
endif()
|
|
440
|
+
set ( DTFFT_VERSION "(X) * 100000 + (Y) * 1000 + (Z)" )
|
|
441
|
+
set ( DTFFT_CONF_HEADER ${PROJECT_BINARY_DIR}/dtfft_config.h CACHE STRING "DTFFT Config header")
|
|
442
|
+
configure_file( ${PROJECT_SOURCE_DIR}/include/dtfft_config.h.in "${DTFFT_CONF_HEADER}" )
|
|
443
|
+
|
|
444
|
+
set(DTFFT_MODULE_DIR ${PROJECT_BINARY_DIR}/modules)
|
|
445
|
+
set_target_properties(dtfft PROPERTIES Fortran_MODULE_DIRECTORY ${DTFFT_MODULE_DIR})
|
|
446
|
+
set_target_properties(dtfft PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
|
|
447
|
+
set(DTFFT_HEADER_DIR "${PROJECT_SOURCE_DIR}/include")
|
|
448
|
+
SET(DTFFT_HEADERS "${DTFFT_HEADER_DIR}/dtfft.f03")
|
|
449
|
+
|
|
450
|
+
if(DTFFT_BUILD_C_CXX_API)
|
|
451
|
+
set(DTFFT_HEADERS "${DTFFT_HEADERS};${DTFFT_HEADER_DIR}/dtfft.h;${DTFFT_HEADER_DIR}/dtfft.hpp;${DTFFT_CONF_HEADER}")
|
|
452
|
+
target_link_libraries(dtfft PUBLIC MPI::MPI_C MPI::MPI_CXX)
|
|
453
|
+
endif()
|
|
454
|
+
set_target_properties(dtfft PROPERTIES PUBLIC_HEADER "${DTFFT_HEADERS}")
|
|
455
|
+
target_include_directories(dtfft PUBLIC
|
|
456
|
+
$<$<COMPILE_LANGUAGE:Fortran>:$<BUILD_INTERFACE:${DTFFT_MODULE_DIR}>>
|
|
457
|
+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include>
|
|
458
|
+
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
|
459
|
+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
|
460
|
+
$<$<COMPILE_LANGUAGE:Fortran>:$<INSTALL_INTERFACE:include/modules>>
|
|
461
|
+
$<INSTALL_INTERFACE:include>
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
include(GNUInstallDirs)
|
|
465
|
+
include(CMakePackageConfigHelpers)
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library installation directory")
|
|
469
|
+
set(DTFFT_INSTALL_CMAKEDIR
|
|
470
|
+
"${CMAKE_INSTALL_LIBDIR}/cmake/dtfft"
|
|
471
|
+
CACHE STRING "Path to dtFFT CMake files")
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
install(TARGETS dtfft
|
|
475
|
+
EXPORT dtfftTargets
|
|
476
|
+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
477
|
+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
478
|
+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
479
|
+
PUBLIC_HEADER DESTINATION include)
|
|
480
|
+
|
|
481
|
+
install(
|
|
482
|
+
EXPORT dtfftTargets
|
|
483
|
+
DESTINATION "${DTFFT_INSTALL_CMAKEDIR}"
|
|
484
|
+
CONFIGURATIONS Debug Release
|
|
485
|
+
FILE dtfftTargets.cmake)
|
|
486
|
+
|
|
487
|
+
write_basic_package_version_file(dtfftConfigVersion.cmake
|
|
488
|
+
VERSION ${CMAKE_PROJECT_VERSION}
|
|
489
|
+
COMPATIBILITY SameMajorVersion)
|
|
490
|
+
|
|
491
|
+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dtfftConfigVersion.cmake"
|
|
492
|
+
DESTINATION
|
|
493
|
+
"${DTFFT_INSTALL_CMAKEDIR}" )
|
|
494
|
+
|
|
495
|
+
configure_package_config_file(
|
|
496
|
+
${PROJECT_SOURCE_DIR}/cmake/dtfftConfig.cmake.in
|
|
497
|
+
"${CMAKE_CURRENT_BINARY_DIR}/dtfftConfig.cmake"
|
|
498
|
+
INSTALL_DESTINATION "${DTFFT_INSTALL_CMAKEDIR}"
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
install(FILES
|
|
502
|
+
"${CMAKE_CURRENT_BINARY_DIR}/dtfftConfig.cmake"
|
|
503
|
+
DESTINATION "${DTFFT_INSTALL_CMAKEDIR}"
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
install(DIRECTORY ${DTFFT_MODULE_DIR}
|
|
507
|
+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
508
|
+
FILES_MATCHING PATTERN "*.mod")
|
|
509
|
+
|
|
510
|
+
if (DTFFT_BUILD_PYTHON_API)
|
|
511
|
+
find_package(pybind11 3.0.0 REQUIRED)
|
|
512
|
+
endif()
|
|
513
|
+
|
|
514
|
+
if(DTFFT_BUILD_TESTS)
|
|
515
|
+
enable_testing()
|
|
516
|
+
add_subdirectory(tests)
|
|
517
|
+
endif()
|
|
518
|
+
add_subdirectory(src)
|
|
519
|
+
|
|
520
|
+
message(STATUS "dtFFT configuration summary:")
|
|
521
|
+
message(STATUS "Version : ${dtfft_VERSION}")
|
|
522
|
+
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
|
|
523
|
+
message(STATUS "Compiler : ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
|
|
524
|
+
message(STATUS "Install dir : ${CMAKE_INSTALL_PREFIX}")
|
|
525
|
+
message(STATUS "Build shared libs : ${DTFFT_BUILD_SHARED}")
|
|
526
|
+
message(STATUS "Use `mpi` module : ${DTFFT_USE_MPI}")
|
|
527
|
+
message(STATUS "Build C/C++ API: : ${DTFFT_BUILD_C_CXX_API}")
|
|
528
|
+
message(STATUS "Build tests : ${DTFFT_BUILD_TESTS}")
|
|
529
|
+
message(STATUS "Coverage : ${DTFFT_ENABLE_COVERAGE}")
|
|
530
|
+
message(STATUS "Profiler : ${DTFFT_WITH_PROFILER}")
|
|
531
|
+
message(STATUS "OpenMP enabled : ${DTFFT_WITH_OPENMP}")
|
|
532
|
+
message(STATUS "CUDA enabled : ${DTFFT_WITH_CUDA}")
|
|
533
|
+
if ( DTFFT_WITH_CUDA )
|
|
534
|
+
if ( DTFFT_WITH_MOCK_ENABLED )
|
|
535
|
+
message(STATUS " Building mock version of CUDA support")
|
|
536
|
+
endif()
|
|
537
|
+
message(STATUS "NCCL enabled : ${DTFFT_WITH_NCCL}")
|
|
538
|
+
if ( WITH_HPC_SDK )
|
|
539
|
+
message(STATUS "NVSHMEM enabled : ${DTFFT_WITH_NVSHMEM}")
|
|
540
|
+
endif()
|
|
541
|
+
endif()
|
|
542
|
+
|
|
543
|
+
if ( DTFFT_TRANSPOSE_ONLY )
|
|
544
|
+
message(STATUS "Building transpose only interface")
|
|
545
|
+
else()
|
|
546
|
+
message(STATUS "FFTW3 enabled : ${DTFFT_WITH_FFTW}")
|
|
547
|
+
message(STATUS "MKL enabled : ${DTFFT_WITH_MKL}")
|
|
548
|
+
if ( DTFFT_WITH_CUDA )
|
|
549
|
+
message(STATUS "cuFFT enabled : ${DTFFT_WITH_CUFFT}")
|
|
550
|
+
message(STATUS "VkFFT enabled : ${DTFFT_WITH_VKFFT}")
|
|
551
|
+
endif()
|
|
552
|
+
endif()
|
|
553
|
+
message(STATUS "Compression enabled : ${DTFFT_WITH_COMPRESSION}")
|