Skip to content

Commit f47bee7

Browse files
authored
Merge branch 'develop' into ZhouXY-PKU-pexsi
2 parents 5ff1c56 + e667040 commit f47bee7

File tree

126 files changed

+3182
-2434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+3182
-2434
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,10 +3882,13 @@ These variables are used to control berry phase and wannier90 interface paramete
38823882
- **Description**:
38833883
Type of electric field in the time domain.
38843884
- 0: Gaussian type function:
3885+
38853886
$$
38863887
E(t) = A \cos\left[2\pi f(t-t_0)+\varphi\right]\exp\left[-\frac{(t-t_0)^2}{2\sigma^2}\right]
38873888
$$
3889+
38883890
- 1: Trapezoid function:
3891+
38893892
$$
38903893
E(t) =
38913894
\begin{cases}
@@ -3895,18 +3898,23 @@ These variables are used to control berry phase and wannier90 interface paramete
38953898
0, & t \geqslant t_3
38963899
\end{cases}
38973900
$$
3901+
38983902
- 2: Trigonometric function:
3903+
38993904
$$
39003905
E(t) = A \cos(2\pi f_1 t + \varphi_1) \sin^2(2\pi f_2 t + \varphi_2)
39013906
$$
3907+
39023908
- 3: Heaviside step function:
3909+
39033910
$$
39043911
E(t) =
39053912
\begin{cases}
39063913
A, & t < t_0 \\
39073914
0, & t \geqslant t_0
39083915
\end{cases}
39093916
$$
3917+
39103918
- **Default**: 0
39113919

39123920
### td_tstart

source/Makefile.Objects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ OBJS_LCAO=evolve_elec.o\
634634
spar_hsr.o\
635635
spar_st.o\
636636
spar_u.o\
637+
LCAO_set.o\
637638
LCAO_set_fs.o\
638639
LCAO_set_st.o\
639640
LCAO_nl_mu.o\

source/source_base/module_container/base/third_party/cusolver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <cublas_v2.h>
55
#include <cuda_runtime.h>
6+
#include <iostream>
67

78
// #include <base/third_party/cusolver_utils.h> // traits, needed if generic API is used.
89
// header provided by cusolver, including some data types and macros.

source/source_base/module_device/memory_op.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ struct resize_memory_op_mt<FPTYPE, base_device::DEVICE_CPU>
452452
{
453453
mtfunc::free_ht(arr);
454454
}
455-
arr = (FPTYPE*)mtfunc::malloc_ht(sizeof(FPTYPE) * size, GlobalV::MY_RANK);
455+
arr = (FPTYPE*)mtfunc::malloc_ht(sizeof(FPTYPE) * size, GlobalV::MY_RANK % 4);
456456
std::string record_string;
457457
if (record_in != nullptr)
458458
{

source/source_base/module_external/blas_connector_matrix.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
3030
else if (device_type == base_device::AbacusDevice_t::DspDevice){
3131
mtfunc::sgemm_mth_(&transb, &transa, &n, &m, &k,
3232
&alpha, b, &ldb, a, &lda,
33-
&beta, c, &ldc, GlobalV::MY_RANK);
33+
&beta, c, &ldc, GlobalV::MY_RANK % 4);
3434
}
3535
#endif
3636
#ifdef __CUDA
@@ -67,7 +67,7 @@ void BlasConnector::gemm(const char transa,
6767
#ifdef __DSP
6868
else if (device_type == base_device::AbacusDevice_t::DspDevice)
6969
{
70-
mtfunc::dgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
70+
mtfunc::dgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
7171
}
7272
#endif
7373
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -106,7 +106,7 @@ void BlasConnector::gemm(const char transa,
106106
#ifdef __DSP
107107
else if (device_type == base_device::AbacusDevice_t::DspDevice)
108108
{
109-
mtfunc::cgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
109+
mtfunc::cgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
110110
}
111111
#endif
112112
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -157,7 +157,7 @@ void BlasConnector::gemm(const char transa,
157157
#ifdef __DSP
158158
else if (device_type == base_device::AbacusDevice_t::DspDevice)
159159
{
160-
mtfunc::zgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
160+
mtfunc::zgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
161161
}
162162
#endif
163163
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -200,7 +200,7 @@ void BlasConnector::gemm_cm(const char transa, const char transb, const int m, c
200200
else if (device_type == base_device::AbacusDevice_t::DspDevice){
201201
mtfunc::sgemm_mth_(&transb, &transa, &m, &n, &k,
202202
&alpha, a, &lda, b, &ldb,
203-
&beta, c, &ldc, GlobalV::MY_RANK);
203+
&beta, c, &ldc, GlobalV::MY_RANK % 4);
204204
}
205205
#endif
206206
#ifdef __CUDA
@@ -237,7 +237,7 @@ void BlasConnector::gemm_cm(const char transa,
237237
#ifdef __DSP
238238
else if (device_type == base_device::AbacusDevice_t::DspDevice)
239239
{
240-
mtfunc::dgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
240+
mtfunc::dgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
241241
}
242242
#endif
243243
#ifdef __CUDA
@@ -276,7 +276,7 @@ void BlasConnector::gemm_cm(const char transa,
276276
#ifdef __DSP
277277
else if (device_type == base_device::AbacusDevice_t::DspDevice)
278278
{
279-
mtfunc::cgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
279+
mtfunc::cgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
280280
}
281281
#endif
282282
#ifdef __CUDA
@@ -327,7 +327,7 @@ void BlasConnector::gemm_cm(const char transa,
327327
#ifdef __DSP
328328
else if (device_type == base_device::AbacusDevice_t::DspDevice)
329329
{
330-
mtfunc::zgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
330+
mtfunc::zgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
331331
}
332332
#endif
333333
#ifdef __CUDA

source/source_base/module_fft/fft_dsp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void FFT_DSP<double>::initfft(int nx_in, int ny_in, int nz_in)
1414
this->nx = nx_in;
1515
this->ny = ny_in;
1616
this->nz = nz_in;
17-
cluster_id = GlobalV::MY_RANK;
17+
cluster_id = GlobalV::MY_RANK % 4;
1818
nxyz = this->nx * this->ny * this->nz;
1919
}
2020
template <>

source/source_base/ylm.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ void Ylm::get_ylm_real( const int &Lmax, const ModuleBase::Vector3<double> &vec,
324324
* *************************/
325325
void Ylm::rlylm
326326
(
327-
const int& Lmax, //max momentum of l + 1
328-
const double& x,
329-
const double& y,
330-
const double& z,
327+
const int Lmax, //max momentum of l + 1
328+
const double x,
329+
const double y,
330+
const double z,
331331
double rly[]
332332
)
333333
{
@@ -529,10 +529,10 @@ void Ylm::rlylm
529529
//return ylm, not rlylm
530530
void Ylm::sph_harm
531531
(
532-
const int& Lmax, //max momentum of l
533-
const double& xdr,
534-
const double& ydr,
535-
const double& zdr,
532+
const int Lmax, //max momentum of l
533+
const double xdr,
534+
const double ydr,
535+
const double zdr,
536536
std::vector<double> &rly
537537
)
538538
{
@@ -668,10 +668,10 @@ void Ylm::sph_harm
668668
// Peize Lin change rly 2016-08-26
669669
void Ylm::rl_sph_harm
670670
(
671-
const int& Lmax, //max momentum of L
672-
const double& x,
673-
const double& y,
674-
const double& z,
671+
const int Lmax, //max momentum of L
672+
const double x,
673+
const double y,
674+
const double z,
675675
std::vector<double>& rly
676676
)
677677
{
@@ -807,10 +807,10 @@ void Ylm::rl_sph_harm
807807

808808
void Ylm::grad_rl_sph_harm
809809
(
810-
const int& Lmax, //max momentum of L
811-
const double& x,
812-
const double& y,
813-
const double& z,
810+
const int Lmax, //max momentum of L
811+
const double x,
812+
const double y,
813+
const double z,
814814
double* rly,
815815
double** grly
816816
)
@@ -1097,10 +1097,10 @@ void Ylm::grad_rl_sph_harm
10971097

10981098
void Ylm::hes_rl_sph_harm
10991099
(
1100-
const int& Lmax, //max momentum of L
1101-
const double& x,
1102-
const double& y,
1103-
const double& z,
1100+
const int Lmax, //max momentum of L
1101+
const double x,
1102+
const double y,
1103+
const double z,
11041104
std::vector<std::vector<double>>& hrly
11051105
)
11061106
{
@@ -1394,10 +1394,10 @@ void Ylm::test2 (void)
13941394

13951395
void Ylm::rlylm
13961396
(
1397-
const int& Lmax, //max momentum of l + 1
1398-
const double& x,
1399-
const double& y,
1400-
const double& z,
1397+
const int Lmax, //max momentum of l + 1
1398+
const double x,
1399+
const double y,
1400+
const double z,
14011401
double rly[],
14021402
double grly[][3]
14031403
)

source/source_base/ylm.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class Ylm
5353
* @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2...
5454
*/
5555
static void rlylm(
56-
const int& Lmax,
57-
const double& x,
58-
const double& y,
59-
const double& z,
56+
const int Lmax,
57+
const double x,
58+
const double y,
59+
const double z,
6060
double rly[]);
6161

6262
/**
@@ -70,10 +70,10 @@ class Ylm
7070
* @param grly [out] gradient of Ylm, [dY00/dx, dY00/dy, dY00/dz], [dY10/dx, dY10/dy, dY10/dz], [dY11/dx, dY11/dy, dY11/dz],...
7171
*/
7272
static void rlylm(
73-
const int& Lmax,
74-
const double& x,
75-
const double& y,
76-
const double& z,
73+
const int Lmax,
74+
const double x,
75+
const double y,
76+
const double z,
7777
double rly[],
7878
double grly[][3]);
7979

@@ -87,10 +87,10 @@ class Ylm
8787
* @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2...
8888
*/
8989
static void sph_harm(
90-
const int& Lmax,
91-
const double& xdr,
92-
const double& ydr,
93-
const double& zdr,
90+
const int Lmax,
91+
const double xdr,
92+
const double ydr,
93+
const double zdr,
9494
std::vector<double> &rly);
9595

9696
/**
@@ -105,10 +105,10 @@ class Ylm
105105
* @date 2016-08-26
106106
*/
107107
static void rl_sph_harm(
108-
const int& Lmax,
109-
const double& x,
110-
const double& y,
111-
const double& z,
108+
const int Lmax,
109+
const double x,
110+
const double y,
111+
const double z,
112112
std::vector<double>& rly);
113113

114114
/**
@@ -123,10 +123,10 @@ class Ylm
123123
* grly should be a memory-contiguous two-dimensional array for better performance.
124124
*/
125125
static void grad_rl_sph_harm(
126-
const int& Lmax,
127-
const double& x,
128-
const double& y,
129-
const double& z,
126+
const int Lmax,
127+
const double x,
128+
const double y,
129+
const double z,
130130
double* rly,
131131
double** grly);
132132

@@ -140,10 +140,10 @@ class Ylm
140140
* @param hrly [out] hessian of Ylm, [dY00/dx2, dY00/dxy, dY00/dxz, dY00/dyy, dY00/dyz, dY00/dzz] , ...
141141
*/
142142
static void hes_rl_sph_harm(
143-
const int& Lmax,
144-
const double& x,
145-
const double& y,
146-
const double& z,
143+
const int Lmax,
144+
const double x,
145+
const double y,
146+
const double z,
147147
std::vector<std::vector<double>>& hrly);
148148

149149
//calculate the coefficient of Ylm, ylmcoef.

source/source_esolver/esolver_double_xc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
146146
this->kv,
147147
this->two_center_bundle_,
148148
this->orb_,
149-
this->dmat_base.dm,
149+
this->dmat_base.dm,
150+
&this->dftu,
150151
this->deepks,
151152
istep,
152153
this->exx_nao);
@@ -396,6 +397,7 @@ void ESolver_DoubleXC<TK, TR>::cal_force(UnitCell& ucell, ModuleBase::matrix& fo
396397
this->kv,
397398
this->pw_rho,
398399
this->solvent,
400+
this->dftu,
399401
this->deepks,
400402
this->exx_nao,
401403
&ucell.symm);

source/source_esolver/esolver_gets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ESolver_GetS : public ESolver_KS<std::complex<double>>
3737

3838
TwoCenterBundle two_center_bundle_;
3939

40-
// temporary introduced during removing GlobalC::ORB
40+
// temporary introduced
4141
LCAO_Orbitals orb_;
4242
};
4343
} // namespace ModuleESolver

0 commit comments

Comments
 (0)