Skip to content

Commit 39b03c1

Browse files
authored
modify warning output (#6074)
1 parent 26d8284 commit 39b03c1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

source/module_io/read_input_item_elec_stru.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,23 @@ void ReadInput::item_elec_stru()
122122
}
123123
else if (ks_solver == "cusolver" || ks_solver == "cusolvermp")
124124
{
125+
std::string warningstr;
125126
#ifndef __MPI
126127
ModuleBase::WARNING_QUIT("ReadInput", "Cusolver can not be used for series version.");
127128
#endif
129+
#ifndef __CUDA
130+
warningstr = "ks_solver is set to " + ks_solver + " but ABACUS is built with CPU only!\n"
131+
+ " Please rebuild ABACUS with GPU support or change the ks_solver.";
132+
ModuleBase::WARNING_QUIT("ReadInput", warningstr);
133+
#endif
134+
if( ks_solver == "cusolvermp")
135+
{
136+
#ifndef __CUSOLVERMP
137+
warningstr = "ks_solver is set to cusolvermp, but ABACUS is not built with cusolvermp support\n"
138+
" Please rebuild ABACUS with cusolvermp support or change the ks_solver.";
139+
ModuleBase::WARNING_QUIT("ReadInput", warningstr);
140+
#endif
141+
}
128142
}
129143
else if (ks_solver == "pexsi")
130144
{

0 commit comments

Comments
 (0)