From 0003a3bfc2aa6b22466d6680a15173c87a275313 Mon Sep 17 00:00:00 2001 From: bastonero Date: Mon, 25 Mar 2024 09:11:05 +0000 Subject: [PATCH 1/8] `PhCalculation`: add symmetry related exit codes Fixes #1001 Some symmetry errors that ph.x can stop with are added. They are related to how the PHonon code handles internally symmetry, which unfortunately is slightly different from the PW code, which is used as a necessary previous step to run ph.x. This is generally due to some interal hard-coded thresholds. The solution is generally to run pw.x by specifying the ibrav, instead of the general ibrav=0. This cannot be handled though, as it would require to re-run the pw.x code. --- src/aiida_quantumespresso/calculations/ph.py | 5 + src/aiida_quantumespresso/parsers/ph.py | 2 + .../DYN_MAT/.gitignore | 0 .../ph/failed_incompatible_fft/aiida.out | 95 +++++++++++++++++++ .../DYN_MAT/.gitignore | 0 .../ph/failed_wrong_representation/aiida.out | 95 +++++++++++++++++++ tests/parsers/test_ph.py | 32 ++++++- 7 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore create mode 100644 tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out create mode 100644 tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore create mode 100644 tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index 356580cd8..4f1cdba47 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -72,6 +72,11 @@ def define(cls, spec): message='The stdout output file was incomplete probably because the calculation got interrupted.') spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') + spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', + message='The FFT grid is incompatible with the detected symmetries. Try using the correct ibrav.') + spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', + message=('The representation found seems to be wrong according to the detected symmetries. ' + 'Try using the correct ibrav.')) # Significant errors but calculation can be used to restart spec.exit_code(400, 'ERROR_OUT_OF_WALLTIME', diff --git a/src/aiida_quantumespresso/parsers/ph.py b/src/aiida_quantumespresso/parsers/ph.py index 8f3946e30..636b3695b 100644 --- a/src/aiida_quantumespresso/parsers/ph.py +++ b/src/aiida_quantumespresso/parsers/ph.py @@ -18,6 +18,8 @@ class PhParser(BaseParser): class_error_map = { 'No convergence has been achieved': 'ERROR_CONVERGENCE_NOT_REACHED', 'problems computing cholesky': 'ERROR_COMPUTING_CHOLESKY', + 'FFT grid incompatible with symmetry': 'ERROR_INCOMPATIBLE_FFT_GRID', + 'wrong representation': 'ERROR_WRONG_REPRESENTATION', } def parse(self, **kwargs): diff --git a/tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore b/tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out b/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out new file mode 100644 index 000000000..e94c4a4c8 --- /dev/null +++ b/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out @@ -0,0 +1,95 @@ + + Program PHONON v.6.3MaX starts on 9Aug2019 at 12:13:51 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + *** WARNING: using old-style file format, will disappear from next version *** + + Serial version + Title line not specified: using 'default'. + Message from routine phq_readin: + iverbosity is obsolete, use "verbosity" instead + + Reading data from directory: + ./out/aiida.save + Message from routine volume: + axis vectors are left-handed + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + + G-vector sticks info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Sum 859 433 127 16889 5985 965 + + 3 / 3 q-points for this run, from 1 to 3: + N xq(1) xq(2) xq(3) + 1 0.000000000 0.000000000 0.000000000 + 2 0.353553391 -0.353553391 -0.353553391 + 3 0.000000000 0.000000000 -0.707106781 + + + Calculation of q = 0.0000000 0.0000000 0.0000000 + + Restart in Phonon calculation + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.2558 a.u. + unit-cell volume = 270.1072 (a.u.)^3 + number of atoms/cell = 2 + number of atomic types = 1 + kinetic-energy cut-off = 30.0000 Ry + charge density cut-off = 240.0000 Ry + convergence threshold = 1.0E-12 + beta = 0.7000 + number of iterations used = 4 + Exchange-correlation = PBE ( 1 4 3 4 0 0) + + + celldm(1)= 7.25577 celldm(2)= 0.00000 celldm(3)= 0.00000 + celldm(4)= 0.00000 celldm(5)= 0.00000 celldm(6)= 0.00000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.7071 0.7071 0.0000 ) + a(2) = ( 0.7071 0.0000 0.7071 ) + a(3) = ( 0.0000 0.7071 0.7071 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.7071 0.7071 -0.7071 ) + b(2) = ( 0.7071 -0.7071 0.7071 ) + b(3) = ( -0.7071 0.7071 0.7071 ) + + + Atoms inside the unit cell: + + Cartesian axes + + site n. atom mass positions (alat units) + 1 Si 28.0855 tau( 1) = ( 0.00000 0.00000 0.00000 ) + 2 Si 28.0855 tau( 2) = ( 0.35355 0.35355 0.35355 ) + + Computing dynamical matrix for + q = ( 0.0000000 0.0000000 0.0000000 ) + + 49 Sym.Ops. (with q -> -q+G ) + + s frac. trans. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Error in routine phq_setup (1): + FFT grid incompatible with symmetry + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + stopping ... diff --git a/tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore b/tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out b/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out new file mode 100644 index 000000000..f349cd7b7 --- /dev/null +++ b/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out @@ -0,0 +1,95 @@ + + Program PHONON v.6.3MaX starts on 9Aug2019 at 12:13:51 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + *** WARNING: using old-style file format, will disappear from next version *** + + Serial version + Title line not specified: using 'default'. + Message from routine phq_readin: + iverbosity is obsolete, use "verbosity" instead + + Reading data from directory: + ./out/aiida.save + Message from routine volume: + axis vectors are left-handed + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + + G-vector sticks info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Sum 859 433 127 16889 5985 965 + + 3 / 3 q-points for this run, from 1 to 3: + N xq(1) xq(2) xq(3) + 1 0.000000000 0.000000000 0.000000000 + 2 0.353553391 -0.353553391 -0.353553391 + 3 0.000000000 0.000000000 -0.707106781 + + + Calculation of q = 0.0000000 0.0000000 0.0000000 + + Restart in Phonon calculation + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.2558 a.u. + unit-cell volume = 270.1072 (a.u.)^3 + number of atoms/cell = 2 + number of atomic types = 1 + kinetic-energy cut-off = 30.0000 Ry + charge density cut-off = 240.0000 Ry + convergence threshold = 1.0E-12 + beta = 0.7000 + number of iterations used = 4 + Exchange-correlation = PBE ( 1 4 3 4 0 0) + + + celldm(1)= 7.25577 celldm(2)= 0.00000 celldm(3)= 0.00000 + celldm(4)= 0.00000 celldm(5)= 0.00000 celldm(6)= 0.00000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.7071 0.7071 0.0000 ) + a(2) = ( 0.7071 0.0000 0.7071 ) + a(3) = ( 0.0000 0.7071 0.7071 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.7071 0.7071 -0.7071 ) + b(2) = ( 0.7071 -0.7071 0.7071 ) + b(3) = ( -0.7071 0.7071 0.7071 ) + + + Atoms inside the unit cell: + + Cartesian axes + + site n. atom mass positions (alat units) + 1 Si 28.0855 tau( 1) = ( 0.00000 0.00000 0.00000 ) + 2 Si 28.0855 tau( 2) = ( 0.35355 0.35355 0.35355 ) + + Computing dynamical matrix for + q = ( 0.0000000 0.0000000 0.0000000 ) + + 49 Sym.Ops. (with q -> -q+G ) + + s frac. trans. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Error in routine set_irr_sym_new (311): + wrong representation + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + stopping ... diff --git a/tests/parsers/test_ph.py b/tests/parsers/test_ph.py index 25a5a64fc..49d4a9a40 100644 --- a/tests/parsers/test_ph.py +++ b/tests/parsers/test_ph.py @@ -61,7 +61,7 @@ def test_ph_out_of_walltime(fixture_localhost, generate_calc_job_node, generate_ data_regression.check(results['output_parameters'].get_dict()) -def test_pw_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, generate_parser): +def test_ph_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, generate_parser): """Test the parsing of a calculation that failed during cholesky factorization. In this test the stdout is incomplete, and the XML is missing completely. The stdout contains @@ -78,3 +78,33 @@ def test_pw_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, assert calcfunction.is_finished, calcfunction.exception assert calcfunction.is_failed, calcfunction.exit_status assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_COMPUTING_CHOLESKY.status + + +def test_ph_failed_incompatible_fft(fixture_localhost, generate_calc_job_node, generate_parser): + """Test the parsing of a calculation that failed finding an incompatible FFT grid.""" + name = 'failed_incompatible_fft' + entry_point_calc_job = 'quantumespresso.ph' + entry_point_parser = 'quantumespresso.ph' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, name, generate_inputs()) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_INCOMPATIBLE_FFT_GRID.status + + +def test_ph_failed_wrong_representation(fixture_localhost, generate_calc_job_node, generate_parser): + """Test the parsing of a calculation that failed finding a wrong representation.""" + name = 'failed_wrong_representation' + entry_point_calc_job = 'quantumespresso.ph' + entry_point_parser = 'quantumespresso.ph' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, name, generate_inputs()) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_WRONG_REPRESENTATION.status From 83375c9e89afadaa42245f3151440f75734291c4 Mon Sep 17 00:00:00 2001 From: Lorenzo <79980269+bastonero@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:16:41 +0100 Subject: [PATCH 2/8] Update src/aiida_quantumespresso/calculations/ph.py Co-authored-by: Marnik Bercx --- src/aiida_quantumespresso/calculations/ph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index 4f1cdba47..b55596302 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -73,7 +73,7 @@ def define(cls, spec): spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', - message='The FFT grid is incompatible with the detected symmetries. Try using the correct ibrav.') + message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific `ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' 'Try using the correct ibrav.')) From addb8eb457f158e93a8e216aa679e6c9e488f232 Mon Sep 17 00:00:00 2001 From: bastonero Date: Wed, 27 Mar 2024 13:30:01 +0000 Subject: [PATCH 3/8] Fix pre-commit --- src/aiida_quantumespresso/calculations/ph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index b55596302..f5068dcf2 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -73,7 +73,8 @@ def define(cls, spec): spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', - message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific `ibrav` != 0 in the parent `pw.x` calculation.') + message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific ' + '`ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' 'Try using the correct ibrav.')) From 3c1f982b1012e29e209f4d52e6dfa4c38a4c9b36 Mon Sep 17 00:00:00 2001 From: bastonero Date: Mon, 25 Mar 2024 09:11:05 +0000 Subject: [PATCH 4/8] `PhCalculation`: add symmetry related exit codes Fixes #1001 Some symmetry errors that ph.x can stop with are added. They are related to how the PHonon code handles internally symmetry, which unfortunately is slightly different from the PW code, which is used as a necessary previous step to run ph.x. This is generally due to some interal hard-coded thresholds. The solution is generally to run pw.x by specifying the ibrav, instead of the general ibrav=0. This cannot be handled though, as it would require to re-run the pw.x code. --- src/aiida_quantumespresso/calculations/ph.py | 5 + src/aiida_quantumespresso/parsers/ph.py | 2 + .../DYN_MAT/.gitignore | 0 .../ph/failed_incompatible_fft/aiida.out | 95 +++++++++++++++++++ .../DYN_MAT/.gitignore | 0 .../ph/failed_wrong_representation/aiida.out | 95 +++++++++++++++++++ tests/parsers/test_ph.py | 32 ++++++- 7 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore create mode 100644 tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out create mode 100644 tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore create mode 100644 tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index 356580cd8..4f1cdba47 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -72,6 +72,11 @@ def define(cls, spec): message='The stdout output file was incomplete probably because the calculation got interrupted.') spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') + spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', + message='The FFT grid is incompatible with the detected symmetries. Try using the correct ibrav.') + spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', + message=('The representation found seems to be wrong according to the detected symmetries. ' + 'Try using the correct ibrav.')) # Significant errors but calculation can be used to restart spec.exit_code(400, 'ERROR_OUT_OF_WALLTIME', diff --git a/src/aiida_quantumespresso/parsers/ph.py b/src/aiida_quantumespresso/parsers/ph.py index 8f3946e30..636b3695b 100644 --- a/src/aiida_quantumespresso/parsers/ph.py +++ b/src/aiida_quantumespresso/parsers/ph.py @@ -18,6 +18,8 @@ class PhParser(BaseParser): class_error_map = { 'No convergence has been achieved': 'ERROR_CONVERGENCE_NOT_REACHED', 'problems computing cholesky': 'ERROR_COMPUTING_CHOLESKY', + 'FFT grid incompatible with symmetry': 'ERROR_INCOMPATIBLE_FFT_GRID', + 'wrong representation': 'ERROR_WRONG_REPRESENTATION', } def parse(self, **kwargs): diff --git a/tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore b/tests/parsers/fixtures/ph/failed_incompatible_fft/DYN_MAT/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out b/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out new file mode 100644 index 000000000..e94c4a4c8 --- /dev/null +++ b/tests/parsers/fixtures/ph/failed_incompatible_fft/aiida.out @@ -0,0 +1,95 @@ + + Program PHONON v.6.3MaX starts on 9Aug2019 at 12:13:51 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + *** WARNING: using old-style file format, will disappear from next version *** + + Serial version + Title line not specified: using 'default'. + Message from routine phq_readin: + iverbosity is obsolete, use "verbosity" instead + + Reading data from directory: + ./out/aiida.save + Message from routine volume: + axis vectors are left-handed + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + + G-vector sticks info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Sum 859 433 127 16889 5985 965 + + 3 / 3 q-points for this run, from 1 to 3: + N xq(1) xq(2) xq(3) + 1 0.000000000 0.000000000 0.000000000 + 2 0.353553391 -0.353553391 -0.353553391 + 3 0.000000000 0.000000000 -0.707106781 + + + Calculation of q = 0.0000000 0.0000000 0.0000000 + + Restart in Phonon calculation + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.2558 a.u. + unit-cell volume = 270.1072 (a.u.)^3 + number of atoms/cell = 2 + number of atomic types = 1 + kinetic-energy cut-off = 30.0000 Ry + charge density cut-off = 240.0000 Ry + convergence threshold = 1.0E-12 + beta = 0.7000 + number of iterations used = 4 + Exchange-correlation = PBE ( 1 4 3 4 0 0) + + + celldm(1)= 7.25577 celldm(2)= 0.00000 celldm(3)= 0.00000 + celldm(4)= 0.00000 celldm(5)= 0.00000 celldm(6)= 0.00000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.7071 0.7071 0.0000 ) + a(2) = ( 0.7071 0.0000 0.7071 ) + a(3) = ( 0.0000 0.7071 0.7071 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.7071 0.7071 -0.7071 ) + b(2) = ( 0.7071 -0.7071 0.7071 ) + b(3) = ( -0.7071 0.7071 0.7071 ) + + + Atoms inside the unit cell: + + Cartesian axes + + site n. atom mass positions (alat units) + 1 Si 28.0855 tau( 1) = ( 0.00000 0.00000 0.00000 ) + 2 Si 28.0855 tau( 2) = ( 0.35355 0.35355 0.35355 ) + + Computing dynamical matrix for + q = ( 0.0000000 0.0000000 0.0000000 ) + + 49 Sym.Ops. (with q -> -q+G ) + + s frac. trans. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Error in routine phq_setup (1): + FFT grid incompatible with symmetry + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + stopping ... diff --git a/tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore b/tests/parsers/fixtures/ph/failed_wrong_representation/DYN_MAT/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out b/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out new file mode 100644 index 000000000..f349cd7b7 --- /dev/null +++ b/tests/parsers/fixtures/ph/failed_wrong_representation/aiida.out @@ -0,0 +1,95 @@ + + Program PHONON v.6.3MaX starts on 9Aug2019 at 12:13:51 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + *** WARNING: using old-style file format, will disappear from next version *** + + Serial version + Title line not specified: using 'default'. + Message from routine phq_readin: + iverbosity is obsolete, use "verbosity" instead + + Reading data from directory: + ./out/aiida.save + Message from routine volume: + axis vectors are left-handed + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + + G-vector sticks info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Sum 859 433 127 16889 5985 965 + + 3 / 3 q-points for this run, from 1 to 3: + N xq(1) xq(2) xq(3) + 1 0.000000000 0.000000000 0.000000000 + 2 0.353553391 -0.353553391 -0.353553391 + 3 0.000000000 0.000000000 -0.707106781 + + + Calculation of q = 0.0000000 0.0000000 0.0000000 + + Restart in Phonon calculation + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.2558 a.u. + unit-cell volume = 270.1072 (a.u.)^3 + number of atoms/cell = 2 + number of atomic types = 1 + kinetic-energy cut-off = 30.0000 Ry + charge density cut-off = 240.0000 Ry + convergence threshold = 1.0E-12 + beta = 0.7000 + number of iterations used = 4 + Exchange-correlation = PBE ( 1 4 3 4 0 0) + + + celldm(1)= 7.25577 celldm(2)= 0.00000 celldm(3)= 0.00000 + celldm(4)= 0.00000 celldm(5)= 0.00000 celldm(6)= 0.00000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.7071 0.7071 0.0000 ) + a(2) = ( 0.7071 0.0000 0.7071 ) + a(3) = ( 0.0000 0.7071 0.7071 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.7071 0.7071 -0.7071 ) + b(2) = ( 0.7071 -0.7071 0.7071 ) + b(3) = ( -0.7071 0.7071 0.7071 ) + + + Atoms inside the unit cell: + + Cartesian axes + + site n. atom mass positions (alat units) + 1 Si 28.0855 tau( 1) = ( 0.00000 0.00000 0.00000 ) + 2 Si 28.0855 tau( 2) = ( 0.35355 0.35355 0.35355 ) + + Computing dynamical matrix for + q = ( 0.0000000 0.0000000 0.0000000 ) + + 49 Sym.Ops. (with q -> -q+G ) + + s frac. trans. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Error in routine set_irr_sym_new (311): + wrong representation + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + stopping ... diff --git a/tests/parsers/test_ph.py b/tests/parsers/test_ph.py index 25a5a64fc..49d4a9a40 100644 --- a/tests/parsers/test_ph.py +++ b/tests/parsers/test_ph.py @@ -61,7 +61,7 @@ def test_ph_out_of_walltime(fixture_localhost, generate_calc_job_node, generate_ data_regression.check(results['output_parameters'].get_dict()) -def test_pw_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, generate_parser): +def test_ph_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, generate_parser): """Test the parsing of a calculation that failed during cholesky factorization. In this test the stdout is incomplete, and the XML is missing completely. The stdout contains @@ -78,3 +78,33 @@ def test_pw_failed_computing_cholesky(fixture_localhost, generate_calc_job_node, assert calcfunction.is_finished, calcfunction.exception assert calcfunction.is_failed, calcfunction.exit_status assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_COMPUTING_CHOLESKY.status + + +def test_ph_failed_incompatible_fft(fixture_localhost, generate_calc_job_node, generate_parser): + """Test the parsing of a calculation that failed finding an incompatible FFT grid.""" + name = 'failed_incompatible_fft' + entry_point_calc_job = 'quantumespresso.ph' + entry_point_parser = 'quantumespresso.ph' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, name, generate_inputs()) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_INCOMPATIBLE_FFT_GRID.status + + +def test_ph_failed_wrong_representation(fixture_localhost, generate_calc_job_node, generate_parser): + """Test the parsing of a calculation that failed finding a wrong representation.""" + name = 'failed_wrong_representation' + entry_point_calc_job = 'quantumespresso.ph' + entry_point_parser = 'quantumespresso.ph' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, name, generate_inputs()) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_WRONG_REPRESENTATION.status From 071fd3a97572d55d36839a8ae43f8b06f8edaaa1 Mon Sep 17 00:00:00 2001 From: Lorenzo <79980269+bastonero@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:16:41 +0100 Subject: [PATCH 5/8] Update src/aiida_quantumespresso/calculations/ph.py Co-authored-by: Marnik Bercx --- src/aiida_quantumespresso/calculations/ph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index 4f1cdba47..b55596302 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -73,7 +73,7 @@ def define(cls, spec): spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', - message='The FFT grid is incompatible with the detected symmetries. Try using the correct ibrav.') + message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific `ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' 'Try using the correct ibrav.')) From 10a88e4a489d6bcfdac9f6ca7ff16e6a9e777c03 Mon Sep 17 00:00:00 2001 From: bastonero Date: Wed, 27 Mar 2024 13:30:01 +0000 Subject: [PATCH 6/8] Fix pre-commit --- src/aiida_quantumespresso/calculations/ph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index b55596302..f5068dcf2 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -73,7 +73,8 @@ def define(cls, spec): spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', message='The parser raised an unexpected exception: {exception}') spec.exit_code(360, 'ERROR_INCOMPATIBLE_FFT_GRID', - message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific `ibrav` != 0 in the parent `pw.x` calculation.') + message='The FFT grid is incompatible with the detected symmetries. Try using the lattice-specific ' + '`ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' 'Try using the correct ibrav.')) From aa456ffdbb1c78800e89e538b44f84dd8a11dfd9 Mon Sep 17 00:00:00 2001 From: bastonero Date: Wed, 27 Mar 2024 14:08:12 +0000 Subject: [PATCH 7/8] Fix line --- src/aiida_quantumespresso/calculations/ph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index f5068dcf2..6d4ff1d2c 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -77,7 +77,7 @@ def define(cls, spec): '`ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' - 'Try using the correct ibrav.')) + 'Try using the lattice-specific ibrav` != 0 in the parent `pw.x` calculation.')) # Significant errors but calculation can be used to restart spec.exit_code(400, 'ERROR_OUT_OF_WALLTIME', From 29a6b12ee448813a79895187d7c96f6ec329b28b Mon Sep 17 00:00:00 2001 From: bastonero Date: Wed, 27 Mar 2024 14:14:49 +0000 Subject: [PATCH 8/8] Fix `ibrav` with correct ` --- src/aiida_quantumespresso/calculations/ph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/ph.py b/src/aiida_quantumespresso/calculations/ph.py index 6d4ff1d2c..114a191b1 100644 --- a/src/aiida_quantumespresso/calculations/ph.py +++ b/src/aiida_quantumespresso/calculations/ph.py @@ -77,7 +77,7 @@ def define(cls, spec): '`ibrav` != 0 in the parent `pw.x` calculation.') spec.exit_code(361, 'ERROR_WRONG_REPRESENTATION', message=('The representation found seems to be wrong according to the detected symmetries. ' - 'Try using the lattice-specific ibrav` != 0 in the parent `pw.x` calculation.')) + 'Try using the lattice-specific `ibrav` != 0 in the parent `pw.x` calculation.')) # Significant errors but calculation can be used to restart spec.exit_code(400, 'ERROR_OUT_OF_WALLTIME',