Skip to content

Commit 0b250ad

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into HSolver
2 parents 98c5f03 + 51bdbe3 commit 0b250ad

Some content is hidden

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

76 files changed

+281
-5125
lines changed

.github/workflows/cuda.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,27 @@ jobs:
4646
cmake --install build
4747
cmake -B build -DBUILD_TESTING=ON
4848
cmake --build build -j4 --target hsolver_diago
49-
- name: Test
49+
- name: Test e2e
5050
run: |
5151
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
5252
cd tests/integrate
5353
echo "ks_solver cusolver" >> ./270_NO_MD_2O/INPUT
54-
./Autotest.sh -r 270_NO_MD_2O
55-
cd ../../source/src_pdiag/test/
54+
./Autotest.sh -r 270_NO_MD_2O
55+
- name: Test UT
56+
run: |
57+
cd source/src_pdiag/test/
5658
cp ../../../build/source/src_pdiag/test/hsolver_diago .
5759
./hsolver_diago
5860
bash diago_parallel_test.sh
61+
- name: Test performance
62+
run: |
63+
cd examples/performance
64+
ls -d P1*lcao* > allcase
65+
sed -i '/ks_solver/d' P1*lcao*/INPUT
66+
sed -i '$a ks_solver cusolver' P1*lcao*/INPUT
67+
bash run.sh
68+
cat sumall.dat
69+
5970
6071
stop-runner:
6172
name: Stop self-hosted EC2 runner

.github/workflows/image.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Build Image
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches:
6-
- develop
7-
6+
tags:
7+
- 'v*'
88
jobs:
99
build_container_and_push:
1010
runs-on: ubuntu-latest
@@ -13,6 +13,15 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515

16+
- name: Docker meta
17+
id: meta
18+
uses: docker/metadata-action@v4
19+
with:
20+
images: |
21+
ghcr.io/${{ github.repository_owner }}
22+
${{ secrets.DP_HARBOR_REGISTRY }}/dplc
23+
tags: type=semver,pattern={{version}}
24+
1625
- name: Setup Docker Buildx
1726
uses: docker/setup-buildx-action@v1
1827

@@ -33,10 +42,6 @@ jobs:
3342
- name: Build and Push Container
3443
uses: docker/build-push-action@v2
3544
with:
36-
tags: |
37-
ghcr.io/${{ github.repository_owner }}/abacus:latest
38-
${{ secrets.DP_HARBOR_REGISTRY }}/dplc/abacus:latest
45+
tags: ${{ steps.meta.outputs.tags }}
3946
file: Dockerfile
40-
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/abacus:latest
41-
cache-to: type=inline
42-
push: true
47+
push: ${{ github.event_name == 'push' }}

docs/input-main.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ This part of variables are used to control the molecular dynamics calculations.
11141114
11151115
- **Type**: Double
11161116
- **Description**: This is the time step(fs) used in md simulation .
1117-
- **Default**: 1
1117+
- **Default**: 1.0
11181118
11191119
#### md_tfirst & md_tlast
11201120
@@ -1178,31 +1178,31 @@ temperature will fluctuate violently; if it is too small, the temperature will t
11781178
11791179
- **Type**: Real
11801180
- **Description**: the velocity of shock wave ($\AA$/fs) for MSST.
1181-
- **Default**: 0
1181+
- **Default**: 0.0
11821182
11831183
#### msst_vis
11841184
11851185
- **Type**: Real
11861186
- **Description**: artificial viscosity (mass/length/time) for MSST.
1187-
- **Default**: 0
1187+
- **Default**: 0.0
11881188
11891189
#### msst_tscale
11901190
11911191
- **Type**: Real
11921192
- **Description**: reduction in initial temperature (0~1) used to compress volume in MSST.
1193-
- **Default**: 0
1193+
- **Default**: 0.01
11941194
11951195
#### msst_qmass
11961196
1197-
- **Type**: Double
1197+
- **Type**: Real
11981198
- **Description**: Inertia of extended system variable. Used only when md_type is 4, you should set a number which is larger than 0. Note that Qmass of NHC is set by md_tfreq.
11991199
- **Default**: No default
12001200
12011201
#### md_damp
12021202
12031203
- **Type**: Real
12041204
- **Description**: damping parameter (fs) used to add force in Langevin method.
1205-
- **Default**: 1
1205+
- **Default**: 1.0
12061206
12071207
### DFT+U correction
12081208

source/input.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@ bool Input::Read(const std::string &fn)
15911591
while (ifs.good())
15921592
{
15931593
ifs >> word1;
1594+
if(ifs.eof() != 0) break;
15941595
strtolower(word1, word); // convert uppercase std::string to lower case; word1 --> word
15951596

15961597
if (strcmp("dftu_type", word) == 0)
@@ -2358,6 +2359,26 @@ void Input::Check(void)
23582359
ModuleBase::WARNING_QUIT("Input::Check", "temperature of MD calculation should be set!");
23592360
if (mdp.md_tlast < 0.0)
23602361
mdp.md_tlast = mdp.md_tfirst;
2362+
2363+
if(mdp.md_tfreq == 0)
2364+
{
2365+
mdp.md_tfreq = 1.0/40.0/mdp.md_dt;
2366+
}
2367+
if(mdp.md_restart)
2368+
{
2369+
init_vel = 1;
2370+
}
2371+
if(mdp.md_ensolver == "LJ" || mdp.md_ensolver == "DP" || mdp.md_type == 4)
2372+
{
2373+
cal_stress = 1;
2374+
}
2375+
if(mdp.md_type == 4)
2376+
{
2377+
if(mdp.msst_qmass <= 0)
2378+
{
2379+
ModuleBase::WARNING_QUIT("Input::Check", "msst_qmass must be greater than 0!");
2380+
}
2381+
}
23612382
// if(mdp.md_tfirst!=mdp.md_tlast)
23622383
// {
23632384
// std::ifstream file1;

source/module_cell/atom_pseudo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Atom_pseudo::Atom_pseudo()
66
pseudo_fn = "not_init";
77
mass = 0.0;
88

9-
for(int is=0;is<4;is++) this->index1_soc[is] = new int[1];
10-
for(int is=0;is<4;is++) this->index2_soc[is] = new int[1];
9+
for(int is=0;is<4;is++) this->index1_soc[is] = nullptr;
10+
for(int is=0;is<4;is++) this->index2_soc[is] = nullptr;
1111

1212
}
1313

source/module_cell/pseudo_nc.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ pseudo_nc::pseudo_nc()
44
{
55
// pseudo_h
66
els = new std::string[1];
7-
lchi = new int[1];
8-
oc = new double[1];
9-
jjj = new double[1];
10-
jchi = new double[1];
11-
nn = new int[1];
7+
lchi = nullptr;
8+
oc = nullptr;
9+
jjj = nullptr;
10+
jchi = nullptr;
11+
nn = nullptr;
1212
has_so = false;
1313
zv = 0;
1414

1515
// pseudo local parts
16-
vloc_at = new double[1];
16+
vloc_at = nullptr;
1717

1818
// pseudo_atom
19-
r = new double[1];
20-
rab = new double[1];
21-
rho_at = new double[1];
22-
rho_atc = new double[1];
19+
r = nullptr;
20+
rab = nullptr;
21+
rho_at = nullptr;
22+
rho_atc = nullptr;
2323

2424
// pseudo_nc
25-
lll = new int[1];
25+
lll = nullptr;
2626
}
2727

2828
pseudo_nc::~pseudo_nc()

source/module_cell/read_pp.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ using namespace std;
1212
Pseudopot_upf::Pseudopot_upf()
1313
{
1414
this->els = new std::string[1];
15-
this->lchi = new int[1];
16-
this->oc = new double[1];
15+
this->lchi = nullptr;
16+
this->oc = nullptr;
1717

18-
this->r = new double[1];
19-
this->rab = new double[1];
20-
this->vloc = new double[1];
18+
this->r = nullptr;
19+
this->rab = nullptr;
20+
this->vloc = nullptr;
2121

22-
this->kkbeta = new int[1];
23-
this->lll = new int[1];
22+
this->kkbeta = nullptr;
23+
this->lll = nullptr;
2424

25-
this->rho_at = new double[1];
26-
this->rho_atc = new double[1];
25+
this->rho_at = nullptr;
26+
this->rho_atc = nullptr;
2727

28-
this->nn = new int[1];//zhengdy-soc
29-
this->jchi = new double[1];
30-
this->jjj = new double[1];
28+
this->nn = nullptr;//zhengdy-soc
29+
this->jchi = nullptr;
30+
this->jjj = nullptr;
3131

3232
functional_error = 0;//xiaohui add 2015-03-24
3333
}

source/module_cell/read_pp_blps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ int Pseudopot_upf::read_pseudo_blps(std::ifstream &ifs)
99
this->nbeta = 0;
1010
delete[] kkbeta;
1111
delete[] lll;
12-
this->kkbeta = new int[1];
13-
this->lll = new int[1];
12+
this->kkbeta = nullptr;
13+
this->lll = nullptr;
1414
this->beta.create(1, 1);
1515
this->dion.create(1, 1);
1616

source/module_cell/read_pp_upf100.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ void Pseudopot_upf::read_pseudo_nl(std::ifstream &ifs)
281281
{
282282
delete[] kkbeta;
283283
delete[] lll;
284-
this->kkbeta = new int[1];
285-
this->lll = new int[1];
284+
this->kkbeta = nullptr;
285+
this->lll = nullptr;
286286
this->beta.create(1, 1);
287287
this->dion.create(1, 1);
288288
return;

source/module_cell/setup_nonlocal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
InfoNonlocal::InfoNonlocal()
1111
{
1212
this->Beta = new Numerical_Nonlocal[1];
13-
this->nproj = new int[1];
13+
this->nproj = nullptr;
1414
this->nprojmax = 0;
1515
this->rcutmax_Beta = 0.0;
1616
}

0 commit comments

Comments
 (0)