diff --git a/parser/parser-cpmd/cpmdparser/parser.py b/parser/parser-cpmd/cpmdparser/parser.py index 8f6ecd9ffa1e538d757c33594f526191a701cdc1..e1c0ab2c7768276c575f2f6aebbc1efd3f33ce81 100644 --- a/parser/parser-cpmd/cpmdparser/parser.py +++ b/parser/parser-cpmd/cpmdparser/parser.py @@ -8,6 +8,13 @@ from nomadcore.baseclasses import ParserInterface logger = logging.getLogger("nomad") +#=============================================================================== +class CPMDRunType(object): + def __init__(self, module_name, class_name): + self.module_name = module_name + self.class_name = class_name + + #=============================================================================== class CPMDParser(ParserInterface): """This class handles the initial setup before any parsing can happen. It @@ -17,8 +24,8 @@ class CPMDParser(ParserInterface): After the implementation has been setup, you can parse the files with parse(). """ - def __init__(self, main_file, metainfo_to_keep=None, backend=None, default_units=None, metainfo_units=None, debug=True, store=True): - super(CPMDParser, self).__init__(main_file, metainfo_to_keep, backend, default_units, metainfo_units, debug, store) + def __init__(self, main_file, metainfo_to_keep=None, backend=None, default_units=None, metainfo_units=None, debug=True, log_level=logging.ERROR, store=True): + super(CPMDParser, self).__init__(main_file, metainfo_to_keep, backend, default_units, metainfo_units, debug, log_level, store) def setup_version(self): """Setups the version by looking at the output file and the version @@ -28,19 +35,43 @@ class CPMDParser(ParserInterface): # calculation. The correct and optimized parser is initialized based on # this information. regex_version = re.compile("\s+VERSION ([\d\.]+)") - n_lines = 50 + regex_single_point = re.compile(r" SINGLE POINT DENSITY OPTIMIZATION") + regex_geo_opt = re.compile(r" OPTIMIZATION OF IONIC POSITIONS") + run_type = None + n_lines = 1000 version_id = None with open(self.parser_context.main_file, 'r') as outputfile: for i_line in range(n_lines): - line = next(outputfile) + try: + line = next(outputfile) + except StopIteration: + break + + # Look for version result_version = regex_version.match(line) if result_version: version_id = result_version.group(1).replace('.', '') + + # Look for geometry optimization + result_geo_opt = regex_geo_opt.match(line) + if result_geo_opt: + run_type = CPMDRunType(module_name="geooptparser", class_name="CPMDGeoOptParser") + + # Look for single point calculation + result_single_point = regex_single_point.match(line) + if result_single_point: + run_type = CPMDRunType(module_name="singlepointparser", class_name="CPMDSinglePointParser") + if version_id is None: msg = "Could not find a version specification from the given main file." logger.exception(msg) raise RuntimeError(msg) + if run_type is None: + msg = "Could not find a run type specification from the given main file." + logger.exception(msg) + raise RuntimeError(msg) + # Setup the root folder to the fileservice that is used to access files dirpath, filename = os.path.split(self.parser_context.main_file) dirpath = os.path.abspath(dirpath) @@ -49,7 +80,7 @@ class CPMDParser(ParserInterface): # Setup the correct main parser based on the version id. If no match # for the version is found, use the main parser for CP2K 2.6.2 - self.setup_main_parser(version_id) + self.setup_main_parser(version_id, run_type) def get_metainfo_filename(self): return "cpmd.nomadmetainfo.json" @@ -57,25 +88,25 @@ class CPMDParser(ParserInterface): def get_parser_info(self): return {'name': 'cpmd-parser', 'version': '1.0'} - def setup_main_parser(self, version_id): + def setup_main_parser(self, version_id, run_type): # Currently the version id is a pure integer, so it can directly be mapped # into a package name. - base = "cpmdparser.versions.cpmd{}.mainparser".format(version_id) + base = "cpmdparser.versions.cpmd{}.{}".format(version_id, run_type.module_name) parser_module = None parser_class = None try: parser_module = importlib.import_module(base) except ImportError: logger.warning("Could not find a parser for version '{}'. Trying to default to the base implementation for CPMD 4.1".format(version_id)) - base = "cpmdparser.versions.cp2k41.mainparser" + base = "cpmdparser.versions.cp2k41.{}".format(run_type.module_name) try: parser_module = importlib.import_module(base) except ImportError: logger.exception("Tried to default to the CPMD 4.1 implementation but could not find the correct module.") raise try: - parser_class = getattr(parser_module, "CPMDMainParser") + parser_class = getattr(parser_module, "{}".format(run_type.class_name)) except AttributeError: - logger.exception("A parser class 'CPMDMainParser' could not be found in the module '[]'.".format(parser_module)) + logger.exception("A parser class '{}' could not be found in the module '[]'.".format(run_type.class_name, parser_module)) raise self.main_parser = parser_class(self.parser_context.main_file, self.parser_context) diff --git a/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py b/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py index b398d1d64eba619d1e8737215ff8d3514f567264..5f2a581190e54fca12f9e9e97ad2a3c5aef807da 100644 --- a/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py +++ b/parser/parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py @@ -1,4 +1,10 @@ +import re +import logging +import datetime from nomadcore.baseclasses import CommonParser +from nomadcore.simple_parser import SimpleMatcher as SM +from .inputparser import CPMDInputParser +logger = logging.getLogger("nomad") #=============================================================================== @@ -11,6 +17,48 @@ class CPMDCommonParser(CommonParser): def __init__(self, parser_context): super(CPMDCommonParser, self).__init__(parser_context) + #=========================================================================== + # Common SimpleMatchers + def header(self): + """Returns the simplematcher that parser the CPMD header containng the + starting information. Common to all run types. + """ + return SM( " PROGRAM CPMD STARTED AT", + forwardMatch=True, + sections=["x_cpmd_section_start_information"], + subMatchers=[ + SM( " PROGRAM CPMD STARTED AT: (?P<x_cpmd_start_datetime>{})".format(self.regexs.regex_eol)), + SM( "\s+VERSION (?P<program_version>\d+\.\d+)"), + SM( r"\s+\*\*\* (?P<x_cpmd_compilation_date>[\s\w\-:\d]+) \*\*\*$"), + SM( " THE INPUT FILE IS:\s+(?P<x_cpmd_input_filename>{})".format(self.regexs.regex_eol)), + SM( " THIS JOB RUNS ON:\s+(?P<x_cpmd_run_host_name>{})".format(self.regexs.regex_eol)), + SM( " THE PROCESS ID IS:\s+(?P<x_cpmd_process_id>{})".format(self.regexs.regex_i)), + SM( " THE JOB WAS SUBMITTED BY:\s+(?P<x_cpmd_run_user_name>{})".format(self.regexs.regex_eol)), + ] + ) + + def footer(self): + """Returns the simplematcher that parser the CPMD footer containng the + ending information. Common to all run types. + """ + return SM( re.escape(" * TIMING *"), + forwardMatch=True, + subMatchers=[ + SM( re.escape(" * TIMING *"), + sections=["x_cpmd_section_timing"], + subMatchers=[ + ] + ), + SM( " CPU TIME :", + forwardMatch=True, + sections=["x_cpmd_section_end_information"], + subMatchers=[ + # SM( " PROGRAM CPMD STARTED AT: (?P<x_cpmd_start_datetime>{})".format(self.regexs.regex_eol)), + ] + ) + ] + ) + #=========================================================================== # onClose triggers def onClose_section_run(self, backend, gIndex, section): @@ -23,3 +71,54 @@ class CPMDCommonParser(CommonParser): backend.addValue("method_basis_set_kind", "wavefunction") backend.addValue("mapping_section_method_basis_set_cell_associated", 0) backend.closeSection("section_method_basis_set", basis_id) + + def onClose_x_cpmd_section_start_information(self, backend, gIndex, section): + # Starting date and time + start_datetime = section.get_latest_value("x_cpmd_start_datetime") + start_date_stamp, start_wall_time = self.timestamp_from_string(start_datetime) + backend.addValue("time_run_date_start", start_date_stamp) + backend.addValue("time_run_wall_start", start_wall_time) + + # Input file + input_filename = section.get_latest_value("x_cpmd_input_filename") + input_filepath = self.file_service.set_file_id(input_filename, "input") + if input_filepath is not None: + input_parser = CPMDInputParser(input_filepath, self.parser_context) + input_parser.parse() + else: + logger.warning("The input file for the calculation could not be found.") + + # Compilation date + date = section.get_latest_value("x_cpmd_compilation_date") + + #=========================================================================== + # Misc. functions + def timestamp_from_string(self, timestring): + + class UTCtzinfo(datetime.tzinfo): + """Class that represents the UTC timezone. + """ + ZERO = datetime.timedelta(0) + + def utcoffset(self, dt): + return UTCtzinfo.ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return UTCtzinfo.ZERO + + """Returns the seconds since epoch for the given date and the wall + clock seconds for the given wall clock time. Assumes UTC timezone. + """ + timestring = timestring.strip() + date, clock_time = timestring.split() + year, month, day = [int(x) for x in date.split("-")] + hour, minute, second, msec = [float(x) for x in re.split("[:.]", clock_time)] + + date_obj = datetime.datetime(year, month, day, tzinfo=UTCtzinfo()) + date_timestamp = (date_obj - datetime.datetime(1970, 1, 1, tzinfo=UTCtzinfo())).total_seconds() + + wall_time = hour*3600+minute*60+second+0.001*msec + return date_timestamp, wall_time diff --git a/parser/parser-cpmd/cpmdparser/versions/cpmd41/geooptparser.py b/parser/parser-cpmd/cpmdparser/versions/cpmd41/geooptparser.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/parser/parser-cpmd/cpmdparser/versions/cpmd41/mainparser.py b/parser/parser-cpmd/cpmdparser/versions/cpmd41/singlepointparser.py similarity index 82% rename from parser/parser-cpmd/cpmdparser/versions/cpmd41/mainparser.py rename to parser/parser-cpmd/cpmdparser/versions/cpmd41/singlepointparser.py index 21fa4870b9ef906b062140214db17159879afafe..1c56120418395a20aea823ab84910087055634af 100644 --- a/parser/parser-cpmd/cpmdparser/versions/cpmd41/mainparser.py +++ b/parser/parser-cpmd/cpmdparser/versions/cpmd41/singlepointparser.py @@ -4,23 +4,21 @@ from nomadcore.baseclasses import MainHierarchicalParser from nomadcore.unit_conversion.unit_conversion import convert_unit from nomadcore.caching_backend import CachingLevel from .commonparser import CPMDCommonParser -from .inputparser import CPMDInputParser import re import logging -import datetime import numpy as np logger = logging.getLogger("nomad") #=============================================================================== -class CPMDMainParser(MainHierarchicalParser): +class CPMDSinglePointParser(MainHierarchicalParser): """The main parser class that is called for all run types. Parses the CPMD output file. """ def __init__(self, file_path, parser_context): """ """ - super(CPMDMainParser, self).__init__(file_path, parser_context) + super(CPMDSinglePointParser, self).__init__(file_path, parser_context) self.setup_common_matcher(CPMDCommonParser(parser_context)) self.n_scf_iterations = 0 @@ -36,18 +34,7 @@ class CPMDMainParser(MainHierarchicalParser): forwardMatch=True, sections=['section_run', "section_single_configuration_calculation", "section_system", "section_method"], subMatchers=[ - SM( " PROGRAM CPMD STARTED AT", - forwardMatch=True, - sections=["x_cpmd_section_start_information"], - subMatchers=[ - SM( " PROGRAM CPMD STARTED AT: (?P<x_cpmd_start_datetime>{})".format(self.regexs.regex_eol)), - SM( "\s+VERSION (?P<program_version>\d+\.\d+)"), - SM( " THE INPUT FILE IS:\s+(?P<x_cpmd_input_filename>{})".format(self.regexs.regex_eol)), - SM( " THIS JOB RUNS ON:\s+(?P<x_cpmd_run_host_name>{})".format(self.regexs.regex_eol)), - SM( " THE PROCESS ID IS:\s+(?P<x_cpmd_process_id>{})".format(self.regexs.regex_i)), - SM( " THE JOB WAS SUBMITTED BY:\s+(?P<x_cpmd_run_user_name>{})".format(self.regexs.regex_eol)), - ] - ), + self.cm.header(), SM( " SINGLE POINT DENSITY OPTIMIZATION", sections=["x_cpmd_section_run_type_information"], subMatchers=[ @@ -150,38 +137,12 @@ class CPMDMainParser(MainHierarchicalParser): SM( " \(X\) EXCHANGE-CORRELATION ENERGY =\s+(?P<energy_XC_potential__hartree>{}) A\.U\.".format(self.regexs.regex_f)), ] ), - SM( re.escape(" * TIMING *"), - sections=["x_cpmd_section_timing"], - subMatchers=[ - ] - ), - SM( " CPU TIME :", - forwardMatch=True, - sections=["x_cpmd_section_end_information"], - subMatchers=[ - # SM( " PROGRAM CPMD STARTED AT: (?P<x_cpmd_start_datetime>{})".format(self.regexs.regex_eol)), - ] - ) + self.cm.footer(), ] ) #======================================================================= # onClose triggers - def onClose_x_cpmd_section_start_information(self, backend, gIndex, section): - # Starting date and time - start_datetime = section.get_latest_value("x_cpmd_start_datetime") - start_date_stamp, start_wall_time = self.timestamp_from_string(start_datetime) - backend.addValue("time_run_date_start", start_date_stamp) - backend.addValue("time_run_wall_start", start_wall_time) - - # Input file - input_filename = section.get_latest_value("x_cpmd_input_filename") - input_filepath = self.file_service.set_file_id(input_filename, "input") - if input_filepath is not None: - input_parser = CPMDInputParser(input_filepath, self.parser_context) - input_parser.parse() - else: - logger.warning("The input file for the calculation could not be found.") def onClose_x_cpmd_section_supercell(self, backend, gIndex, section): # Simulation cell @@ -304,37 +265,7 @@ class CPMDMainParser(MainHierarchicalParser): return wrapper #======================================================================= - # misc. functions - def timestamp_from_string(self, timestring): - - class UTCtzinfo(datetime.tzinfo): - """Class that represents the UTC timezone. - """ - ZERO = datetime.timedelta(0) - - def utcoffset(self, dt): - return UTCtzinfo.ZERO - - def tzname(self, dt): - return "UTC" - - def dst(self, dt): - return UTCtzinfo.ZERO - - """Returns the seconds since epoch for the given date and the wall - clock seconds for the given wall clock time. Assumes UTC timezone. - """ - timestring = timestring.strip() - date, clock_time = timestring.split() - year, month, day = [int(x) for x in date.split("-")] - hour, minute, second, msec = [float(x) for x in re.split("[:.]", clock_time)] - - date_obj = datetime.datetime(year, month, day, tzinfo=UTCtzinfo()) - date_timestamp = (date_obj - datetime.datetime(1970, 1, 1, tzinfo=UTCtzinfo())).total_seconds() - - wall_time = hour*3600+minute*60+second+0.001*msec - return date_timestamp, wall_time - + # Misc. functions def vector_from_string(self, vectorstr): """Returns a numpy array from a string comprising of floating point numbers. diff --git a/src/main/scala/eu/nomad_lab/parsers/CpmdParser.scala b/src/main/scala/eu/nomad_lab/parsers/CpmdParser.scala index 62b523b03d29f65feea51561c84cdd519a3b0c5a..d1da8ecd764e47912d5775cea644e304a999d825 100644 --- a/src/main/scala/eu/nomad_lab/parsers/CpmdParser.scala +++ b/src/main/scala/eu/nomad_lab/parsers/CpmdParser.scala @@ -40,7 +40,8 @@ object CpmdParser extends SimpleExternalParserGenerator( "parser-cpmd/cpmdparser/scalainterface.py", "parser-cpmd/cpmdparser/versions/__init__.py", "parser-cpmd/cpmdparser/versions/cpmd41/__init__.py", - "parser-cpmd/cpmdparser/versions/cpmd41/mainparser.py", + "parser-cpmd/cpmdparser/versions/cpmd41/geooptparser.py", + "parser-cpmd/cpmdparser/versions/cpmd41/singlepointparser.py", "parser-cpmd/cpmdparser/versions/cpmd41/inputparser.py", "parser-cpmd/cpmdparser/versions/cpmd41/commonparser.py", "parser-cpmd/cpmdparser/versions/cpmd41/input_data/cpmd_input_tree.pickle", diff --git a/test/unittests/cpmd_4.1/geo_opt/GEOMETRY b/test/unittests/cpmd_4.1/geo_opt/GEOMETRY new file mode 100644 index 0000000000000000000000000000000000000000..873904884da422dad33e22a6ff59bf43b3309714 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/GEOMETRY @@ -0,0 +1,2 @@ + 8.285412756178 7.558904499132 7.558904499132 0.000099666027 0.000000000000 0.000000000000 + 6.832396242085 7.558904499132 7.558904499132 -0.000099666027 0.000000000000 0.000000000000 diff --git a/test/unittests/cpmd_4.1/geo_opt/GEOMETRY.xyz b/test/unittests/cpmd_4.1/geo_opt/GEOMETRY.xyz new file mode 100644 index 0000000000000000000000000000000000000000..3d877d082af4882f3cec6a375f74d39a6717fa2a --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/GEOMETRY.xyz @@ -0,0 +1,4 @@ + 2 +GEOMETRY FILE / created by CPMD + H 4.384451613130 4.000000000000 4.000000000000 0.000052740990 0.000000000000 0.000000000000 + H 3.615548386870 4.000000000000 4.000000000000 -0.000052740990 0.000000000000 0.000000000000 diff --git a/test/unittests/cpmd_4.1/geo_opt/GEO_OPT.xyz b/test/unittests/cpmd_4.1/geo_opt/GEO_OPT.xyz new file mode 100644 index 0000000000000000000000000000000000000000..4b1df922939a47d3d0c7a8d8b627a6dad47068bf --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/GEO_OPT.xyz @@ -0,0 +1,20 @@ + 2 + 1 + H 4.371000000000 4.000000000000 4.000000000000 + H 3.629000000000 4.000000000000 4.000000000000 + 2 + 2 + H 4.386613267056 4.000000000000 4.000000000000 + H 3.613386732944 4.000000000000 4.000000000000 + 2 + 3 + H 4.384560328257 4.000000000000 4.000000000000 + H 3.615439671743 4.000000000000 4.000000000000 + 2 + 4 + H 4.384483260689 4.000000000000 4.000000000000 + H 3.615516739311 4.000000000000 4.000000000000 + 2 + 5 + H 4.384451613130 4.000000000000 4.000000000000 + H 3.615548386870 4.000000000000 4.000000000000 diff --git a/test/unittests/cpmd_4.1/geo_opt/HESSIAN b/test/unittests/cpmd_4.1/geo_opt/HESSIAN new file mode 100644 index 0000000000000000000000000000000000000000..87abfb994d499847a053ade25466ab860be519c7 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/HESSIAN @@ -0,0 +1,7 @@ + 6 + 0.32162103301424910 2.6424233700674593E-013 3.0211452071429970E-013 -0.32162103301800982 -1.7076247922074472E-013 8.9700778872892222E-014 + 2.6424233700674583E-013 2.1710026863726043E-025 2.4821587770250913E-025 -2.6424233700983574E-013 -1.4029765453914316E-025 7.3697740531939222E-026 + 3.0211452071429965E-013 2.4821587770250913E-025 2.8379109031214153E-025 -3.0211452071783233E-013 -1.6040563044729485E-025 8.4260371788814519E-026 + -0.32162103301800987 -2.6424233700983574E-013 -3.0211452071783233E-013 0.32162103302177036 1.7076247922274146E-013 -8.9700778873941091E-014 + -1.7076247922074470E-013 -1.4029765453914316E-025 -1.6040563044729482E-025 1.7076247922274146E-013 9.0665165882740565E-026 -4.7626012654739061E-026 + 8.9700778872892222E-014 7.3697740531939222E-026 8.4260371788814519E-026 -8.9700778873941104E-014 -4.7626012654739061E-026 2.5017734863276278E-026 diff --git a/test/unittests/cpmd_4.1/geo_opt/LATEST b/test/unittests/cpmd_4.1/geo_opt/LATEST new file mode 100644 index 0000000000000000000000000000000000000000..478a14ba44c5fab2e46cd9b5618c667f6728f024 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/LATEST @@ -0,0 +1,2 @@ +./RESTART.1 + 6 diff --git a/test/unittests/cpmd_4.1/geo_opt/RESTART.1 b/test/unittests/cpmd_4.1/geo_opt/RESTART.1 new file mode 100644 index 0000000000000000000000000000000000000000..a868bd551de4b946f89b84b032d939b07d174c3a Binary files /dev/null and b/test/unittests/cpmd_4.1/geo_opt/RESTART.1 differ diff --git a/test/unittests/cpmd_4.1/geo_opt/input.inp b/test/unittests/cpmd_4.1/geo_opt/input.inp new file mode 100755 index 0000000000000000000000000000000000000000..84ed8c17b20d6c56404ad92b301299ba9c7bafa0 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/input.inp @@ -0,0 +1,35 @@ +&INFO +isolated hydrogen molecule. +geometry optimization +&END + +&CPMD + OPTIMIZE GEOMETRY XYZ + CONVERGENCE ORBITALS + 1.0d-7 + CONVERGENCE GEOMETRY + 1.0d-4 +&END + +&SYSTEM + SYMMETRY + 1 + ANGSTROM + CELL + 8.00 1.0 1.0 0.0 0.0 0.0 + CUTOFF + 70.0 +&END + +&DFT + FUNCTIONAL LDA +&END + +&ATOMS +*H_MT_LDA.psp + LMAX=S + 2 + 4.371 4.000 4.000 + 3.629 4.000 4.000 +&END + diff --git a/test/unittests/cpmd_4.1/geo_opt/output.out b/test/unittests/cpmd_4.1/geo_opt/output.out new file mode 100644 index 0000000000000000000000000000000000000000..8aec0bb4f6af15c02e00693022e72c907a4541d3 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/output.out @@ -0,0 +1,397 @@ + cp_groups: we are using a 1 x 1 grid (groups x nprocs). + PROGRAM CPMD STARTED AT: 2016-07-15 12:18:48.376 + SETCNST| USING: CODATA 2006 UNITS + + + ****** ****** **** **** ****** + ******* ******* ********** ******* + *** ** *** ** **** ** ** *** + ** ** *** ** ** ** ** ** + ** ******* ** ** ** ** + *** ****** ** ** ** *** + ******* ** ** ** ******* + ****** ** ** ** ****** + + VERSION 4.1-rUnversioned directory + + COPYRIGHT + IBM RESEARCH DIVISION + MPI FESTKOERPERFORSCHUNG STUTTGART + + The CPMD consortium + Home Page: http://www.cpmd.org + Mailing List: cpmd-list@cpmd.org + E-mail: cpmd@cpmd.org + + + *** Jun 22 2016 -- 12:41:05 *** + + THE INPUT FILE IS: input.inp + THIS JOB RUNS ON: lenovo700 + THE CURRENT DIRECTORY IS: + /home/lauri/Dropbox/nomad-dev/nomad-lab-base/parsers/cpmd/test/unittests/cpmd_4.1/geo_opt + THE TEMPORARY DIRECTORY IS: + /home/lauri/Dropbox/nomad-dev/nomad-lab-base/parsers/cpmd/test/unittests/cpmd_4.1/geo_opt + THE PROCESS ID IS: 3514 + THE JOB WAS SUBMITTED BY: lauri + + + ****************************************************************************** + * INFO - INFO - INFO - INFO - INFO - INFO - INFO - INFO - INFO - INFO - INFO * + ****************************************************************************** + * isolated hydrogen molecule. * + * geometry optimization * + ****************************************************************************** + + OPTIMIZATION OF IONIC POSITIONS + + USING SEED 123456 TO INIT. PSEUDO RANDOM NUMBER GEN. + PATH TO THE RESTART FILES: ./ + GRAM-SCHMIDT ORTHOGONALIZATION + MAXIMUM NUMBER OF STEPS: 10000 STEPS + MAXIMUM NUMBER OF ITERATIONS FOR SC: 10000 STEPS + PRINT INTERMEDIATE RESULTS EVERY 10001 STEPS + STORE INTERMEDIATE RESULTS EVERY 10001 STEPS + STORE INTERMEDIATE RESULTS EVERY 10001 SELF-CONSISTENT STEPS + NUMBER OF DISTINCT RESTART FILES: 1 + TEMPERATURE IS CALCULATED ASSUMING EXTENDED BULK BEHAVIOR + FICTITIOUS ELECTRON MASS: 400.0000 + TIME STEP FOR ELECTRONS: 5.0000 + TIME STEP FOR IONS: 5.0000 + CONVERGENCE CRITERIA FOR WAVEFUNCTION OPTIMIZATION: 1.0000E-07 + WAVEFUNCTION OPTIMIZATION BY PRECONDITIONED DIIS + THRESHOLD FOR THE WF-HESSIAN IS 0.5000 + MAXIMUM NUMBER OF VECTORS RETAINED FOR DIIS: 10 + STEPS UNTIL DIIS RESET ON POOR PROGRESS: 10 + FULL ELECTRONIC GRADIENT IS USED + CONVERGENCE CRITERIA FOR GEOMETRY OPTIMIZATION: 1.000000E-04 + GEOMETRY OPTIMIZATION BY GDIIS/BFGS + SIZE OF GDIIS MATRIX: 5 +GEOMETRY OPTIMIZATION IS SAVED ON FILE GEO_OPT.xyz + EMPIRICAL INITIAL HESSIAN (DISCO PARAMETRISATION) + SPLINE INTERPOLATION IN G-SPACE FOR PSEUDOPOTENTIAL FUNCTIONS + NUMBER OF SPLINE POINTS: 5000 + + EXCHANGE CORRELATION FUNCTIONALS + LDA EXCHANGE: NONE + LDA XC THROUGH PADE APPROXIMATION + S.GOEDECKER, J.HUTTER, M.TETER PRB 541703 (1996) + + *** DETSP| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + + ***************************** ATOMS **************************** + NR TYPE X(BOHR) Y(BOHR) Z(BOHR) MBL + 1 H 8.259993 7.558904 7.558904 3 + 2 H 6.857816 7.558904 7.558904 3 + **************************************************************** + + NUMBER OF STATES: 1 + NUMBER OF ELECTRONS: 2.00000 + CHARGE: 0.00000 + ELECTRON TEMPERATURE(KELVIN): 0.00000 + OCCUPATION + 2.0 + + ============================================================ + | Pseudopotential Report Thu Jan 11 18:21:49 1996 | + ------------------------------------------------------------ + | Atomic Symbol : H | + | Atomic Number : 1 | + | Number of core states : 0 | + | Number of valence states : 1 | + | Exchange-Correlation Functional : | + | Slater exchange : .6667 | + | LDA correlation : Ceperley-Alder | + | Electron Configuration : N L Occupation | + | 1 S 1.0000 | + | Full Potential Total Energy -.445894 | + | Trouiller-Martins normconserving PP | + | n l rc energy | + | 1 S .5000 -.23366 | + | 2 P .5000 -.23366 | + | Number of Mesh Points : 511 | + | Pseudoatom Total Energy -.445889 | + ============================================================ + + **************************************************************** + * ATOM MASS RAGGIO NLCC PSEUDOPOTENTIAL * + * H 1.0080 1.2000 NO S LOCAL * + **************************************************************** + + + PARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARA + NCPU NGW NHG PLANES GXRAYS HXRAYS ORBITALS Z-PLANES + 0 17133 136605 90 1281 5089 1 1 + G=0 COMPONENT ON PROCESSOR : 0 + PARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARAPARA + + *** loadpa| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + + OPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPEN + NUMBER OF CPUS PER TASK 1 + OPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPENMPOPEN + + *** rggen| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + + ************************** SUPERCELL *************************** + SYMMETRY: SIMPLE CUBIC + LATTICE CONSTANT(a.u.): 15.11781 + CELL DIMENSION: 15.1178 1.0000 1.0000 0.0000 0.0000 0.0000 + VOLUME(OMEGA IN BOHR^3): 3455.14726 + LATTICE VECTOR A1(BOHR): 15.1178 0.0000 0.0000 + LATTICE VECTOR A2(BOHR): 0.0000 15.1178 0.0000 + LATTICE VECTOR A3(BOHR): 0.0000 0.0000 15.1178 + RECIP. LAT. VEC. B1(2Pi/BOHR): 0.0661 0.0000 0.0000 + RECIP. LAT. VEC. B2(2Pi/BOHR): 0.0000 0.0661 0.0000 + RECIP. LAT. VEC. B3(2Pi/BOHR): 0.0000 0.0000 0.0661 + REAL SPACE MESH: 90 90 90 + WAVEFUNCTION CUTOFF(RYDBERG): 70.00000 + DENSITY CUTOFF(RYDBERG): (DUAL= 4.00) 280.00000 + NUMBER OF PLANE WAVES FOR WAVEFUNCTION CUTOFF: 17133 + NUMBER OF PLANE WAVES FOR DENSITY CUTOFF: 136605 + **************************************************************** + + *** RINFORCE| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + *** FFTPRP| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + + GENERATE ATOMIC BASIS SET + H SLATER ORBITALS + 1S ALPHA= 1.0000 OCCUPATION= 1.00 + + + INITIALIZATION TIME: 0.48 SECONDS + + *** GMOPTS| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + *** PHFAC| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + NOTE: ATOMIC GUESS USING DISTRIBUTED LINALG WITH LANCZOS + *** ATOMWF| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + ATRHO| CHARGE(R-SPACE): 2.000000 (G-SPACE): 2.000000 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2600 7.5589 7.5589 0.000E+00 0.000E+00 0.000E+00 + 2 H 6.8578 7.5589 7.5589 0.000E+00 0.000E+00 0.000E+00 + + INITIALIZE EMPIRICAL HESSIAN + <<<<< ASSUMED BONDS >>>>> + 2 <--> 1 + TOTAL NUMBER OF MOLECULAR STRUCTURES: 1 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2600 7.5589 7.5589 0.000E+00 0.000E+00 0.000E+00 + 2 H 6.8578 7.5589 7.5589 0.000E+00 0.000E+00 0.000E+00 + CPU TIME FOR INITIALIZATION 0.83 SECONDS + + + ================================================================ + = GEOMETRY OPTIMIZATION = + ================================================================ + NFI GEMAX CNORM ETOT DETOT TCPU + EWALD| SUM IN REAL SPACE OVER 1* 1* 1 CELLS + 1 3.816E-02 2.886E-03 -1.096898 -1.097E+00 0.21 + 2 8.628E-03 1.041E-03 -1.130803 -3.391E-02 0.21 + 3 2.736E-03 2.293E-04 -1.132376 -1.572E-03 0.20 + 4 6.115E-04 4.235E-05 -1.132456 -8.056E-05 0.21 + 5 1.532E-04 7.007E-06 -1.132459 -3.315E-06 0.20 + 6 3.895E-05 1.396E-06 -1.132460 -1.338E-07 0.21 + 7 6.288E-06 4.459E-07 -1.132460 -7.717E-09 0.21 + 8 7.941E-07 1.282E-07 -1.132460 -4.283E-10 0.21 + 9 1.237E-07 2.861E-08 -1.132460 -1.992E-11 0.21 + 10 2.278E-08 5.401E-09 -1.132460 -8.606E-13 0.21 + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2600 7.5589 7.5589 -1.780E-02 8.421E-17 7.760E-17 + 2 H 6.8578 7.5589 7.5589 1.780E-02 1.778E-16 1.682E-16 + **************************************************************** + *** TOTAL STEP NR. 10 GEOMETRY STEP NR. 1 *** + *** GNMAX= 1.779860E-02 ETOT= -1.132460 *** + *** GNORM= 1.027603E-02 DETOT= 0.000E+00 *** + *** CNSTR= 0.000000E+00 TCPU= 2.07 *** + **************************************************************** + 1 5.012E-03 9.718E-04 -1.131471 9.887E-04 0.25 + 2 4.287E-04 1.613E-04 -1.132846 -1.375E-03 0.25 + 3 1.489E-04 3.429E-05 -1.132883 -3.658E-05 0.24 + 4 3.265E-05 6.786E-06 -1.132885 -1.887E-06 0.22 + 5 7.649E-06 9.659E-07 -1.132885 -9.037E-08 0.20 + 6 1.707E-06 2.336E-07 -1.132885 -2.124E-09 0.20 + 7 3.870E-07 5.941E-08 -1.132885 -9.984E-11 0.21 + 8 7.619E-08 1.498E-08 -1.132885 -5.241E-12 0.24 + 9 2.806E-08 2.950E-09 -1.132885 -1.432E-13 0.22 + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2895 7.5589 7.5589 2.695E-03 7.970E-17 7.714E-17 + 2 H 6.8283 7.5589 7.5589 -2.695E-03 1.350E-16 1.183E-16 + **************************************************************** + *** TOTAL STEP NR. 19 GEOMETRY STEP NR. 2 *** + *** GNMAX= 2.694583E-03 [2.95E-02] ETOT= -1.132885 *** + *** GNORM= 1.555718E-03 DETOT= -4.251E-04 *** + *** CNSTR= 0.000000E+00 TCPU= 2.02 *** + **************************************************************** + 1 6.188E-04 1.259E-04 -1.132872 1.251E-05 0.14 + 2 6.604E-05 2.142E-05 -1.132895 -2.326E-05 0.14 + 3 2.121E-05 4.085E-06 -1.132896 -6.178E-07 0.14 + 4 5.282E-06 7.354E-07 -1.132896 -2.729E-08 0.14 + 5 1.316E-06 1.026E-07 -1.132896 -1.177E-09 0.14 + 6 3.022E-07 2.511E-08 -1.132896 -2.822E-11 0.15 + 7 4.514E-08 6.465E-09 -1.132896 -1.464E-12 0.16 + 8 6.481E-09 1.550E-09 -1.132896 -7.150E-14 0.14 + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2856 7.5589 7.5589 2.320E-04 6.810E-17 9.413E-17 + 2 H 6.8322 7.5589 7.5589 -2.320E-04 1.697E-16 1.268E-16 + **************************************************************** + *** TOTAL STEP NR. 27 GEOMETRY STEP NR. 3 *** + *** GNMAX= 2.319650E-04 [3.88E-03] ETOT= -1.132896 *** + *** GNORM= 1.339250E-04 DETOT= -1.140E-05 *** + *** CNSTR= 0.000000E+00 TCPU= 1.13 *** + **************************************************************** + 1 2.342E-05 4.736E-06 -1.132896 -2.010E-08 0.13 + 2 2.423E-06 8.019E-07 -1.132896 -3.290E-08 0.13 + 3 7.883E-07 1.543E-07 -1.132896 -8.668E-10 0.13 + 4 1.573E-07 2.777E-08 -1.132896 -3.902E-11 0.13 + 5 3.639E-08 3.740E-09 -1.132896 -1.561E-12 0.14 + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2855 7.5589 7.5589 1.381E-04 1.267E-16 1.019E-16 + 2 H 6.8323 7.5589 7.5589 -1.381E-04 1.620E-16 1.442E-16 + **************************************************************** + *** TOTAL STEP NR. 32 GEOMETRY STEP NR. 4 *** + *** GNMAX= 1.381353E-04 [1.46E-04] ETOT= -1.132896 *** + *** GNORM= 7.975243E-05 DETOT= -5.391E-08 *** + *** CNSTR= 0.000000E+00 TCPU= 0.66 *** + **************************************************************** + 1 9.625E-06 1.945E-06 -1.132896 -8.527E-09 0.13 + 2 9.934E-07 3.289E-07 -1.132896 -5.549E-09 0.14 + 3 3.220E-07 6.333E-08 -1.132896 -1.457E-10 0.14 + 4 7.210E-08 1.115E-08 -1.132896 -6.622E-12 0.13 + 5 1.683E-08 1.567E-09 -1.132896 -4.368E-13 0.14 + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + TOTAL INTEGRATED ELECTRONIC DENSITY + IN G-SPACE = 2.0000000000 + IN R-SPACE = 2.0000000000 + + (K+E1+L+N+X) TOTAL ENERGY = -1.13289611 A.U. + (K) KINETIC ENERGY = 1.06574787 A.U. + (E1=A-S+R) ELECTROSTATIC ENERGY = -0.49247553 A.U. + (S) ESELF = 0.66490380 A.U. + (R) ESR = 0.15550684 A.U. + (L) LOCAL PSEUDOPOTENTIAL ENERGY = -1.06363345 A.U. + (N) N-L PSEUDOPOTENTIAL ENERGY = 0.00000000 A.U. + (X) EXCHANGE-CORRELATION ENERGY = -0.64253500 A.U. + + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2854 7.5589 7.5589 9.967E-05 9.505E-17 6.575E-17 + 2 H 6.8324 7.5589 7.5589 -9.967E-05 1.824E-16 1.335E-16 + **************************************************************** + *** TOTAL STEP NR. 37 GEOMETRY STEP NR. 5 *** + *** GNMAX= 9.966603E-05 [5.98E-05] ETOT= -1.132896 *** + *** GNORM= 5.754221E-05 DETOT= -1.423E-08 *** + *** CNSTR= 0.000000E+00 TCPU= 0.68 *** + **************************************************************** + ================================================================ + = END OF GEOMETRY OPTIMIZATION = + ================================================================ + + + + RESTART INFORMATION WRITTEN ON FILE ./RESTART.1 + + **************************************************************** + * * + * FINAL RESULTS * + * * + **************************************************************** + + ATOM COORDINATES GRADIENTS (-FORCES) + 1 H 8.2854 7.5589 7.5589 9.967E-05 9.505E-17 6.575E-17 + 2 H 6.8324 7.5589 7.5589 -9.967E-05 1.824E-16 1.335E-16 + + **************************************************************** + + + ELECTRONIC GRADIENT: + MAX. COMPONENT = 1.68333E-08 NORM = 1.56737E-09 + NUCLEAR GRADIENT: + MAX. COMPONENT = 9.96660E-05 NORM = 5.75422E-05 + + + TOTAL INTEGRATED ELECTRONIC DENSITY + IN G-SPACE = 2.0000000000 + IN R-SPACE = 2.0000000000 + + (K+E1+L+N+X) TOTAL ENERGY = -1.13289611 A.U. + (K) KINETIC ENERGY = 1.06574787 A.U. + (E1=A-S+R) ELECTROSTATIC ENERGY = -0.49247553 A.U. + (S) ESELF = 0.66490380 A.U. + (R) ESR = 0.15550684 A.U. + (L) LOCAL PSEUDOPOTENTIAL ENERGY = -1.06363345 A.U. + (N) N-L PSEUDOPOTENTIAL ENERGY = 0.00000000 A.U. + (X) EXCHANGE-CORRELATION ENERGY = -0.64253500 A.U. + + **************************************************************** + + + + **************************************************************** + * * + * TIMING * + * * + **************************************************************** + SUBROUTINE CALLS SELF TIME TOTAL TIME + AVERAGE MAXIMUM AVERAGE MAXIMUM + cpmd 1 0.01 0.01 7.87 7.87 + gmopts 1 0.00 0.00 7.40 7.40 + RGMOPT 1 0.01 0.01 7.40 7.40 + updwf 37 0.00 0.00 6.56 6.56 + forcedr 37 0.00 0.00 6.46 6.46 + forces 37 0.00 0.00 6.46 6.46 + forces_a 37 0.00 0.00 4.97 4.97 + rscpot 37 0.00 0.00 4.97 4.97 + vofrho 38 0.00 0.00 4.32 4.32 + INVFFTN 115 2.89 2.89 2.89 2.89 + VOFRHOB 38 0.14 0.14 2.81 2.81 + FWFFTN 77 1.77 1.77 1.77 1.77 + vpsi 39 0.17 0.17 1.58 1.58 + VOFRHOA 38 0.08 0.08 1.51 1.51 + xcener_new 38 0.12 0.12 1.35 1.35 + mikeu 38 1.24 1.24 1.24 1.24 + rhoofr 37 0.22 0.22 0.98 0.98 + initrun 1 0.00 0.00 0.83 0.83 + rinitwf 1 0.00 0.00 0.83 0.83 + ATOMWF 1 0.00 0.00 0.83 0.83 + ATRHO 1 0.35 0.35 0.39 0.39 + rinit 1 0.00 0.00 0.25 0.25 + rggen 1 0.01 0.01 0.25 0.25 + loadpa 1 0.01 0.01 0.25 0.25 + ppener 38 0.17 0.17 0.17 0.17 + EICALC 38 0.10 0.10 0.10 0.10 + RINFORCE 1 0.00 0.00 0.10 0.10 + dist_ksmat 1 0.00 0.00 0.10 0.10 + NUMPW 1 0.10 0.10 0.10 0.10 + loadpa_b 1 0.10 0.10 0.10 0.10 + FORMFN 1 0.09 0.09 0.09 0.09 + loadpa_c 1 0.09 0.09 0.09 0.09 + odiis 37 0.08 0.08 0.08 0.08 + loadpa_a 1 0.04 0.04 0.04 0.04 + potfor 5 0.03 0.03 0.03 0.03 + forces_b 37 0.01 0.01 0.01 0.01 + ortho 41 0.00 0.00 0.01 0.01 + rgs 41 0.01 0.01 0.01 0.01 + PUTPS 1 0.01 0.01 0.01 0.01 + **************************************************************** + + CPU TIME : 0 HOURS 0 MINUTES 7.86 SECONDS + ELAPSED TIME : 0 HOURS 0 MINUTES 7.88 SECONDS + *** CPMD| SIZE OF THE PROGRAM IS NOT AVAILABLE *** + + PROGRAM CPMD ENDED AT: 2016-07-15 12:18:56.253 diff --git a/test/unittests/cpmd_4.1/geo_opt/run.sh b/test/unittests/cpmd_4.1/geo_opt/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..222042e49aa219ad6e922865b7797f786e068428 --- /dev/null +++ b/test/unittests/cpmd_4.1/geo_opt/run.sh @@ -0,0 +1,3 @@ +export CPMD_PP_LIBRARY_PATH=../ +export OMP_NUM_THREADS=1 +cpmd41 input.inp > output.out diff --git a/test/unittests/cpmd_4.1/run_tests.py b/test/unittests/cpmd_4.1/run_tests.py index a460ec94a0b469f029dcdc2df23b4a41f03de4d0..8a8ed73bfe74c4572dc3772bde55d3ed48655b8f 100644 --- a/test/unittests/cpmd_4.1/run_tests.py +++ b/test/unittests/cpmd_4.1/run_tests.py @@ -17,23 +17,6 @@ import numpy as np from cpmdparser import CPMDParser from nomadcore.unit_conversion.unit_conversion import convert_unit -# Setup the logger so that it doesn't spam messages during tests -logging.basicConfig( - level=logging.DEBUG, - format=( - '%(filename)s: ' - '%(levelname)s: ' - '%(funcName)s(): ' - '%(lineno)d:\t' - '%(message)s' - ) -) -logger = logging.getLogger("nomad") -logger.setLevel(logging.CRITICAL) -logging.getLogger("nomadcore.caching_backend").setLevel(logging.CRITICAL) -logger = logging.getLogger("cpmdparser") -logger.setLevel(logging.ERROR) - #=============================================================================== def get_results(folder, metainfo_to_keep=None): @@ -48,7 +31,7 @@ def get_results(folder, metainfo_to_keep=None): """ dirname = os.path.dirname(__file__) filename = os.path.join(dirname, folder, "output.out") - parser = CPMDParser(filename, None) + parser = CPMDParser(filename, None, debug=True, log_level=logging.CRITICAL) results = parser.parse() return results