@@ -184,71 +184,46 @@ if(COMMIT_INFO)
184184 endif ()
185185endif ()
186186
187- # Different exe files of ABACUS
188- unset (ABACUS_BIN_NAME CACHE )
187+ # Determine the ABACUS executable name.
188+ if (NOT ENABLE_LCAO)
189+ set (_abacus_bin_level "pw" )
190+ elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
191+ set (_abacus_bin_level "max" )
192+ elseif (ENABLE_LIBRI)
193+ set (_abacus_bin_level "std" )
194+ elseif (ENABLE_MLALGO)
195+ set (_abacus_bin_level "ml" )
196+ else ()
197+ set (_abacus_bin_level "basic" )
198+ endif ()
189199
190- # Case : LCAO or PW
191- if (ENABLE_LCAO)
192- # Case: CUDA is enabled (suffix with 'g' for GPU)
193- if (USE_CUDA)
194- if (ENABLE_MPI)
195- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
196- set (ABACUS_BIN_NAME abacus_basic_gpu)
197- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
198- set (ABACUS_BIN_NAME abacus_std_gpu)
199- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
200- set (ABACUS_BIN_NAME abacus_ml_gpu)
201- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
202- set (ABACUS_BIN_NAME abacus_max_gpu)
203- endif ()
204- endif ()
205- # Case: CPU is enabled (suffix with 'p' for parallel)
206- else ()
207- if (ENABLE_MPI)
208- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
209- set (ABACUS_BIN_NAME abacus_basic_para)
210- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
211- set (ABACUS_BIN_NAME abacus_std_para)
212- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
213- set (ABACUS_BIN_NAME abacus_ml_para)
214- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
215- set (ABACUS_BIN_NAME abacus_max_para)
216- endif ()
217- else ()
218- if (NOT ENABLE_LIBRI AND NOT ENABLE_MLALGO)
219- set (ABACUS_BIN_NAME abacus_basic_ser)
220- elseif (ENABLE_LIBRI AND NOT ENABLE_MLALGO)
221- set (ABACUS_BIN_NAME abacus_std_ser)
222- elseif (NOT ENABLE_LIBRI AND ENABLE_MLALGO)
223- set (ABACUS_BIN_NAME abacus_ml_ser)
224- elseif (ENABLE_LIBRI AND ENABLE_MLALGO)
225- set (ABACUS_BIN_NAME abacus_max_ser)
226- endif ()
227- endif ()
228- endif ()
229- # Case : PW only
200+ if (ENABLE_MPI)
201+ set (_abacus_bin_para "para" )
202+ elseif (ENABLE_OPENMP)
203+ set (_abacus_bin_para "omp" )
230204else ()
231- if (USE_CUDA)
232- if (ENABLE_MPI)
233- set (ABACUS_BIN_NAME abacus_pw_gpu)
234- endif ()
235- else ()
236- if (ENABLE_MPI)
237- set (ABACUS_BIN_NAME abacus_pw_para)
238- else ()
239- set (ABACUS_BIN_NAME abacus_pw_ser)
240- endif ()
241- endif ()
205+ set (_abacus_bin_para "ser" )
242206endif ()
243207
208+ if (USE_CUDA OR USE_ROCM)
209+ set (_abacus_bin_device "gpu" )
210+ elseif (USE_CUDA_ON_DCU)
211+ set (_abacus_bin_device "dcu" )
212+ elseif (USE_DSP)
213+ set (_abacus_bin_device "dsp" )
214+ elseif (USE_SW)
215+ set (_abacus_bin_device "sw" )
216+ endif ()
217+
218+ set (ABACUS_BIN_NAME "abacus_${_abacus_bin_level} _${_abacus_bin_para} " )
219+
220+ if (_abacus_bin_device)
221+ string (APPEND ABACUS_BIN_NAME "_${_abacus_bin_device} " )
222+ endif ()
244223
245224# Use DSP hardware
246- if (USE_DSP)
247- if (ENABLE_ELPA)
248- message (WARNING USE_DSP is incompatible with ELPA; switching off ENABLE_ELPA)
249- set (ENABLE_ELPA OFF )
250- endif ()
251- set (ABACUS_BIN_NAME abacus_dsp)
225+ if (USE_DSP AND ENABLE_ELPA)
226+ message (FATAL_ERROR "USE_DSP is incompatible with ELPA." )
252227endif ()
253228
254229list (APPEND CMAKE_MODULE_PATH
0 commit comments