Skip to content

Commit 9825563

Browse files
author
root
committed
update the doc
1 parent c15bdba commit 9825563

File tree

7 files changed

+36
-32
lines changed

7 files changed

+36
-32
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- [kspacing](#kspacing)
2222
- [min\_dist\_coef](#min_dist_coef)
2323
- [device](#device)
24+
- [nb2d](#nb2d)
2425
- [precision](#precision)
2526
- [Variables related to input files](#variables-related-to-input-files)
2627
- [stru\_file](#stru_file)
@@ -45,7 +46,6 @@
4546
- [erf\_height](#erf_height)
4647
- [erf\_sigma](#erf_sigma)
4748
- [Numerical atomic orbitals related variables](#numerical-atomic-orbitals-related-variables)
48-
- [nb2d](#nb2d)
4949
- [lmaxmax](#lmaxmax)
5050
- [lcao\_ecut](#lcao_ecut)
5151
- [lcao\_dk](#lcao_dk)
@@ -667,6 +667,19 @@ If only one value is set (such as `kspacing 0.5`), then kspacing values of a/b/c
667667
- cg/bpcg/dav ks_solver: required by the `single` precision options
668668
- **Default**: double
669669

670+
### nb2d
671+
672+
- **Type**: Integer
673+
- **Description**: When using elpa or scalapack to solver the eigenvalue problem, the data should be distributed by the two-dimensional block-cyclic distribution. This paramter specifies the size of the block. It is valid for:
674+
- [ks_solver](#ks_solver) is genelpa or scalapack_gvx. If nb2d is set to 0, then it will be automatically set in the program according to the size of atomic orbital basis:
675+
- if size <= 500: nb2d = 1
676+
- if 500 < size <= 1000: nb2d = 32
677+
- if size > 1000: nb2d = 64;
678+
- [ks_solver](#ks_solver) is dav_subspace, and [diag_subspace](#diag_subspace) is 1 or 2. It is the block size for the diagonization of subspace. If it is set to 0, then it will be automatically set in the program according to the number of band:
679+
- if number of band > 500: nb2d = 32
680+
- if number of band < 500: nb2d = 16
681+
- **Default**: 0
682+
670683
[back to top](#full-list-of-input-keywords)
671684

672685
## Variables related to input files
@@ -842,15 +855,6 @@ These variables are used to control the plane wave related parameters.
842855

843856
These variables are used to control the numerical atomic orbitals related parameters.
844857

845-
### nb2d
846-
847-
- **Type**: Integer
848-
- **Description**: In LCAO calculations, we arrange the total number of processors in an 2D array, so that we can partition the wavefunction matrix (number of bands*total size of atomic orbital basis) and distribute them in this 2D array. When the system is large, we group processors into sizes of nb2d, so that multiple processors take care of one row block (a group of atomic orbitals) in the wavefunction matrix. If set to 0, nb2d will be automatically set in the program according to the size of atomic orbital basis:
849-
- if size <= 500 : nb2d = 1
850-
- if 500 < size <= 1000 : nb2d = 32
851-
- if size > 1000 : nb2d = 64;
852-
- **Default**: 0
853-
854858
### lmaxmax
855859

856860
- **Type**: Integer

source/module_hsolver/diag_hs_para.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void elpa_diag(MPI_Comm comm,
7171
#ifdef __MPI
7272

7373
template <typename T>
74-
void Diago_HS_para(T* h,
74+
void diago_hs_para(T* h,
7575
T* s,
7676
const int lda,
7777
const int nband,
@@ -160,7 +160,7 @@ void Diago_HS_para(T* h,
160160
}
161161

162162
// template instantiation
163-
template void Diago_HS_para<double>(double* h,
163+
template void diago_hs_para<double>(double* h,
164164
double* s,
165165
const int lda,
166166
const int nband,
@@ -170,7 +170,7 @@ template void Diago_HS_para<double>(double* h,
170170
const int diag_subspace,
171171
const int block_size);
172172

173-
template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
173+
template void diago_hs_para<std::complex<double>>(std::complex<double>* h,
174174
std::complex<double>* s,
175175
const int lda,
176176
const int nband,
@@ -180,7 +180,7 @@ template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
180180
const int diag_subspace,
181181
const int block_size);
182182

183-
template void Diago_HS_para<float>(float* h,
183+
template void diago_hs_para<float>(float* h,
184184
float* s,
185185
const int lda,
186186
const int nband,
@@ -190,7 +190,7 @@ template void Diago_HS_para<float>(float* h,
190190
const int diag_subspace,
191191
const int block_size);
192192

193-
template void Diago_HS_para<std::complex<float>>(std::complex<float>* h,
193+
template void diago_hs_para<std::complex<float>>(std::complex<float>* h,
194194
std::complex<float>* s,
195195
const int lda,
196196
const int nband,

source/module_hsolver/diag_hs_para.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace hsolver
3131
* @note 4. block_size should be 0 or a positive integer. If it is 0, then will use a value as large as possible that is allowed
3232
*/
3333
template <typename T>
34-
void Diago_HS_para(T* h,
34+
void diago_hs_para(T* h,
3535
T* s,
3636
const int lda,
3737
const int nband,

source/module_hsolver/diago_dav_subspace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ void Diago_DavSubspace<T, Device>::diag_zhegvx(const int& nbase,
638638
}
639639
}
640640
}
641-
Diago_HS_para(h_diag.data(),
641+
diago_hs_para(h_diag.data(),
642642
s_diag.data(),
643643
nbase,
644644
nband,

source/module_hsolver/test/test_diago_hs_para.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void test_diago_hs(int lda, int nb, int random_seed, int nbands, int diag_type,
128128
wfc.resize(lda * lda);
129129
generate_random_hs(lda, random_seed, h_mat, s_mat);
130130
}
131-
hsolver::Diago_HS_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb.data(), wfc.data(), comm, diag_type, nb);
131+
hsolver::diago_hs_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb.data(), wfc.data(), comm, diag_type, nb);
132132

133133
// Verify results
134134
if (my_rank == 0){
@@ -195,7 +195,7 @@ void test_performance(int lda, int nb, int nbands, MPI_Comm comm,int case_numb,
195195
auto start = std::chrono::high_resolution_clock::now();
196196
for (int j=0;j<loop_numb;j++)
197197
{
198-
hsolver::Diago_HS_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb_elpa.data(), wfc.data(), comm, 1, nb);
198+
hsolver::diago_hs_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb_elpa.data(), wfc.data(), comm, 1, nb);
199199
MPI_Barrier(comm);
200200
}
201201
MPI_Barrier(comm);
@@ -207,7 +207,7 @@ void test_performance(int lda, int nb, int nbands, MPI_Comm comm,int case_numb,
207207
start = std::chrono::high_resolution_clock::now();
208208
for (int j=0;j<loop_numb;j++)
209209
{
210-
hsolver::Diago_HS_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb_scalap.data(), wfc.data(), comm, 2, nb);
210+
hsolver::diago_hs_para<T>(h_mat.data(), s_mat.data(), lda, nbands,ekb_scalap.data(), wfc.data(), comm, 2, nb);
211211
MPI_Barrier(comm);
212212
}
213213
MPI_Barrier(comm);

source/module_hsolver/test/test_hsolver_pw.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
* - lcao_in_pw specific implementation
3434
*/
3535

36-
// mock Diago_HS_para
36+
// mock diago_hs_para
3737
namespace hsolver {
3838
template <typename T>
39-
void Diago_HS_para(T* h,
39+
void diago_hs_para(T* h,
4040
T* s,
4141
const int lda,
4242
const int nband,
@@ -46,7 +46,7 @@ void Diago_HS_para(T* h,
4646
const int diag_subspace,
4747
const int block_size = 0)
4848
{}
49-
template void Diago_HS_para<double>(double* h,
49+
template void diago_hs_para<double>(double* h,
5050
double* s,
5151
const int lda,
5252
const int nband,
@@ -56,7 +56,7 @@ template void Diago_HS_para<double>(double* h,
5656
const int diag_subspace,
5757
const int block_size);
5858

59-
template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
59+
template void diago_hs_para<std::complex<double>>(std::complex<double>* h,
6060
std::complex<double>* s,
6161
const int lda,
6262
const int nband,
@@ -66,7 +66,7 @@ template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
6666
const int diag_subspace,
6767
const int block_size);
6868

69-
template void Diago_HS_para<float>(float* h,
69+
template void diago_hs_para<float>(float* h,
7070
float* s,
7171
const int lda,
7272
const int nband,
@@ -76,7 +76,7 @@ template void Diago_HS_para<float>(float* h,
7676
const int diag_subspace,
7777
const int block_size);
7878

79-
template void Diago_HS_para<std::complex<float>>(std::complex<float>* h,
79+
template void diago_hs_para<std::complex<float>>(std::complex<float>* h,
8080
std::complex<float>* s,
8181
const int lda,
8282
const int nband,

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Sto_Func<REAL>::Sto_Func()
2323
}
2424
template class Sto_Func<double>;
2525

26-
// mock Diago_HS_para
26+
// mock diago_hs_para
2727
namespace hsolver {
2828
template <typename T>
29-
void Diago_HS_para(T* h,
29+
void diago_hs_para(T* h,
3030
T* s,
3131
const int lda,
3232
const int nband,
@@ -36,7 +36,7 @@ void Diago_HS_para(T* h,
3636
const int diag_subspace,
3737
const int block_size = 0)
3838
{}
39-
template void Diago_HS_para<double>(double* h,
39+
template void diago_hs_para<double>(double* h,
4040
double* s,
4141
const int lda,
4242
const int nband,
@@ -45,7 +45,7 @@ template void Diago_HS_para<double>(double* h,
4545
const MPI_Comm& comm,
4646
const int diag_subspace,
4747
const int block_size);
48-
template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
48+
template void diago_hs_para<std::complex<double>>(std::complex<double>* h,
4949
std::complex<double>* s,
5050
const int lda,
5151
const int nband,
@@ -54,7 +54,7 @@ template void Diago_HS_para<std::complex<double>>(std::complex<double>* h,
5454
const MPI_Comm& comm,
5555
const int diag_subspace,
5656
const int block_size);
57-
template void Diago_HS_para<float>(float* h,
57+
template void diago_hs_para<float>(float* h,
5858
float* s,
5959
const int lda,
6060
const int nband,
@@ -63,7 +63,7 @@ template void Diago_HS_para<float>(float* h,
6363
const MPI_Comm& comm,
6464
const int diag_subspace,
6565
const int block_size);
66-
template void Diago_HS_para<std::complex<float>>(std::complex<float>* h,
66+
template void diago_hs_para<std::complex<float>>(std::complex<float>* h,
6767
std::complex<float>* s,
6868
const int lda,
6969
const int nband,

0 commit comments

Comments
 (0)