From d15a21fe1d53567db62fd29e03c0d17d93b1b9ae Mon Sep 17 00:00:00 2001 From: Lorenzo <79980269+bastonero@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:48:35 +0100 Subject: [PATCH 1/2] Tests: bump SSSP version to 1.3 and update regression (#65) As aiida-quantumespresso v4.5, the default version for SSSP in protocol has been bumped to SSSP/1.3/PBEsol/efficiency. Moreover, additional inputs now appear by default in testing, such as the missing `max_iterations`. We follow by simply updating the tests accordingly. --- tests/conftest.py | 2 +- tests/workflows/protocols/test_hubbard/test_default.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 31950db..84a2943 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -168,7 +168,7 @@ def sssp(aiida_profile, generate_upf_data): 'cutoff_rho': 240.0, } - label = 'SSSP/1.2/PBEsol/efficiency' + label = 'SSSP/1.3/PBEsol/efficiency' family = SsspFamily.create_from_folder(dirpath, label) family.set_cutoffs(cutoffs, stringency, unit='Ry') diff --git a/tests/workflows/protocols/test_hubbard/test_default.yml b/tests/workflows/protocols/test_hubbard/test_default.yml index 4f6c380..1cb0c65 100644 --- a/tests/workflows/protocols/test_hubbard/test_default.yml +++ b/tests/workflows/protocols/test_hubbard/test_default.yml @@ -26,6 +26,7 @@ relax: base: kpoints_distance: 0.15 kpoints_force_parity: false + max_iterations: 5 pw: code: test.quantumespresso.pw@localhost metadata: @@ -33,6 +34,7 @@ relax: max_wallclock_seconds: 43200 resources: num_machines: 1 + num_mpiprocs_per_machine: 1 withmpi: true parameters: CELL: @@ -65,6 +67,7 @@ relax: scf: kpoints_distance: 0.4 kpoints_force_parity: false + max_iterations: 5 pw: code: test.quantumespresso.pw@localhost metadata: @@ -72,6 +75,7 @@ scf: max_wallclock_seconds: 43200 resources: num_machines: 1 + num_mpiprocs_per_machine: 1 withmpi: true parameters: CONTROL: From 8aec5dcd1d98a3ef2c1d771145da1a467442c660 Mon Sep 17 00:00:00 2001 From: Lorenzo <79980269+bastonero@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:58:29 +0100 Subject: [PATCH 2/2] HpParser: fix q-points/atoms output corner case The current raw output parser would miss some corner cases, when lots of q-points are generated and the number has no more any space left from the parenthesis. The solution is to use a more general regex search. As a sanity check, also the perturbed atom number sites regex search is changed correspondingly. --- src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py | 4 ++-- .../hp/initialization_only_mesh_more_points/aiida.out | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py b/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py index 5041839..96b5a4e 100644 --- a/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py +++ b/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py @@ -31,13 +31,13 @@ def parse_raw_output(stdout): detect_important_message(logs, line) # A calculation that will only perturb a single atom will only print one line - match = re.search(r'.*The grid of q-points.*\s+([0-9]+)+\s+q-points.*', line) + match = re.search(r'.*The grid of q-points.*?(\d+)+\s+q-points.*', line) if match: parsed_data['number_of_qpoints'] = int(match.group(1)) # Determine the atomic sites that will be perturbed, or that the calculation expects # to have been calculated when post-processing the final matrices - match = re.search(r'.*List of\s+([0-9]+)\s+atoms which will be perturbed.*', line) + match = re.search(r'.*List of.*?(\d+)\s+atoms which will be perturbed.*', line) if match: hubbard_sites = {} number_of_perturbed_atoms = int(match.group(1)) diff --git a/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out b/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out index a5b4b02..dc3e095 100644 --- a/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out +++ b/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out @@ -167,7 +167,7 @@ Changing the type of the perturbed atom back to its original type... - The grid of q-points ( 4, 4, 4) ( 18 q-points ) : + The grid of q-points ( 4, 4, 4) (18 q-points ) : N xq(1) xq(2) xq(3) wq 1 0.000000000 0.000000000 0.000000000 0.015625000 2 0.000000000 0.216131358 -0.211002628 0.062500000