@@ -46,8 +46,6 @@ void PW_Basis::distribution_method2()
4646 */
4747 this ->count_pw_st (st_length2D, st_bottom2D);
4848 }
49- if (mpi_flag_)
50- {
5149#ifdef __MPI
5250 MPI_Bcast (&this ->npwtot , 1 , MPI_INT, 0 , this ->pool_world );
5351 MPI_Bcast (&this ->nstot , 1 , MPI_INT, 0 , this ->pool_world );
@@ -56,13 +54,10 @@ void PW_Basis::distribution_method2()
5654 MPI_Bcast (&lix, 1 , MPI_INT, 0 , this ->pool_world );
5755 MPI_Bcast (&rix, 1 , MPI_INT, 0 , this ->pool_world );
5856#endif
59- }
6057 delete[] this ->istot2ixy ; this ->istot2ixy = new int [this ->nstot ];
6158
6259 if (poolrank == 0 )
6360 {
64- if (mpi_flag_)
65- {
6661#ifdef __MPI
6762
6863 // Parallel line
@@ -77,8 +72,7 @@ void PW_Basis::distribution_method2()
7772 // We do not need startnsz_per after it.
7873 delete[] this ->startnsz_per ;
7974 this ->startnsz_per =nullptr ;
80- #endif
81- }else {
75+ #else
8276 // Serial line
8377 // get nst_per, npw_per, fftixy2ip, and istot2ixy
8478 this ->nst_per [0 ] = this ->nstot ;
@@ -93,18 +87,15 @@ void PW_Basis::distribution_method2()
9387 st_move++;
9488 }
9589 }
96- }
90+ # endif
9791 }
9892#ifdef __MPI
99- if (mpi_flag_)
100- {
101- MPI_Bcast (st_length2D, this ->fftnxy , MPI_INT, 0 , this ->pool_world );
102- MPI_Bcast (st_bottom2D, this ->fftnxy , MPI_INT, 0 , this ->pool_world );
103- MPI_Bcast (this ->fftixy2ip , this ->fftnxy , MPI_INT, 0 , this ->pool_world );
104- MPI_Bcast (this ->istot2ixy , this ->nstot , MPI_INT, 0 , this ->pool_world );
105- MPI_Bcast (this ->nst_per , this ->poolnproc , MPI_INT, 0 , this ->pool_world );
106- MPI_Bcast (this ->npw_per , this ->poolnproc , MPI_INT, 0 , this ->pool_world );
107- }
93+ MPI_Bcast (st_length2D, this ->fftnxy , MPI_INT, 0 , this ->pool_world );
94+ MPI_Bcast (st_bottom2D, this ->fftnxy , MPI_INT, 0 , this ->pool_world );
95+ MPI_Bcast (this ->fftixy2ip , this ->fftnxy , MPI_INT, 0 , this ->pool_world );
96+ MPI_Bcast (this ->istot2ixy , this ->nstot , MPI_INT, 0 , this ->pool_world );
97+ MPI_Bcast (this ->nst_per , this ->poolnproc , MPI_INT, 0 , this ->pool_world );
98+ MPI_Bcast (this ->npw_per , this ->poolnproc , MPI_INT, 0 , this ->pool_world );
10899#endif
109100 this ->npw = this ->npw_per [this ->poolrank ];
110101 this ->nst = this ->nst_per [this ->poolrank ];
0 commit comments