Skip to content

Commit a1dce8e

Browse files
authored
Merge branch 'develop' into delete-paw
2 parents 8b8c17a + f158182 commit a1dce8e

File tree

239 files changed

+1098
-880
lines changed

Some content is hidden

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

239 files changed

+1098
-880
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,41 @@ jobs:
4949
cmake --build build -j8
5050
cmake --install build
5151
52-
- name: Integrated Test
52+
- name: Integrated Tests Preparation
5353
env:
5454
GTEST_COLOR: 'yes'
5555
OMP_NUM_THREADS: '2'
5656
run: |
5757
cmake --build build --target test ARGS="-V --timeout 1700 -R integrated_test"
5858
59+
- name: Module_Base Unittests
60+
env:
61+
GTEST_COLOR: 'yes'
62+
OMP_NUM_THREADS: '2'
63+
run: |
64+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"
65+
66+
- name: Module_IO Unittests
67+
env:
68+
GTEST_COLOR: 'yes'
69+
OMP_NUM_THREADS: '2'
70+
run: |
71+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_IO"
72+
73+
- name: Module_HSolver Unittests
74+
env:
75+
GTEST_COLOR: 'yes'
76+
OMP_NUM_THREADS: '2'
77+
run: |
78+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_HSOLVER"
79+
80+
- name: Module_Cell Unittests
81+
env:
82+
GTEST_COLOR: 'yes'
83+
OMP_NUM_THREADS: '2'
84+
run: |
85+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL"
86+
5987
- name: 01_PW Test
6088
env:
6189
GTEST_COLOR: 'yes'
@@ -126,35 +154,7 @@ jobs:
126154
run: |
127155
cmake --build build --target test ARGS="-V --timeout 1700 -R 10_others"
128156
129-
- name: Module Base Unit Test
130-
env:
131-
GTEST_COLOR: 'yes'
132-
OMP_NUM_THREADS: '2'
133-
run: |
134-
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"
135-
136-
- name: Module IO Unit Test
137-
env:
138-
GTEST_COLOR: 'yes'
139-
OMP_NUM_THREADS: '2'
140-
run: |
141-
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_IO"
142-
143-
- name: Module HSolver Unit Test
144-
env:
145-
GTEST_COLOR: 'yes'
146-
OMP_NUM_THREADS: '2'
147-
run: |
148-
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_HSOLVER"
149-
150-
- name: Module Cell Unit Test
151-
env:
152-
GTEST_COLOR: 'yes'
153-
OMP_NUM_THREADS: '2'
154-
run: |
155-
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL"
156-
157-
- name: Other Unit Tests
157+
- name: Other Unittests
158158
env:
159159
GTEST_COLOR: 'yes'
160160
OMP_NUM_THREADS: '2'

docs/advanced/input_files/input-main.md

Lines changed: 59 additions & 56 deletions
Large diffs are not rendered by default.

source/Makefile.Objects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ OBJS_IO=input_conv.o\
561561
read_set_globalv.o\
562562
orb_io.o\
563563
cal_pLpR.o\
564+
filename.o\
564565

565566
OBJS_IO_LCAO=cal_r_overlap_R.o\
566567
write_orb_info.o\

source/module_elecstate/module_charge/charge_init.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,16 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
240240
{
241241
ModuleBase::WARNING_QUIT("Charge::init_rho", "wfc is only supported for PW-KSDFT.");
242242
}
243+
243244
const ModulePW::PW_Basis_K* pw_wfc = reinterpret_cast<ModulePW::PW_Basis_K*>(const_cast<void*>(wfcpw));
244245
const K_Vectors* kv = reinterpret_cast<const K_Vectors*>(klist);
245-
const int nkstot = kv->get_nkstot();
246-
const std::vector<int>& isk = kv->isk;
247-
ModuleIO::read_wf2rho_pw(pw_wfc, symm, kv->ik2iktot.data(), nkstot, isk, *this);
246+
247+
ModuleIO::read_wf2rho_pw(pw_wfc, symm, *this,
248+
PARAM.globalv.global_readin_dir,
249+
GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::MY_RANK,
250+
GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL,
251+
PARAM.inp.nbands, PARAM.inp.nspin, PARAM.globalv.npol,
252+
kv->get_nkstot(),kv->ik2iktot,kv->isk,GlobalV::ofs_running);
248253
}
249254
}
250255

source/module_esolver/esolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ std::string determine_type()
9696
ModuleBase::WARNING_QUIT("ESolver", "No such esolver_type combined with basis_type");
9797
}
9898

99-
GlobalV::ofs_running << "\n The esolver type: " << esolver_type << std::endl;
99+
GlobalV::ofs_running << "\n Energy Solver:" << esolver_type << std::endl;
100100

101101
auto device_info = PARAM.inp.device;
102102

source/module_esolver/esolver_ks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void ESolver_KS<T, Device>::before_all_runners(UnitCell& ucell, const Input_para
5555
ESolver_FP::before_all_runners(ucell, inp);
5656

5757
classname = "ESolver_KS";
58-
basisname = "PLEASE ADD BASISNAME FOR CURRENT ESOLVER.";
58+
basisname = "";
5959

6060
scf_thr = PARAM.inp.scf_thr;
6161
scf_ene_thr = PARAM.inp.scf_ene_thr;

source/module_esolver/esolver_ks_lcaopw.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "module_io/nscf_band.h"
66
#include "module_io/output_log.h"
77
#include "module_io/write_istate_info.h"
8-
#include "module_io/write_wfc_pw.h"
98

109
#include <iostream>
1110

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -645,15 +645,14 @@ void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int
645645
//----------------------------------------------------------
646646
// 3) Print out electronic wavefunctions in pw basis
647647
//----------------------------------------------------------
648-
if (PARAM.inp.out_wfc_pw == 1 || PARAM.inp.out_wfc_pw == 2)
649-
{
650-
if (iter % PARAM.inp.out_freq_elec == 0 || iter == PARAM.inp.scf_nmax || conv_esolver)
651-
{
652-
std::stringstream ssw;
653-
ssw << PARAM.globalv.global_out_dir << "WAVEFUNC";
654-
ModuleIO::write_wfc_pw(ssw.str(), this->psi[0], this->kv, this->pw_wfc);
655-
}
656-
}
648+
if (iter % PARAM.inp.out_freq_elec == 0 || iter == PARAM.inp.scf_nmax || conv_esolver)
649+
{
650+
ModuleIO::write_wfc_pw(GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::MY_RANK,
651+
PARAM.inp.nbands, PARAM.inp.nspin, PARAM.globalv.npol,
652+
GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL,
653+
PARAM.inp.out_wfc_pw, PARAM.inp.ecutwfc, PARAM.globalv.global_out_dir,
654+
this->psi[0], this->kv, this->pw_wfc, GlobalV::ofs_running);
655+
}
657656

658657
//----------------------------------------------------------
659658
// 4) check if oscillate for delta_spin method
@@ -707,17 +706,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
707706
}
708707

709708
//------------------------------------------------------------------
710-
// 4) output wavefunctions in pw basis
711-
//------------------------------------------------------------------
712-
if (PARAM.inp.out_wfc_pw == 1 || PARAM.inp.out_wfc_pw == 2)
713-
{
714-
std::stringstream ssw;
715-
ssw << PARAM.globalv.global_out_dir << "WAVEFUNC";
716-
ModuleIO::write_wfc_pw(ssw.str(), this->psi[0], this->kv, this->pw_wfc);
717-
}
718-
719-
//------------------------------------------------------------------
720-
// 5) calculate band-decomposed (partial) charge density in pw basis
709+
// 4) calculate band-decomposed (partial) charge density in pw basis
721710
//------------------------------------------------------------------
722711
const std::vector<int> out_pchg = PARAM.inp.out_pchg;
723712
if (out_pchg.size() > 0)
@@ -745,8 +734,16 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
745734
PARAM.inp.if_separate_k);
746735
}
747736

737+
738+
// tmp 2025-05-17, mohan note
739+
ModuleIO::write_wfc_pw(GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::MY_RANK,
740+
PARAM.inp.nbands, PARAM.inp.nspin, PARAM.globalv.npol,
741+
GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL,
742+
PARAM.inp.out_wfc_pw, PARAM.inp.ecutwfc, PARAM.globalv.global_out_dir,
743+
this->psi[0], this->kv, this->pw_wfc, GlobalV::ofs_running);
744+
748745
//------------------------------------------------------------------
749-
//! 6) calculate Wannier functions in pw basis
746+
//! 5) calculate Wannier functions in pw basis
750747
//------------------------------------------------------------------
751748
if (PARAM.inp.calculation == "nscf" && PARAM.inp.towannier90)
752749
{
@@ -764,7 +761,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
764761
}
765762

766763
//------------------------------------------------------------------
767-
//! 7) calculate Berry phase polarization in pw basis
764+
//! 6) calculate Berry phase polarization in pw basis
768765
//------------------------------------------------------------------
769766
if (PARAM.inp.calculation == "nscf" && berryphase::berry_phase_flag && ModuleSymmetry::Symmetry::symm_flag != 1)
770767
{
@@ -775,7 +772,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
775772
}
776773

777774
//------------------------------------------------------------------
778-
// 8) write spin constrian results in pw basis
775+
// 7) write spin constrian results in pw basis
779776
// spin constrain calculations, write atomic magnetization and magnetic force.
780777
//------------------------------------------------------------------
781778
if (PARAM.inp.sc_mag_switch)
@@ -787,7 +784,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
787784
}
788785

789786
//------------------------------------------------------------------
790-
// 9) write onsite occupations for charge and magnetizations
787+
// 8) write onsite occupations for charge and magnetizations
791788
//------------------------------------------------------------------
792789
if (PARAM.inp.onsite_radius > 0)
793790
{ // float type has not been implemented

source/module_esolver/pw_others.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "module_io/nscf_band.h"
77
#include "module_io/output_log.h"
88
#include "module_io/write_istate_info.h"
9-
#include "module_io/write_wfc_pw.h"
109

1110
#include <iostream>
1211

source/module_io/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ list(APPEND objects
3333
para_json.cpp
3434
parse_args.cpp
3535
orb_io.cpp
36+
filename.cpp
3637
)
3738

3839
list(APPEND objects_advanced

0 commit comments

Comments
 (0)