From 0c404eebf397c1755d10373aa038abe42129332d Mon Sep 17 00:00:00 2001 From: linpz Date: Sun, 3 Apr 2022 16:40:09 +0800 Subject: [PATCH 1/4] 1. change HONG in Makefile 2. add global_function_ddotreal.o in Makefile.Objects --- source/Makefile | 4 ++-- source/Makefile.Objects | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Makefile b/source/Makefile index 1c9fbde912..21740cf414 100644 --- a/source/Makefile +++ b/source/Makefile @@ -48,8 +48,8 @@ HONG_MEM = ${HONG_FFTW} -D__FP -D_MCD_CHECK -DWIN32 -DMCD_VERBOSE #!!!!!!!!!!!!!!!!!!!! CHANE HERE IF YOU LIKE !!!!!!!!!!!!!! #! change series version or parallel version~~~ -#HONG=${HONG_MPI_SELINV_20210523} -HONG=${HONG_SER_SELINV} +HONG=${HONG_MPI_SELINV_20210523} +#HONG=${HONG_SER_SELINV} #!!!!!!!!!!!!!!!!!!!! CHANE HERE IF YOU LIKE !!!!!!!!!!!!!! #========================== diff --git a/source/Makefile.Objects b/source/Makefile.Objects index ecc360ec64..083889788a 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -87,6 +87,7 @@ sph_bessel_recursive-d1.o \ sph_bessel_recursive-d2.o \ global_variable.o \ global_function.o \ +global_function_ddotreal.o \ tool_title.o\ tool_quit.o\ tool_check.o\ From c41a3251263c4e7e2a46f23a188261992b06b22e Mon Sep 17 00:00:00 2001 From: dyzheng <49852742+dyzheng@users.noreply.github.com> Date: Sun, 3 Apr 2022 16:42:45 +0800 Subject: [PATCH 2/4] update symmetry debug from deepmodeling (#117) * 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. --- source/module_symmetry/symmetry.cpp | 53 +++++++++++++++-------- source/module_symmetry/symmetry.h | 1 + source/module_symmetry/symmetry_basic.cpp | 28 +++++++----- source/module_symmetry/symmetry_basic.h | 4 ++ tests/integrate/207_NO_KP_OD/result.ref | 4 +- 5 files changed, 60 insertions(+), 30 deletions(-) diff --git a/source/module_symmetry/symmetry.cpp b/source/module_symmetry/symmetry.cpp index 5397295d13..d93b53686c 100644 --- a/source/module_symmetry/symmetry.cpp +++ b/source/module_symmetry/symmetry.cpp @@ -127,7 +127,7 @@ void Symmetry::analy_sys(const UnitCell_pseudo &ucell, std::ofstream &ofs_runnin new_lat.e11=a1.x; new_lat.e12=a1.y; new_lat.e13=a1.z; new_lat.e21=a2.x; new_lat.e22=a2.y; new_lat.e23=a2.z; new_lat.e31=a3.x; new_lat.e32=a3.y; new_lat.e33=a3.z; - output::printM3(ofs_running,"STANDARD LATTICE VECTORS: (CARTESIAN COORDINATE: IN UNIT OF A0)",new_lat); + //output::printM3(ofs_running,"STANDARD LATTICE VECTORS: (CARTESIAN COORDINATE: IN UNIT OF A0)",new_lat); int iat=0; for(int it=0; itchange_lattice(); //this->pricell(); // pengfei Li 2018-05-14 //for( iat =0 ; iat < ucell.nat ; iat++) // std::cout << " newpos_now = " << newpos[3*iat] << " " << newpos[3*iat+1] << " " << newpos[3*iat+2] << std::endl; - ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",ibrav); - this->setgroup(this->symop, this->nop, this->ibrav); - //now select all symmetry operations which reproduce the lattice - //to find those symmetry operations which reproduce the entire crystal - this->getgroup(this->nrot, this->nrotk, ofs_running); - // find the name of point group - this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running); - ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname); - //write(); + test_brav = true; // output the real ibrav and point group + ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",real_brav); + this->setgroup(this->symop, this->nop, this->real_brav); + this->getgroup(this->nrot, this->nrotk, ofs_running); + this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running); + ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname); + ofs_running<<"Warning : If the optimal symmetric configuration is not the input configuration, "<<'\n'; + ofs_running<<"you have to manually change configurations, ABACUS would only calculate the input structure!"<<'\n'; + + test_brav = false; // use the input ibrav to calculate + //ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",ibrav); + this->setgroup(this->symop, this->nop, this->ibrav); + //now select all symmetry operations which reproduce the lattice + //to find those symmetry operations which reproduce the entire crystal + this->getgroup(this->nrot, this->nrotk, ofs_running); + // find the name of point group + this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running); + // ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname); + //write(); delete[] dirpos; delete[] newpos; @@ -705,6 +715,7 @@ void Symmetry::lattice_type( // GlobalV::ofs_running << " pre_brav=" << pre_brav << std::endl; // GlobalV::ofs_running << " temp_brav=" << temp_brav << std::endl; + if ( temp_brav < pre_brav) { //if the symmetry of the new vectors is higher, store the new ones @@ -771,7 +782,6 @@ void Symmetry::lattice_type( } } ofs.close(); - } @@ -811,9 +821,12 @@ void Symmetry::lattice_type( } }*/ brav = pre_brav; - bravname = get_brav_name(brav); + //brav = temp_brav; + //bravname = get_brav_name(brav); + real_brav = temp_brav; // pengfei Li 15-3-2022 + bravname = get_brav_name(real_brav); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS TYPE",brav); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS TYPE",real_brav); ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS LATTICE NAME",bravname); return; } @@ -1209,8 +1222,12 @@ void Symmetry::getgroup(int &nrot, int &nrotk, std::ofstream &ofs_running) //total number of space group operations //----------------------------------------------------- nrotk += nrot; - ModuleBase::GlobalFunc::OUT(ofs_running,"PURE POINT GROUP OPERATIONS",nrot); - ModuleBase::GlobalFunc::OUT(ofs_running,"SPACE GROUP OPERATIONS",nrotk); + + if(test_brav) + { + ModuleBase::GlobalFunc::OUT(ofs_running,"PURE POINT GROUP OPERATIONS",nrot); + ModuleBase::GlobalFunc::OUT(ofs_running,"SPACE GROUP OPERATIONS",nrotk); + } //----------------------------------------------------- //fill the rest of matrices and vectors with zeros @@ -1775,4 +1792,4 @@ void Symmetry::print_pos(const double* pos, const int &nat) } return; } -} \ No newline at end of file +} diff --git a/source/module_symmetry/symmetry.h b/source/module_symmetry/symmetry.h index 52893aa160..6c9ebefc7c 100644 --- a/source/module_symmetry/symmetry.h +++ b/source/module_symmetry/symmetry.h @@ -50,6 +50,7 @@ class Symmetry : public Symmetry_Basic int sym_test; int pbrav; int ibrav; + int real_brav; // the real ibrav for the cell pengfei Li 3-15-2022 std::string ilattname; //the bravais lattice type of the supercell std::string plattname; //the bravais lattice type of the primitive cell diff --git a/source/module_symmetry/symmetry_basic.cpp b/source/module_symmetry/symmetry_basic.cpp index 04ce843ea4..e07177234f 100644 --- a/source/module_symmetry/symmetry_basic.cpp +++ b/source/module_symmetry/symmetry_basic.cpp @@ -6,6 +6,7 @@ //#include "../src_pw/global.h" #include "../module_base/mymath.h" //#include "symm_other.h" +bool ModuleSymmetry::test_brav = 0; namespace ModuleSymmetry { @@ -811,7 +812,11 @@ void Symmetry_Basic::setgroup(ModuleBase::Matrix3* symop, int &nop, const int &i this->matrigen(symgen, 3, symop, nop); } - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"ROTATION MATRICES",nop); + if(test_brav) + { + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"ROTATION MATRICES",nop); + } + if(GlobalV::test_symmetry > 1) { GlobalV::ofs_running<<" THERE ARE " << nop << " ROTATION MATRICES FOR THE PURE BRAVAIS LATTICE"< Date: Tue, 5 Apr 2022 22:43:14 +0800 Subject: [PATCH 3/4] fix bug: initial magnetization method (#119) * 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 --- source/module_cell/read_atoms.cpp | 3 +- source/src_pw/charge.cpp | 10 +++--- source/src_pw/test/CMakeLists.txt | 2 ++ tests/integrate/304_NO_GO_AF/jd | 1 + tests/integrate/304_NO_GO_AF_atommag/INPUT | 34 +++++++++++++++++++ tests/integrate/304_NO_GO_AF_atommag/KPT | 4 +++ tests/integrate/304_NO_GO_AF_atommag/STRU | 29 ++++++++++++++++ tests/integrate/304_NO_GO_AF_atommag/jd | 1 + .../integrate/304_NO_GO_AF_atommag/result.ref | 3 ++ tests/integrate/CASES | 1 + 10 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 tests/integrate/304_NO_GO_AF/jd create mode 100644 tests/integrate/304_NO_GO_AF_atommag/INPUT create mode 100644 tests/integrate/304_NO_GO_AF_atommag/KPT create mode 100644 tests/integrate/304_NO_GO_AF_atommag/STRU create mode 100644 tests/integrate/304_NO_GO_AF_atommag/jd create mode 100644 tests/integrate/304_NO_GO_AF_atommag/result.ref diff --git a/source/module_cell/read_atoms.cpp b/source/module_cell/read_atoms.cpp index 6e924b3203..195f5fdc52 100644 --- a/source/module_cell/read_atoms.cpp +++ b/source/module_cell/read_atoms.cpp @@ -589,7 +589,7 @@ bool UnitCell_pseudo::read_atom_positions(std::ifstream &ifpos, std::ofstream &o mv.z = true ; atoms[it].vel[ia].set(0,0,0); #ifndef __CMD - //atoms[it].mag[ia]=magnet.start_magnetization[it];//if this line is used, default startmag_type would be 2 + atoms[it].mag[ia]=magnet.start_magnetization[it];//if this line is used, default startmag_type would be 2 #endif atoms[it].angle1[ia]=0; atoms[it].angle2[ia]=0; @@ -633,7 +633,6 @@ bool UnitCell_pseudo::read_atom_positions(std::ifstream &ifpos, std::ofstream &o tmp=ifpos.get(); } - cout<<"tmp"<= 48 && tmp <= 57) or tmp=='-') { ifpos.putback(tmp); diff --git a/source/src_pw/charge.cpp b/source/src_pw/charge.cpp index 527a966933..26544901cb 100644 --- a/source/src_pw/charge.cpp +++ b/source/src_pw/charge.cpp @@ -212,13 +212,11 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const // Pe // check the start magnetization const int startmag_type = [&]()->int { - if(GlobalV::NSPIN==4) //zhengdy-soc, type 2 is still wrong. - return 1; for(int it=0; it Date: Wed, 6 Apr 2022 17:13:06 +0800 Subject: [PATCH 4/4] merge deepmodeling/abacus-develop/develop branch with develop branch (#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