Conversation
|
comment one |
| GlobalC::wf.npwx)); | ||
| } | ||
| if(m == 1) | ||
| if(m != 1) |
| } | ||
| else if(GlobalV::KS_SOLVER=="cusolver") | ||
| { | ||
| label = "CU"; |
| #endif | ||
|
|
||
|
|
||
|
|
| int maxncol; | ||
|
|
||
| MPI_Allreduce(&ncol, &maxncol, 1, MPI_INT, MPI_MAX, comm_2D); | ||
| // MPI_Reduce(&ncol, &maxncol, 1, MPI_LONG, MPI_MAX, 0, comm_2D); |
| #include "../module_base/memory.h" | ||
| #include "../module_base/timer.h" | ||
|
|
||
| #include <chrono> |
There was a problem hiding this comment.
关于chrono这部分应该都是调试的,可以在适当时候清理掉
| { | ||
|
|
||
| #ifdef __MPI | ||
| GlobalV::ofs_warning << "Cusolver is now only available for LCAO." << std::endl; |
There was a problem hiding this comment.
全局的cusolver可以统一一下大小写,感觉和后面的写法不太一致,找一个统一的写法
There was a problem hiding this comment.
我不是说和ks_solver里面的字符串内容,我是说后面又看到了cuSolver写法,与这里的Cusolver不一致
There was a problem hiding this comment.
后面都是全小写的,这里因为是一个句子,首字母大写了一下。
| int iic; | ||
|
|
||
| if(GlobalV::KS_SOLVER=="genelpa" || GlobalV::KS_SOLVER=="scalapack_gvx") // save the matrix as column major format | ||
| if(GlobalV::KS_SOLVER=="genelpa" || GlobalV::KS_SOLVER=="scalapack_gvx" || GlobalV::KS_SOLVER=="cusolver") // save the matrix as column major format |
There was a problem hiding this comment.
这个判断后面用了非常多次,能不能新构造一个GlobalV的变量记录一下这个布尔值?
There was a problem hiding this comment.
abacus对genelpa和scalapack_gvx都没有这样做,感觉判断的代价不大。
| int Diag_cuSolver_gvd::Dngvd_double(int N, int M, double *A, double *B, double *W, double *V){ | ||
|
|
||
| copy_double(N, M, A, B); | ||
| buffer_double(); |
There was a problem hiding this comment.
这步有办法只做第一次吗,后面只需要判断形状是否与之前一致,一致就不重复做,否则销毁d_work并重新做
There was a problem hiding this comment.
补充一下,这个我评论错了,需要改在source/src_pdiag/diag_cusolver.cu里,而不是这个为了测试而存在的文件里,需要特别注意
There was a problem hiding this comment.
cusolverDnDsygvd_bufferSize不清楚内部机制,不能确定是否一致。
| } | ||
| int Diag_cuSolver_gvd::Dngvd_double(int N, int M, double *A, double *B, double *W, double *V){ | ||
|
|
||
| copy_double(N, M, A, B); |
There was a problem hiding this comment.
我建议copy和recopy用上CHECK_CUDA宏之后,可以直接把代码写在这个函数里,加上一行注释即可,不需要单独的类方法。
There was a problem hiding this comment.
compute也是,核心只有一个cusolverDnDsygvd调用和一个sync,足够简短可以写到这个函数里面来
| } | ||
|
|
||
|
|
||
| void Diag_cuSolver_gvd::finalize(){ |
There was a problem hiding this comment.
和析构函数合并起来吧,看起来并没有除了析构以外的逻辑会调用它
| double eig[dim]; // reference | ||
|
|
||
| // construct the matrix A and B w.r.t the problem Ax = \lambda Bx | ||
| for (int i = 0; i < dim*dim; i++) a[i] = {1, 0}; |
There was a problem hiding this comment.
Have added to test complex_2.
|
|
||
| # compile the test executable | ||
| file(GLOB TEST_SRC | ||
| ../../source/module_cusolver/test/cusolver_test.cpp |
There was a problem hiding this comment.
我在测试的cpp文件内以及这里都没有看到对CUDA_LCAO或者MPI宏的判断,我觉得至少应该加在某处?
There was a problem hiding this comment.
考虑到单元测试的独立性,如果要分开测,可以在file(GLOB TEST_SRC单列cusolver_test.cpp或mpi.cpp
d83df2b to
a19a372
Compare
fix : UT for diago_cg.cpp and diago_david.cpp should not depend on __CUDA and __ROCM
1. change HONG in Makefile
* fix : when input structure doesn't have most symmetry rotation matrix, ABACUS will print which structure is better and then using the input structure for calculating. * perf : add warning output for symmetry searching part; modified tests/integral/207_NO_DP_OD/result.ref to correct version. * fix : UT for diago_cg.cpp and diago_david.cpp should not depend on __CUDA and __ROCM * fix : support both element magnetization and atomic magnetization for initial * add 304_NO_GO_AF_atommag case for testing initial atomic magnetization
fix : support both element magnetization and atomic magnetization for initial setting in STRU file
…eepmodeling#120) * fix : when input structure doesn't have most symmetry rotation matrix, ABACUS will print which structure is better and then using the input structure for calculating. * perf : add warning output for symmetry searching part; modified tests/integral/207_NO_DP_OD/result.ref to correct version. * fix : UT for diago_cg.cpp and diago_david.cpp should not depend on __CUDA and __ROCM * fix : support both element magnetization and atomic magnetization for initial * add 304_NO_GO_AF_atommag case for testing initial atomic magnetization Co-authored-by: Chun Cai <amoycaic@gmail.com>
synchronization between abacusmodeling and deepmodeling abacus-develop/develop branch
range: source/src_pw/test/diago_david_test.cpp
1. update Makefile.system and Makefile.vars
test(Parallel): add UT of `split_diag_world` and `split_grid_world`
added test case for DeePKS multi-k band gap label
gint : removed obsolete code; implement new gamma force & stress
Fix: not using `DM[is]` when no atom found on grid
fix: Add the support to the multiple line heading in pseudopotential.
test(parallel): UT of methods in parallel_kpoints
Merge LCAO-refactor into develop

Internal review version