From d30ed08960a5ba520326a22d2248eb0a10a3e7bf Mon Sep 17 00:00:00 2001 From: dzzz2001 Date: Fri, 28 Mar 2025 17:06:35 +0800 Subject: [PATCH] modify warning output --- source/module_io/read_input_item_elec_stru.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/module_io/read_input_item_elec_stru.cpp b/source/module_io/read_input_item_elec_stru.cpp index 79fb24584b..4d4bae69af 100644 --- a/source/module_io/read_input_item_elec_stru.cpp +++ b/source/module_io/read_input_item_elec_stru.cpp @@ -122,9 +122,23 @@ void ReadInput::item_elec_stru() } else if (ks_solver == "cusolver" || ks_solver == "cusolvermp") { + std::string warningstr; #ifndef __MPI ModuleBase::WARNING_QUIT("ReadInput", "Cusolver can not be used for series version."); #endif +#ifndef __CUDA + warningstr = "ks_solver is set to " + ks_solver + " but ABACUS is built with CPU only!\n" + + " Please rebuild ABACUS with GPU support or change the ks_solver."; + ModuleBase::WARNING_QUIT("ReadInput", warningstr); +#endif + if( ks_solver == "cusolvermp") + { +#ifndef __CUSOLVERMP + warningstr = "ks_solver is set to cusolvermp, but ABACUS is not built with cusolvermp support\n" + " Please rebuild ABACUS with cusolvermp support or change the ks_solver."; + ModuleBase::WARNING_QUIT("ReadInput", warningstr); +#endif + } } else if (ks_solver == "pexsi") {