Skip to content

Commit 6bc4438

Browse files
committed
modify warning output
1 parent 5b19d01 commit 6bc4438

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/module_io/read_input_item_elec_stru.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,19 @@ 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.");
128+
#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+
#ifndef __CUSOLVERMP
135+
warningstr = "ks_solver is set to cusolvermp, but ABACUS is not built with cusolvermp support\n"
136+
" Please rebuild ABACUS with cusolvermp support or change the ks_solver.";
137+
ModuleBase::WARNING_QUIT("ReadInput", warningstr);
127138
#endif
128139
}
129140
else if (ks_solver == "pexsi")

0 commit comments

Comments
 (0)