@@ -14,7 +14,7 @@ namespace ModulePW
1414template <typename T>
1515void PW_Basis::gatherp_scatters (std::complex <T>* in, std::complex <T>* out) const
1616{
17- ModuleBase::timer::tick (this ->classname , " gatherp_scatters" );
17+ // ModuleBase::timer::tick(this->classname, "gatherp_scatters");
1818
1919 if (this ->poolnproc == 1 ) // In this case nst=nstot, nz = nplane,
2020 {
@@ -32,7 +32,7 @@ void PW_Basis::gatherp_scatters(std::complex<T>* in, std::complex<T>* out) const
3232 outp[iz] = inp[iz];
3333 }
3434 }
35- ModuleBase::timer::tick (this ->classname , " gatherp_scatters" );
35+ // ModuleBase::timer::tick(this->classname, "gatherp_scatters");
3636 return ;
3737 }
3838#ifdef __MPI
@@ -55,10 +55,15 @@ void PW_Basis::gatherp_scatters(std::complex<T>* in, std::complex<T>* out) const
5555
5656 // exchange data
5757 // (nplane,nstot) to (numz[ip],ns, poolnproc)
58- if (typeid (T) == typeid (double ))
59- MPI_Alltoallv (out, numr, startr, MPI_DOUBLE_COMPLEX, in, numg, startg, MPI_DOUBLE_COMPLEX, this ->pool_world );
60- else if (typeid (T) == typeid (float ))
61- MPI_Alltoallv (out, numr, startr, MPI_COMPLEX, in, numg, startg, MPI_COMPLEX, this ->pool_world );
58+ if (typeid (T) == typeid (double ))
59+ {
60+ MPI_Alltoallv (out, numr, startr, MPI_DOUBLE_COMPLEX, in, numg, startg, MPI_DOUBLE_COMPLEX, this ->pool_world );
61+ }
62+ else if (typeid (T) == typeid (float ))
63+ {
64+ MPI_Alltoallv (out, numr, startr, MPI_COMPLEX, in, numg, startg, MPI_COMPLEX, this ->pool_world );
65+ }
66+
6267 // change (nz,ns) to (numz[ip],ns, poolnproc)
6368#ifdef _OPENMP
6469#pragma omp parallel for collapse(2)
@@ -80,7 +85,7 @@ void PW_Basis::gatherp_scatters(std::complex<T>* in, std::complex<T>* out) const
8085 }
8186
8287#endif
83- ModuleBase::timer::tick (this ->classname , " gatherp_scatters" );
88+ // ModuleBase::timer::tick(this->classname, "gatherp_scatters");
8489 return ;
8590}
8691
@@ -94,7 +99,7 @@ void PW_Basis::gatherp_scatters(std::complex<T>* in, std::complex<T>* out) const
9499template <typename T>
95100void PW_Basis::gathers_scatterp (std::complex <T>* in, std::complex <T>* out) const
96101{
97- ModuleBase::timer::tick (this ->classname , " gathers_scatterp" );
102+ // ModuleBase::timer::tick(this->classname, "gathers_scatterp");
98103
99104 if (this ->poolnproc == 1 ) // In this case nrxx=fftnx*fftny*nz, nst = nstot,
100105 {
@@ -147,10 +152,15 @@ void PW_Basis::gathers_scatterp(std::complex<T>* in, std::complex<T>* out) const
147152
148153 // exchange data
149154 // (numz[ip],ns, poolnproc) to (nplane,nstot)
150- if (typeid (T) == typeid (double ))
151- MPI_Alltoallv (out, numg, startg, MPI_DOUBLE_COMPLEX, in, numr, startr, MPI_DOUBLE_COMPLEX, this ->pool_world );
152- else if (typeid (T) == typeid (float ))
153- MPI_Alltoallv (out, numg, startg, MPI_COMPLEX, in, numr, startr, MPI_COMPLEX, this ->pool_world );
155+ if (typeid (T) == typeid (double ))
156+ {
157+ MPI_Alltoallv (out, numg, startg, MPI_DOUBLE_COMPLEX, in, numr, startr, MPI_DOUBLE_COMPLEX, this ->pool_world );
158+ }
159+ else if (typeid (T) == typeid (float ))
160+ {
161+ MPI_Alltoallv (out, numg, startg, MPI_COMPLEX, in, numr, startr, MPI_COMPLEX, this ->pool_world );
162+ }
163+
154164#ifdef _OPENMP
155165#pragma omp parallel for schedule(static, 4096/sizeof(T))
156166#endif
@@ -175,10 +185,10 @@ void PW_Basis::gathers_scatterp(std::complex<T>* in, std::complex<T>* out) const
175185 }
176186
177187#endif
178- ModuleBase::timer::tick (this ->classname , " gathers_scatterp" );
188+ // ModuleBase::timer::tick(this->classname, "gathers_scatterp");
179189 return ;
180190}
181191
182192
183193
184- }
194+ }
0 commit comments