Skip to content

Commit 0a91426

Browse files
authored
fix(input): constrain diag_subspace availability (deepmodeling#7835)
Co-authored-by: Stardust0831 <169599847+Stardust0831@users.noreply.github.com>
1 parent 258314a commit 0a91426

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@
10061006
### diag_subspace
10071007

10081008
- **Type**: Integer
1009+
- **Availability**: *[`basis_type`](#basis_type)==pw and [`ks_solver`](#ks_solver)==dav_subspace*
10091010
- **Description**: The method to diagonalize subspace in dav_subspace method.
10101011
- 0: by LAPACK
10111012
- 1: by GenELPA

docs/parameters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ parameters:
428428
* 2: by ScaLAPACK
429429
default_value: "0"
430430
unit: ""
431-
availability: ""
431+
availability: basis_type==pw and ks_solver==dav_subspace
432432
- name: erf_ecut
433433
category: Plane wave related variables
434434
type: Real

source/source_io/module_parameter/read_inp_sys.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ Available options are:
11781178
* 1: by GenELPA
11791179
* 2: by ScaLAPACK)";
11801180
item.default_value = "0";
1181+
item.set_availability("basis_type==pw and ks_solver==dav_subspace");
11811182
read_sync_int(input.diag_subspace);
11821183
this->add_item(item);
11831184
}

source/source_io/test_serial/read_input_item_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,10 @@ TEST_F(InputTest, Item_test2)
19901990
output = testing::internal::GetCapturedStdout();
19911991
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
19921992
}
1993+
{ // diag_subspace
1994+
auto it = find_label("diag_subspace", readinput.input_lists);
1995+
EXPECT_EQ(it->second.get_availability(), "basis_type==pw and ks_solver==dav_subspace");
1996+
}
19931997
{ // md_nstep
19941998
auto it = find_label("md_nstep", readinput.input_lists);
19951999
param.input.mdp.md_nstep = 0;

0 commit comments

Comments
 (0)