Skip to content

Commit 434d25e

Browse files
committed
Report and exit for unsupported DSP KPAR configuration
1 parent be03870 commit 434d25e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/source_main/driver_run.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void Driver::driver_run()
8787
{
8888
p_esolver->runner(ucell, 0);
8989
}
90-
else if (cal == "get_pchg" || cal == "get_wf" || cal == "gen_bessel" || cal == "gen_opt_abfs" ||
90+
else if (cal == "get_pchg" || cal == "get_wf" || cal == "gen_bessel" || cal == "gen_opt_abfs" ||
9191
cal == "test_memory" || cal == "test_neighbour")
9292
{
9393
//! supported "other" functions:
@@ -128,6 +128,11 @@ void Driver::init_hardware()
128128
#endif
129129

130130
#ifdef __DSP
131+
if (GlobalV::NPROC != KPAR)
132+
{
133+
std::cout << "Error: Number of processors must be equal to KPAR for DSP hardware initialization." << std::endl;
134+
std::exit(1);
135+
}
131136
std::cout << " ** Initializing DSP Hardware..." << std::endl;
132137
mtfunc::dspInitHandle(GlobalV::MY_RANK % PARAM.inp.dsp_count);
133138
#endif
@@ -149,4 +154,4 @@ void Driver::finalize_hardware()
149154
std::cout << " ** Closing DSP Hardware..." << std::endl;
150155
mtfunc::dspDestoryHandle(GlobalV::MY_RANK);
151156
#endif
152-
}
157+
}

0 commit comments

Comments
 (0)