-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: parallel solve subspace diagonalization in dav_subspace #5549
base: develop
Are you sure you want to change the base?
Conversation
- **Default**: 4 | ||
- **Default**: 4 | ||
|
||
### diag_subspace_method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using "diag_subspace" and delete "_method"
const int* n, float* A, const int* ia, const int* ja, const int*desca, float* B, const int* ib, const int* jb, const int*descb, | ||
const float* vl, const float* vu, const int* il, const int* iu, | ||
const float* abstol, int* m, int* nz, float* w, const float*orfac, float* Z, const int* iz, const int* jz, const int*descz, | ||
float* work, int* lwork, int*iwork, int*liwork, int* ifail, int*iclustr, float*gap, int* info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least leave a blank line between two functions
const int diag_subspace_method, | ||
const int block_size) | ||
{ | ||
int myrank; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize the variable
|
||
template <typename T> | ||
void Diago_HS_para( | ||
T* h, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggset using clang-format before you pr a new code, here T is not aligned with the following variables
work, lwork,rwork, lrwork, iwork, liwork, ifail, iclustr, gap, info); | ||
} | ||
|
||
// post processing for pdsygvx/pzhegvx/pdsygvx/pzhegvx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain the functions of pdsygvx/pzhegvx/pdsygvx/pzhegvx
typename GetTypeReal<T>::type *const ekb, | ||
T *const wfc_2d) | ||
{ | ||
int nprow, npcol, myprow, mypcol; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize one variable for a line
int ndim_global = desc[2]; | ||
const char jobz = 'V', range = 'I', uplo = 'U'; | ||
const int itype = 1, il = 1, iu = nbands, one = 1; | ||
int M = 0, NZ = 0, lwork = -1, lrwork = -1, liwork = -1, info = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line for a variable
} | ||
|
||
// template instantiation | ||
template void pxxxgvx_diag(const int *const desc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain the functions of the four templates
|
I have a brief insight regarding this PR: This process involves a transformation of parallel strategy.
Can this transformation of parallel strategy be more general? If the H and S matrices of LCAO are solved by iterative method (like |
The parallel diagonization is not always more efficient, it is related to the system size, parallel cores, and efficiency of parallel communication, etc. I have done some tests in #5480. |
The transformation of different 2D block distribution can be realized easily by call the scalapack function |
*/ | ||
|
||
template <typename T> | ||
void pxxxgvx_diag(const int* const desc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does p stand for "parameter"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pxxxgvx is the wrapper of pdsygvx_/pzhegvx_/pdsygvx_/pzhegvx_ in scalapack
Diago_HS_para()
to diago the H/S by genelpa or scalapack. The function will perform 2D block distribution of data, call elpa/scalapack for solution, and collect eigenvectors to rank0.pxxxgvx_diag()
for calling scalapack to solve the generalized eigenvalue problem with double/complex/float/complex.diag_subspace_method
, which support to set the subspace diagonalization method in dav_subspace to use elpa or scalapack to solve.Reminder
Linked Issue
Fix #5480
Unit Tests and/or Case Tests for my changes
What's changed?
Any changes of core modules? (ignore if not applicable)