@@ -325,7 +325,7 @@ void ORB_control::mpi_creat_cart(MPI_Comm* comm_2D,
325325#endif
326326
327327#ifdef __MPI
328- void ORB_control::mat_2d (MPI_Comm vu,
328+ int ORB_control::mat_2d (MPI_Comm vu,
329329 const int &M_A,
330330 const int &N_A,
331331 const int &nb,
@@ -365,7 +365,14 @@ void ORB_control::mat_2d(MPI_Comm vu,
365365 {
366366 ofs_warning << " cpu 2D distribution : " << dim[0 ] << " *" << dim[1 ] << std::endl;
367367 ofs_warning << " but, the number of row blocks is " << block << std::endl;
368- ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no row blocks, try a smaller 'nb2d' parameter." );
368+ if (nb>1 )
369+ {
370+ return 1 ;
371+ }
372+ else
373+ {
374+ ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no row blocks, try a smaller 'nb2d' parameter." );
375+ }
369376 }
370377
371378 // (2.1) row_b : how many blocks for this processor. (at least)
@@ -428,7 +435,14 @@ void ORB_control::mat_2d(MPI_Comm vu,
428435 {
429436 ofs_warning << " cpu 2D distribution : " << dim[0 ] << " *" << dim[1 ] << std::endl;
430437 ofs_warning << " but, the number of column blocks is " << block << std::endl;
431- ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no column blocks." );
438+ if (nb>1 )
439+ {
440+ return 1 ;
441+ }
442+ else
443+ {
444+ ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no column blocks." );
445+ }
432446 }
433447
434448 LM.col_b =block/dim[1 ];
@@ -485,7 +499,14 @@ void ORB_control::mat_2d(MPI_Comm vu,
485499 {
486500 ofs_warning << " cpu 2D distribution : " << dim[0 ] << " *" << dim[1 ] << std::endl;
487501 ofs_warning << " but, the number of bands-row-block is " << block << std::endl;
488- ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no bands-row-blocks." );
502+ if (nb>1 )
503+ {
504+ return 1 ;
505+ }
506+ else
507+ {
508+ ModuleBase::WARNING_QUIT (" ORB_control::mat_2d" ," some processor has no bands-row-blocks." );
509+ }
489510 }
490511 int col_b_bands = block / dim[1 ];
491512 if (coord[1 ] < block % dim[1 ])
@@ -510,7 +531,7 @@ void ORB_control::mat_2d(MPI_Comm vu,
510531 }
511532 pv->nloc_wfc = pv->ncol_bands * LM.row_num ;
512533
513- return ;
534+ return 0 ;
514535}
515536#endif
516537
0 commit comments