You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build system is driven by `cmake`. It is good practice to directly point to the MPI Fortran wrapper that you would like to use to guarantee consistency between Fortran compiler and MPI. This can be done by setting the default Fortran environmental variable
If the directory does not exist it will be generated and it will contain the configuration files. The configuration can be further edited by using the `ccmake` utility as
17
+
18
+
``ccmake $path_to_build_directory``
19
+
20
+
and editing as desired, variables that are likely of interest are: `CMAKE_BUILD_TYPE` and `FFT_Choice`; additional variables can be shown by entering "advanced mode" by pressing `t`.
21
+
22
+
By default a `RELEASE` build will built, other options for `CMAKE_BUILD_TYPE` are `DEBUG` and `DEV` which turn on debugging flags and additionally try to catch coding errors at compile time, respectively.
23
+
28
24
The behaviour of debug and development versions of the library can be changed before the
29
-
initialization using the variable ``decomp_debug`` or the environment variable ``DECOMP_2D_DEBUG``.
30
-
The value provided with the environment variable must be a positive integer below 9999.
25
+
initialization using the variable ``decomp_debug`` or the environment variable ``DECOMP_2D_DEBUG``. The value provided with the environment variable must be a positive integer below 9999.
31
26
32
27
Two `BUILD_TARGETS` are available namely `mpi` and `gpu`. For the `mpi` target no additional options should be required. whereas for `gpu` extra options are necessary at the configure stage. Please see section [GPU Compilation](#gpu-compilation)
33
28
34
29
Once the build system has been configured, you can build `2decomp&fft` by running
appending `-v` will display additional information about the build, such as compiler flags.
39
34
40
35
After building the library can be tested. Please see section [Testing and examples](#testing-and-examples)
41
36
42
37
Options can be added to change the level of verbosity. Finally, the build library can be installed by running
43
-
```
44
-
cmake --install $path_to_build_directory
45
-
```
46
-
The default location for `libdecomp2d.a` is `$path_to_build_directory/opt/lib`or `$path_to_build_directory/opt/lib64` unless the variable `CMAKE_INSTALL_PREFIX` is modified.
38
+
39
+
``cmake --install $path_to_build_directory``
40
+
41
+
The default location for *libdecomp2d.a* is
42
+
43
+
``$path_to_build_directory/opt/lib`` or
44
+
45
+
``$path_to_build_directory/opt/lib64``
46
+
47
+
unless the variable *CMAKE_INSTALL_PREFIX* is modified.
48
+
47
49
The module files generated by the build process will similarly be installed to `$path_to_build_directory/opt/install`, users of the library should add this to the include paths for their program.
48
50
49
51
As indicated above, by default a static `libdecomp2d.a` will be compiled, if desired a shared library can be built by setting `BUILD_SHARED_LIBS=ON` either on the command line:
Note, further configuration can be performed using `ccmake`, however the initial configuration of GPU builds must include the `-DBUILD_TARGET=gpu` flag as shown above.
73
79
74
80
By default CUDA aware MPI will be used together with `cuFFT` for the FFT library. The configure will automatically look for the GPU architecture available on the system. If you are building on a HPC system please use a computing node for the installation. Useful variables to be added are
75
81
76
82
- `-DENABLE_NCCL=yes` to activate the NCCL collectives
77
83
- `-DENABLE_MANAGED=yes` to activate the automatic memory management form the NVHPC compiler
78
-
If you are getting the following error
79
-
```
80
-
-- The CUDA compiler identification is unknown
84
+
85
+
If you are getting the following error
86
+
87
+
``-- The CUDA compiler identification is unknown
81
88
CMake Error at /usr/share/cmake/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
82
-
Failed to detect a default CUDA architecture.
83
-
```
89
+
Failed to detect a default CUDA architecture.``,
90
+
84
91
It is possible that your default C compiler is too recent and not supported by `nvcc` . You might be able to solve the issue by adding
85
92
- `-DCMAKE_CUDA_HOST_COMPILER=$supported_gcc`
86
93
@@ -89,75 +96,78 @@ It is possible that your default C compiler is too recent and not supported by `
89
96
Linking from external codes
90
97
==============================
91
98
92
-
Codes using Makefiles
93
-
=========================
99
+
**Codes using Makefiles**
100
+
94
101
95
102
When building a code that links 2decomp-fft using a Makefile you will need to add the include and link paths as appropriate (`inlude/` and `lib/` under the installation directory, respectively).
96
-
```
97
-
DECOMP_ROOT = /path/to/2decomp-fft
98
-
DECOMP_BUILD_DIR = $(DECOMP_ROOT)/build
99
-
DECOMP_INSTALL_DIR ?= $(DECOMP_BUILD_DIR)/opt # Use default unless set by user
100
103
101
-
INC += -I$(DECOMP_INSTALL_DIR)/include
104
+
::
105
+
106
+
DECOMP_ROOT = /path/to/2decomp-fft
107
+
DECOMP_BUILD_DIR = $(DECOMP_ROOT)/build
108
+
DECOMP_INSTALL_DIR ?= $(DECOMP_BUILD_DIR)/opt # Use default unless set by user
where `ENABLE_PROFILER` is set to the profiling tool desired, currently supported values are: `caliper`.
162
172
Note that when using `caliper` a C++ compiler is required as indicated in the above command line.
163
173
@@ -167,45 +177,45 @@ Miscellaneous
167
177
List of preprocessor variables
168
178
==============================
169
179
170
-
#### DEBUG
180
+
**DEBUG**
171
181
172
182
This variable is automatically added in debug and dev builds. Extra information is printed when it is present.
173
183
174
-
#### DOUBLE_PREC
184
+
**DOUBLE_PREC**
175
185
176
186
When this variable is not present, the library uses single precision. When it is present, the library uses double precision. This preprocessor variable is driven by the CMake on/off variable `DOUBLE_PRECISION`.
177
187
178
-
#### SAVE_SINGLE
188
+
**SAVE_SINGLE**
179
189
180
190
This variable is valid for double precision builds only. When it is present, snapshots are written in single precision. This preprocessor variable is driven by the CMake on/off variable `SINGLE_PRECISION_OUTPUT`.
181
191
182
-
#### PROFILER
192
+
**PROFILER**
183
193
184
194
This variable is automatically added when selecting the profiler. It activates the profiling sections of the code.
185
195
186
-
#### EVEN
196
+
**EVEN**
187
197
188
198
This preprocessor variable is not valid for GPU builds. It leads to padded alltoall operations. This preprocessor variable is driven by the CMake on/off variable `EVEN`.
189
199
190
-
#### OVERWRITE
200
+
**OVERWRITE**
191
201
192
202
This variable leads to overwrite the input array when computing FFT. The support of this flag does not always correspond to in-place transforms, depending on the FFT backend selected, as described above. This preprocessor variable is driven by the CMake on/off variable `ENABLE_INPLACE`.
193
203
194
-
#### HALO_DEBUG
204
+
**HALO_DEBUG**
195
205
196
206
This variable is used to debug the halo operations. This preprocessor variable is driven by the CMake on/off variable `HALO_DEBUG`.
197
207
198
-
#### _GPU
208
+
**_GPU**
199
209
200
210
This variable is automatically added in GPU builds.
201
211
202
-
#### _NCCL
212
+
**_NCCL**
203
213
204
214
This variable is valid only for GPU builds. The NVIDIA Collective Communication Library (NCCL) implements multi-GPU and multi-node communication primitives optimized for NVIDIA GPUs and Networking.
205
215
206
-
## Optional dependencies
216
+
**Optional dependencies**
207
217
208
-
### FFTW
218
+
**FFTW**
209
219
210
220
The library [fftw](http://www.fftw.org/index.html) can be used as a backend for the FFT engine. The version 3.3.10 was tested, is supported and can be downloaded [here](http://www.fftw.org/download.html). Please note that one should build fftw and decomp2d against the same compilers. For build instructions, please check [here](http://www.fftw.org/fftw3_doc/Installation-on-Unix.html). Below is a suggestion for the compilation of the library in double precision (add `--enable-single` for a single precision build):
211
221
@@ -219,14 +229,13 @@ make -j check
219
229
make install
220
230
```
221
231
Please note that the resulting build is not compatible with CMake (https://github.com/FFTW/fftw3/issues/130). As a workaround, one can open the file `/path/to/fftw3/install/lib/cmake/fftw3/FFTW3Config.cmake` and comment the line
222
-
```
223
-
include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake")
To build `2decomp&fft` against fftw3, one can provide the package configuration for fftw3 in the `PKG_CONFIG_PATH` environment variable, this should be found under `/path/to/fftw3/install/lib/pkgconfig`. One can also provide the option `-DFFTW_ROOT=/path/to/fftw3/install`. Then either specify on the command line when configuring the build
Note the legacy `fftw` interface lacks interface definitions and will fail when stricter compilation flags are used (e.g. when `-DCMAKE_BUILD_TYPE=Dev`) for this it is recommended to use `fftw_f03` which provides proper interfaces.
@@ -236,21 +245,20 @@ Caliper
236
245
237
246
The library [caliper](https://github.com/LLNL/Caliper) can be used to profile the execution of the code. The version 2.9.1 was tested and is supported, version 2.8.0 has also been tested and is still expected to work. Please note that one must build caliper and decomp2d against the same C/C++/Fortran compilers and MPI libray. For build instructions, please check [here](https://github.com/LLNL/Caliper#building-and-installing) and [here](https://software.llnl.gov/Caliper/CaliperBasics.html#build-and-install). Below is a suggestion for the compilation of the library using the GNU compilers:
0 commit comments