@@ -35,10 +35,6 @@ void Parallel_Grid::init(
3535 const int &bz_in)
3636{
3737
38- #ifndef __MPI
39- return ;
40- #endif
41-
4238 ModuleBase::TITLE (" Parallel_Grid" ," init" );
4339
4440 this ->ncx = ncx_in;
@@ -47,7 +43,7 @@ void Parallel_Grid::init(
4743 this ->nczp = nczp_in;
4844 this ->nrxx = nrxx_in;
4945 this ->nbz = nbz_in;
50- this ->bz = bz_in;
46+ this ->bz = bz_in;
5147
5248 if (nczp<0 )
5349 {
@@ -60,7 +56,11 @@ void Parallel_Grid::init(
6056 assert (ncz > 0 );
6157
6258 this ->ncxy = ncx * ncy;
63- this ->ncxyz = ncxy * ncz;
59+ this ->ncxyz = ncxy * ncz;
60+
61+ #ifndef __MPI
62+ return ;
63+ #endif
6464
6565 // enable to call this function again liuyu 2023-03-10
6666 if (this ->allocate )
@@ -323,7 +323,7 @@ void Parallel_Grid::zpiece_to_stogroup(double *zpiece, const int &iz, double *rh
323323 return ;
324324
325325}
326- void Parallel_Grid::reduce_to_fullrho (double * rhotot, const double * const rhoin)
326+ void Parallel_Grid::reduce_to_fullrho (double * rhotot, const double * const rhoin)const
327327{
328328 // ModuleBase::TITLE("Parallel_Grid","reduce_to_fullrho");
329329
@@ -393,10 +393,6 @@ void Parallel_Grid::init_final_scf(const int &ncx_in, const int &ncy_in, const i
393393const int &nrxx_in, const int &nbz_in, const int &bz_in)
394394{
395395
396- #ifndef __MPI
397- return ;
398- #endif
399-
400396 ModuleBase::TITLE (" Parallel_Grid" ," init" );
401397
402398 this ->ncx = ncx_in;
@@ -405,7 +401,7 @@ const int &nrxx_in, const int &nbz_in, const int &bz_in)
405401 this ->nczp = nczp_in;
406402 this ->nrxx = nrxx_in;
407403 this ->nbz = nbz_in;
408- this ->bz = bz_in;
404+ this ->bz = bz_in;
409405
410406 if (nczp<0 )
411407 {
@@ -418,7 +414,11 @@ const int &nrxx_in, const int &nbz_in, const int &bz_in)
418414 assert (ncz > 0 );
419415
420416 this ->ncxy = ncx * ncy;
421- this ->ncxyz = ncxy * ncz;
417+ this ->ncxyz = ncxy * ncz;
418+
419+ #ifndef __MPI
420+ return ;
421+ #endif
422422
423423 // (2)
424424 assert (allocate_final_scf==false );
0 commit comments