Commit b1ef5b11 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added the program name and compilation host.

parent 62c3d6ad
......@@ -40,7 +40,7 @@ class CommonMatcher(object):
'x_cp2k_atoms': CachingLevel.ForwardAndCache,
'section_XC_functionals': CachingLevel.ForwardAndCache,
'self_interaction_correction_method': CachingLevel.Cache,
'x_cp2k_section_programinformation': CachingLevel.ForwardAndCache,
'x_cp2k_section_program_information': CachingLevel.ForwardAndCache,
'x_cp2k_section_quickstep_settings': CachingLevel.ForwardAndCache,
'x_cp2k_section_atomic_kind': CachingLevel.ForwardAndCache,
'x_cp2k_section_kind_basis_set': CachingLevel.ForwardAndCache,
......@@ -92,15 +92,15 @@ class CommonMatcher(object):
]
),
SM( " CP2K\| version string:",
sections=['x_cp2k_section_programinformation'],
sections=['x_cp2k_section_program_information'],
forwardMatch=True,
subMatchers=[
SM( " CP2K\| version string:\s+(?P<program_version>{})".format(self.regex_eol)),
SM( " CP2K\| source code revision number:\s+svn:(?P<x_cp2k_svn_revision>\d+)"),
SM( " CP2K\| is freely available from{}".format(self.regex_word)),
SM( " CP2K\| Program compiled at{}".format(self.regex_word)),
SM( " CP2K\| Program compiled on{}".format(self.regex_word)),
SM( " CP2K\| Program compiled for{}".format(self.regex_word)),
SM( " CP2K\| is freely available from{}".format(self.regex_eol)),
SM( " CP2K\| Program compiled at\s+(?P<x_cp2k_program_compilation_datetime>{})".format(self.regex_eol)),
SM( " CP2K\| Program compiled on\s+(?P<program_compilation_host>{})".format(self.regex_eol)),
SM( " CP2K\| Program compiled for{}".format(self.regex_eol)),
SM( " CP2K\| Input file name\s+(?P<x_cp2k_input_filename>{})".format(self.regex_eol)),
]
),
......@@ -346,6 +346,9 @@ class CommonMatcher(object):
except:
pass
def onClose_section_run(self, backend, gIndex, section):
backend.addValue("program_name", "CP2K")
def onClose_x_cp2k_section_quickstep_settings(self, backend, gIndex, section):
backend.addValue("program_basis_set_type", "gaussian")
backend.addValue("electronic_structure_method", self.test_electronic_structure_method)
......@@ -383,7 +386,7 @@ class CommonMatcher(object):
backend.closeSection("section_basis_set_atom_centered", basisID)
backend.closeSection("section_method_atom_kind", kindID)
def onClose_x_cp2k_section_programinformation(self, backend, gIndex, section):
def onClose_x_cp2k_section_program_information(self, backend, gIndex, section):
input_file = section.get_latest_value("x_cp2k_input_filename")
self.file_service.set_file_id(input_file, "input")
......
......@@ -281,6 +281,14 @@ class TestEnergyForce(unittest.TestCase):
expected_result = convert_unit(np.array(-32.2320848878), "hartree")
self.assertTrue(np.array_equal(result[0], expected_result))
def test_program_name(self):
result = self.results["program_name"]
self.assertEqual(result, "CP2K")
def test_program_compilation_host(self):
result = self.results["program_compilation_host"]
self.assertEqual(result, "lenovo700")
def test_scf_max_iteration(self):
result = self.results["scf_max_iteration"]
self.assertEqual(result, 300)
......@@ -1024,19 +1032,19 @@ if __name__ == '__main__':
suites = []
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
alltests = unittest.TestSuite(suites)
unittest.TextTestRunner(verbosity=0).run(alltests)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment