Skip to content

Commit ca23d11

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into HSolver
2 parents 32742e0 + d46607c commit ca23d11

File tree

146 files changed

+1402
-776
lines changed

Some content is hidden

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

146 files changed

+1402
-776
lines changed

docs/input-main.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
- [Molecular dynamics](#molecular-dynamics)
5050

51-
[md_type](#md-type) | [md_nstep](#md_nstep) | [md_ensolver](#md-ensolver) | [md_restart](#md-restart) | [md_dt](#md-dt) | [md_t](#md-t) | [md_dumpfreq](#md-dumpfreq) | [md_restartfreq](#md-restartfreq) | [md_tfreq](#md-tfreq) | [md_mnhc](#md-mnhc) | [lj_rcut](#lj-rcut) | [lj_epsilon](#lj-epsilon) | [lj_sigma](#lj-sigma) | [msst_direction](#msst-direction) | [msst_vel](#msst-vel) | [msst_vis](#msst-vis) | [msst_tscale](#msst-tscale) | [msst_qmass](#msst-qmass) | [md_damp](#md-damp)
51+
[md_type](#md-type) | [md_nstep](#md_nstep) | [md_ensolver](#md-ensolver) | [md_restart](#md-restart) | [md_dt](#md-dt) | [md_t](#md-t) | [md_dumpfreq](#md-dumpfreq) | [md_restartfreq](#md-restartfreq) | [md_seed](#md-seed) | [md_tfreq](#md-tfreq) | [md_mnhc](#md-mnhc) | [lj_rcut](#lj-rcut) | [lj_epsilon](#lj-epsilon) | [lj_sigma](#lj-sigma) | [msst_direction](#msst-direction) | [msst_vel](#msst-vel) | [msst_vis](#msst-vis) | [msst_tscale](#msst-tscale) | [msst_qmass](#msst-qmass) | [md_damp](#md-damp)
5252

5353
- [vdW correction](#vdw-correction)
5454

@@ -1140,6 +1140,14 @@ This part of variables are used to control the molecular dynamics calculations.
11401140
- **Description**:This is the frequence to output restart information.
11411141
- **Default**: 5
11421142
1143+
#### md_seed
1144+
1145+
- **Type**: Integer
1146+
- **Description**:
1147+
- md_seed < 0: No srand() in MD initialization.
1148+
- md_seed >= 0: srand(md_seed) in MD initialization.
1149+
- **Default**: -1
1150+
11431151
#### md_tfreq
11441152
11451153
- **Type**: Real

examples/performance/sumdat.sh

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ for i in `cat $allcase`;do
3232
encut=`grep "energy cutoff for wavefunc" ${i}/OUT.*/running*|awk '{print $NF}'`
3333
kpt=`grep -A 1 "KPOINTS" ${i}/result.log | tail -1 | awk '{print $2}'`
3434
nproc=`grep -A 1 "KPOINTS" ${i}/result.log | tail -1 | awk '{print $3}'`
35-
niter=`sed -n '/ITER ETOT(eV)/,/><><><><>/'p ${i}/result.log | wc -l|awk '{print $1-2}'`
35+
niter=`grep "ELEC=" $i/OUT.*/running* | awk -F "=" '{print $3}'| awk -F "-" 'END{print $1}'`
3636
tottime=`awk '$1=="total"{printf"%.2f", $2}' ${i}/result.log`
37-
scf1=`grep -A 1 "ITER ETOT(eV)" ${i}/result.log | awk 'END{printf"%.2f", $NF}'`
37+
scf1=`awk '{if($1 ~ /^CG1$|^DAV1$|^GE1$|^GV1$/) {printf"%.2f", $NF}}' ${i}/result.log`
3838
totalscf=`awk '$2=="Run"{print $3}' ${i}/result.log`
39-
scfpiter=`awk -v a=$totalscf -v b=$scf1 -v c=$niter 'BEGIN{printf"%.2f",(a-b)/(c-1)}'`
39+
scfpiter=`awk 'BEGIN{printf"%.2f",(ARGV[1]-ARGV[2])/(ARGV[3]-1)}' $totalscf $scf1 $niter`
4040
#fft=`awk '$2=="FFT3D"{printf"%.1f",$6}' ${i}/result.log`
4141
hpsi=`awk '$2=="h_psi"{printf"%.1f",$6}' ${i}/result.log`
4242
vloc=`awk '$2=="vloc"{printf"%.1f",$6}' ${i}/result.log`
@@ -51,11 +51,11 @@ for i in `cat $allcase`;do
5151
encut=`grep "energy cutoff for wavefunc" ${i}/OUT.*/running*|awk '{print $NF}'`
5252
kpt=`grep -A 1 "KPOINTS" ${i}/result.log | tail -1 | awk '{print $2}'`
5353
nproc=`grep -A 1 "KPOINTS" ${i}/result.log | tail -1 | awk '{print $3}'`
54-
niter=`sed -n '/ITER ETOT(eV)/,/><><><><>/'p ${i}/result.log | wc -l|awk '{print $1-2}'`
54+
niter=`grep "ELEC=" $i/OUT.*/running* | awk -F "=" '{print $3}'| awk -F "-" 'END{print $1}'`
5555
tottime=`awk '$1=="total"{printf"%.2f", $2}' ${i}/result.log`
56-
scf1=`grep -A 1 "ITER ETOT(eV)" ${i}/result.log | awk 'END{printf"%.2f", $NF}'`
57-
totalscf=`awk '$1=="Run"{print $3}' ${i}/result.log`
58-
scfpiter=`awk -v a=$totalscf -v b=$scf1 -v c=$niter 'BEGIN{printf"%.2f",(a-b)/(c-1)}'`
56+
scf1=`awk '{if($1 ~ /^CG1$|^DAV1$|^GE1$|^GV1$/) {printf"%.2f", $NF}}' ${i}/result.log`
57+
totalscf=`awk '$2=="Run"{print $3}' ${i}/result.log`
58+
scfpiter=`awk 'BEGIN{printf"%.2f",(ARGV[1]-ARGV[2])/(ARGV[3]-1)}' $totalscf $scf1 $niter`
5959
#fft="-"
6060
hpsi="-"
6161
vloc=`awk '$2=="vlocal"{printf"%.1f",$6}' ${i}/result.log`
@@ -71,6 +71,23 @@ for i in `cat $allcase`;do
7171
fi
7272
maxres=`grep "Maximum resident set size" ${i}/time.log | awk '{print $NF}'`
7373

74+
if [[ $solver == "" ]]; then solver="-";fi
75+
if [[ $natoms == "" ]]; then natoms="-";fi
76+
if [[ $encut == "" ]]; then encut="-";fi
77+
if [[ $kpt == "" ]]; then kpt="-";fi
78+
if [[ $nproc == "" ]]; then nproc="-";fi
79+
if [[ $niter == "" ]]; then niter="-";fi
80+
if [[ $tottime == "" ]]; then tottime="-";fi
81+
if [[ $scf1 == "" ]]; then scf1="-";fi
82+
if [[ $scfpiter == "" ]]; then scfpiter="-";fi
83+
if [[ $sc == "" ]]; then sc="-";fi
84+
if [[ $hpsi == "" ]]; then hpsi="-";fi
85+
if [[ $vloc == "" ]]; then vloc="-";fi
86+
if [[ $vnl == "" ]]; then vnl="-";fi
87+
if [[ $stress == "" ]]; then stress="-";fi
88+
if [[ $force == "" ]]; then force="-";fi
89+
if [[ $maxres == "" ]]; then maxres="-";fi
90+
7491
printf "%20s %15s %7s %8s %8s %6s %6s %8s %8s %8s %8s %8s %8s %8s %8s %8s %s\n" \
7592
$i $solver $natoms $encut $kpt $nproc $niter $tottime $scf1 $scfpiter $sc $hpsi $vloc $vnl \
7693
$stress $force $maxres >> $outf

source/input.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,10 @@ bool Input::Read(const std::string &fn)
11151115
{
11161116
read_value(ifs, mdp.md_restartfreq);
11171117
}
1118+
else if (strcmp("md_seed", word) == 0)
1119+
{
1120+
read_value(ifs, mdp.md_seed);
1121+
}
11181122
else if (strcmp("md_restart", word) == 0)
11191123
{
11201124
read_value(ifs, mdp.md_restart);
@@ -2047,6 +2051,7 @@ void Input::Bcast()
20472051
Parallel_Common::bcast_double(mdp.md_tlast);
20482052
Parallel_Common::bcast_int(mdp.md_dumpfreq);
20492053
Parallel_Common::bcast_int(mdp.md_restartfreq);
2054+
Parallel_Common::bcast_int(mdp.md_seed);
20502055
Parallel_Common::bcast_bool(mdp.md_restart);
20512056
Parallel_Common::bcast_double(mdp.lj_rcut);
20522057
Parallel_Common::bcast_double(mdp.lj_epsilon);

source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
1515
DD.init();
1616

1717
#ifdef __MPI
18-
MPI_Finalize();
18+
Parallel_Global::finalize_mpi();
1919
#endif
2020

2121
return 0;

source/module_base/tool_quit.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ void QUIT(void)
5454
std::cout<<" See output information in : "<<GlobalV::global_out_dir<<std::endl;
5555
#endif
5656

57-
#ifdef __MPI
58-
MPI_Finalize();
59-
#endif
6057
exit(0);
6158
}
6259

source/module_elecstate/elecstate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ElecState
1212
{
1313
public:
1414
ElecState(){};
15+
virtual ~ElecState(){};
1516
virtual void init(Charge *chg_in, // pointer for class Charge
1617
const K_Vectors *klist_in,
1718
int nk_in, // number of k points

source/module_elecstate/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ AddTest(
2424
../../src_lcao/local_orbital_wfc.cpp
2525
../../module_gint/grid_technique.cpp ../../module_gint/grid_meshball.cpp ../../module_gint/grid_bigcell.cpp
2626
../../module_gint/grid_meshcell.cpp ../../module_gint/grid_meshk.cpp
27-
../../module_gint/gint_tools.cpp
28-
../../src_lcao/dm_2d.cpp
27+
../../module_gint/gint_tools.cpp ../../module_gint/gint_k_pvpr.cpp
28+
../../src_lcao/dm_2d.cpp ../../src_lcao/LCAO_matrix.cpp
2929
../../src_lcao/record_adj.cpp ../../src_lcao/LCAO_nnr.cpp
3030
../../module_gint/gint.cpp ../../module_gint/gint_gamma.cpp
3131
../../module_gint/gint_fvl.cpp ../../module_gint/gint_rho.cpp

source/module_gint/gint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void Gint::prep_grid(
208208
this->nbz_start = nbz_start_in;
209209
assert(nbx>0);
210210
assert(nby>0);
211-
assert(nbz>0);
211+
assert(nbz>=0);
212212
assert(ncxyz>0);
213213

214214
assert( GlobalC::ucell.omega > 0.0);

source/module_gint/gint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class Gint
133133
// dimension: [GlobalC::LNNR.nnrg]
134134
// save the < phi_0i | V | phi_Rj > in sparse H matrix.
135135
bool pvpR_alloc_flag = false;
136-
double** pvpR_reduced; //stores Hamiltonian in reduced format, for multi-l
136+
double** pvpR_reduced = nullptr; //stores Hamiltonian in reduced format, for multi-l
137137

138-
double* pvpR_grid; //stores Hamiltonian in grid format, for gamma-point
138+
double* pvpR_grid = nullptr; //stores Hamiltonian in grid format, for gamma-point
139139
};
140140

141141
#endif

source/module_gint/gint_k.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
class Gint_k : public Gint
1414
{
1515
public:
16-
16+
~Gint_k()
17+
{
18+
destroy_pvpR();
19+
}
1720
//------------------------------------------------------
1821
// in gint_k_pvpr.cpp
1922
//------------------------------------------------------

0 commit comments

Comments
 (0)