diff --git a/cp2kparser/generics/nomadparser.py b/cp2kparser/generics/nomadparser.py index 984b9b34f57ad4aa967c1b8119be2871747067ce..358fdd01e318d49817af2456c4109c5581de845d 100644 --- a/cp2kparser/generics/nomadparser.py +++ b/cp2kparser/generics/nomadparser.py @@ -1,13 +1,11 @@ -import json import os import logging -logger = logging.getLogger(__name__) -from abc import ABCMeta, abstractmethod -from nomadcore.parser_backend import JsonParseEventsWriterBackend -from nomadcore.simple_parser import SimpleParserBuilder, defaultParseFile -from nomadcore.local_meta_info import loadJsonFile import StringIO import sys +from abc import ABCMeta, abstractmethod +from nomadcore.simple_parser import SimpleParserBuilder, defaultParseFile +from nomadcore.caching_backend import CachingLevel, ActiveBackend +logger = logging.getLogger(__name__) #=============================================================================== @@ -28,102 +26,28 @@ class NomadParser(object): interface that can be expected from each parser, but leaves the implementation details to the developer. - To initialize a NomadParser, you need to give it a JSON string in the - constructor. JSON is used because it is language-agnostic and can easily given - as a run argument for the parser. An example of the JSON file might look like - this: - - { - "metaInfoFile": "/home/metainfo.json" - "tmpDir": "/home", - "metainfoToKeep": ["energy"], - "metainfoToSkip": ["particle_forces"], - "files": { - "/home/output.out": "output", - "/home/input.inp": "input", - "/home/coords.xyz": "" - } - } - - Here is an explanation of the different attributes: - - metaInfoFile: The metainfo JSON file path containing the metainfo definitions - used by this parser - - tmpDir: A temporary directory for data - - metainfoToKeep: What metainfo should be parsed. If empty, tries to - parse everything except the ones specified in 'metainfoToSkip' - - metainfoToSkip: A list of metainfos that should be ignored - - files: Dictionary of files. The key is the path to the file, and the - value is an optional identifier that can be provided or later - determined by the parser. - Attributes: - input_json_string: A string containing the JSON input. - input_json_object: The JSON string decoded as an accessible object. files: A dictionary of file paths as keys and id's as values. These ids's only include the ones given at initialization in the input JSON." - tmp_dir: Temporary directory location. - metainfo_file: Path to the file where the metainfos are declared - meta_info_to_keep: - meta_info_to_skip: file_ids: A dictionary containing all the assigned id's as keys and their - respective filepaths as values. - test_mode: A boolean for turning on test mode. In test mode the parsed - values are not converted to SI or formatted as JSON and they are not - sent to the backend but returned directly as one possibly large value. - backend: An object responsible for the JSON formatting and sending the - results to the scala layer. + metainfoenv: A dictionary for the metainfos + backend: An object responsible for the JSON formatting, unit conversion + and sending the results to the scala layer. """ + __metaclass__ = ABCMeta - def __init__(self, input_json_string, stream=sys.stdout, test_mode=False): - self.input_json_string = input_json_string - self.input_json_object = None - self.files = {} - self.tmp_dir = None - self.metainfo_file = None - self.metainfoenv = None - self.metainfos = {} - self.metainfo_to_keep = None - self.metainfo_to_skip = None - self.file_ids = {} - self.results = {} - self.filepaths_wo_id = None - self.test_mode = test_mode - self.backend = None - self.stream = stream + def __init__(self, parser_context): + self.files = parser_context.files + self.metainfoenv = parser_context.metainfoenv + self.backend = parser_context.backend + self.stream = parser_context.stream + self.version_id = parser_context.version_id self._file_handles = {} self._file_contents = {} self._file_sizes = {} - - self.analyze_input_json() - self.setup_given_file_ids() - - def analyze_input_json(self): - """Analyze the validity of the JSON string given as input. - """ - # Try to decode the input JSON - try: - self.input_json_object = json.loads(self.input_json_string) - except ValueError as e: - logger.error("Error in decoding the given JSON input: {}".format(e)) - - # See if the needed attributes exist - self.metainfo_file = self.input_json_object.get("metaInfoFile") - if self.metainfo_file is None: - logger.error("No metainfo file path specified.") - self.tmp_dir = self.input_json_object.get("tmpDir") - if self.tmp_dir is None: - logger.error("No temporary folder specified.") - self.files = self.input_json_object.get("files") - if self.files is None: - logger.error("No files specified.") - self.metainfo_to_keep = self.input_json_object.get("metainfoToKeep") - self.metainfo_to_skip = self.input_json_object.get("metainfoToSkip") - - # Try to decode the metainfo file and setup the backend - self.metainfoenv, warnings = loadJsonFile(self.metainfo_file) - self.backend = JsonParseEventsWriterBackend(self.metainfoenv, self.stream) + self.file_ids = {} def setup_given_file_ids(self): """Saves the file id's that were given in the JSON input. @@ -132,24 +56,24 @@ class NomadParser(object): if file_id: self.setup_file_id(path, file_id) - @abstractmethod - def setup_version(self): - """Do some version specific setup work. The parsers will have to - support many versions of the same code and the results of different - versions may have to be parsed differently. - - With this function you should determine the version of the software, - and setup the version specific implementation of the parser. - """ - pass - @abstractmethod def parse(self): """Start the parsing. Will try to parse everything unless given special rules (metaInfoToKeep, metaInfoToSkip).""" pass - def parse_file(self, fileToParse, mainFileDescription, metaInfoEnv, backend, parserInfo): + def parse_file( + self, + fileToParse, + mainFileDescription, + metaInfoEnv, + backend, + parserInfo, + cachingLevelForMetaName={}, + defaultDataCachingLevel=CachingLevel.ForwardAndCache, + defaultSectionCachingLevel=CachingLevel.Forward, + superContext=None, + onClose={}): """Uses the SimpleParser utilities to to parse a file. Args: @@ -167,6 +91,15 @@ class NomadParser(object): if not parserBuilder.verifyMetaInfo(sys.stderr): sys.exit(1) + # Setup the backend that caches ond handles triggers + backend = ActiveBackend.activeBackend( + metaInfoEnv=metaInfoEnv, + cachingLevelForMetaName=cachingLevelForMetaName, + defaultDataCachingLevel=defaultDataCachingLevel, + defaultSectionCachingLevel=defaultSectionCachingLevel, + onClose=onClose, + superBackend=backend) + # Compile the SimpleMatcher tree parserBuilder.compile() if logger.isEnabledFor(logging.DEBUG): @@ -311,6 +244,19 @@ class NomadParser(object): self._file_sizes[file_id] = size return size + + + + + + + + + + + + + # @abstractmethod # def get_supported_quantities(self): # """Return a list of the nomad quantities that this parser supports. The diff --git a/cp2kparser/generics/parserbuilder.py b/cp2kparser/generics/parserbuilder.py new file mode 100644 index 0000000000000000000000000000000000000000..c412cdbec2d076a0858bf350e22246086b589e97 --- /dev/null +++ b/cp2kparser/generics/parserbuilder.py @@ -0,0 +1,529 @@ +import json +import logging +from nomadcore.parser_backend import JsonParseEventsWriterBackend +from nomadcore.local_meta_info import loadJsonFile +import sys +from abc import ABCMeta, abstractmethod +logger = logging.getLogger(__name__) + + +#=============================================================================== +class ParserBuilder(object): + """Class that sets up a parser implementation based on the given files and + the metainfos to include/exclude. + + To initialize a ParserBuilder, you need to give it a JSON string in the + constructor. JSON is used because it is language-agnostic and can easily given + as a run argument for the parser. An example of the JSON file might look like + this: + + { + "metaInfoFile": "/home/metainfo.json" + "metainfoToKeep": ["energy"], + "metainfoToSkip": ["particle_forces"], + "files": { + "/home/output.out": "output", + "/home/input.inp": "input", + "/home/coords.xyz": "" + } + } + + Here is an explanation of the different attributes: + - metaInfoFile: The metainfo JSON file path containing the metainfo definitions + used by this parser + - metainfoToKeep: What metainfo should be parsed. If empty, tries to + parse everything except the ones specified in 'metainfoToSkip' + - metainfoToSkip: A list of metainfos that should be ignored + - files: Dictionary of files. The key is the path to the file, and the + value is an optional identifier that can be provided or later + determined by the parser. + + Attributes: + input_json_string: A string containing the JSON input. + files: A dictionary of file paths as keys and id's as values. These ids's only include + the ones given at initialization in the input JSON. + meta_info_to_keep: The metainfo names to keep + meta_info_to_skip: The metainfo names to skip + backend: An object responsible for the JSON formatting and sending the + results to the scala layer. + version_override: An object that is used to force a specific version. + Can be e.g. a string that identifies a version. + """ + __metaclass__ = ABCMeta + + def __init__(self, input_json_string, stream=sys.stdout, version_override=None): + """ + """ + self.input_json_string = input_json_string + self.parser_context = ParserContext() + self.parser_context.stream = stream + self.parser_context.version_id = version_override + self.analyze_input_json() + + def analyze_input_json(self): + """Analyze the validity of the JSON string given as input. + """ + # Try to decode the input JSON + try: + input_json_object = json.loads(self.input_json_string) + except ValueError as e: + logger.error("Error in decoding the given JSON input: {}".format(e)) + + # See if the needed attributes exist + metainfo_file = input_json_object.get("metaInfoFile") + if metainfo_file is None: + logger.error("No metainfo file path specified.") + self.parser_context.files = input_json_object.get("files") + if self.parser_context.files is None: + logger.error("No files specified.") + self.parser_context.metainfo_to_keep = input_json_object.get("metainfoToKeep") + self.parser_context.metainfo_to_skip = input_json_object.get("metainfoToSkip") + + # Try to decode the metainfo file and setup the backend + self.parser_context.metainfoenv, self.parser_context.metainfowarnings = loadJsonFile(metainfo_file) + self.parser_context.backend = JsonParseEventsWriterBackend(self.parser_context.metainfoenv, self.parser_context.stream) + + @abstractmethod + def build_parser(self): + """Deduce the version of the software that was used and setup a correct + implementation. The implementations should subclass NomadParser. + + Returns: + A NomadParser object that is ready to do the parsing. + """ + pass + + +class ParserContext(object): + """Contains everything needed to instantiate a parser implementation. + """ + def __init__(self, version_id=None, files=None, metainfoenv=None, metainfowarnings=None, metainfo_to_keep=None, metainfo_to_skip=None, backend=None, stream=None): + self.version_id = version_id + self.metainfoenv = metainfoenv + self.metainfowarnings = metainfowarnings + self.metainfo_to_keep = metainfo_to_keep + self.metainfo_to_skip = metainfo_to_skip + self.files = files + self.backend = backend + self.stream = stream + + + + + + + + + + # def setup_given_file_ids(self): + # """Saves the file id's that were given in the JSON input. + # """ + # for path, file_id in self.files.iteritems(): + # if file_id: + # self.setup_file_id(path, file_id) + + # @abstractmethod + # def parse(self): + # """Start the parsing. Will try to parse everything unless given special + # rules (metaInfoToKeep, metaInfoToSkip).""" + # pass + + # def parse_file( + # self, + # fileToParse, + # mainFileDescription, + # metaInfoEnv, + # backend, + # parserInfo, + # cachingLevelForMetaName={}, + # defaultDataCachingLevel=CachingLevel.ForwardAndCache, + # defaultSectionCachingLevel=CachingLevel.Forward, + # superContext=None, + # onClose={}): + # """Uses the SimpleParser utilities to to parse a file. + + # Args: + # Returns: + # """ + # # Initialize the parser builder + # parserBuilder = SimpleParserBuilder(mainFileDescription, metaInfoEnv) + # if logger.isEnabledFor(logging.DEBUG): + # s = StringIO.StringIO() + # s.write("matchers:") + # parserBuilder.writeMatchers(s, 2) + # logger.debug(s.getvalue()) + + # # Verify the metainfo + # if not parserBuilder.verifyMetaInfo(sys.stderr): + # sys.exit(1) + + # # Setup the backend that caches ond handles triggers + # backend = ActiveBackend.activeBackend( + # metaInfoEnv=metaInfoEnv, + # cachingLevelForMetaName=cachingLevelForMetaName, + # defaultDataCachingLevel=defaultDataCachingLevel, + # defaultSectionCachingLevel=defaultSectionCachingLevel, + # onClose=onClose, + # superBackend=backend) + + # # Compile the SimpleMatcher tree + # parserBuilder.compile() + # if logger.isEnabledFor(logging.DEBUG): + # s = StringIO.StringIO() + # s.write("compiledMatchers:") + # parserBuilder.writeCompiledMatchers(s, 2) + # logger.debug(s.getvalue()) + + # writeComma = False + # outF = sys.stdout + # parse_function = defaultParseFile(parserInfo) + # uri = None + # if uri is None and fileToParse: + # uri = "file://" + fileToParse + # if fileToParse: + # if writeComma: + # outF.write(", ") + # else: + # writeComma = True + # parse_function(parserBuilder, uri, fileToParse, backend, self) + + # def setup_file_id(self, path, file_id): + # """Used to map a simple identifier string to a file path. When a file + # id has been setup, you can easily access the file by using the + # functions get_file_handle() or get_file_contents() + # """ + # if path in self.files: + # value = self.file_ids.get(file_id) + # if value: + # value.append(path) + # else: + # pathlist = [] + # pathlist.append(path) + # self.file_ids[file_id] = pathlist + # else: + # logger.error("Trying to setup an id for an undefined path. See that the path was written correctly and it was given in the files attribute of the JSON string.") + + # def get_filepath_by_id(self, file_id): + # """Get the file paths that were registered with the given id. + # """ + # value = self.file_ids.get(file_id) + # if value: + # if isinstance(value, list): + # n = len(value) + # if n == 1: + # return value[0] + # elif n == 0: + # logger.warning("No files set with id '{}'".format(file_id)) + # return None + # else: + # logger.debug("Multiple files set with id '{}'".format(file_id)) + # return value + # else: + # logger.warning("No files set with id '{}'".format(file_id)) + + # def get_file_handle(self, file_id): + # """Get the handle for a single file with the given id. Uses cached result + # if available. Always seeks to beginning of file before returning it. + # """ + # # Get the filepath(s) + # path = self.get_filepath_by_id(file_id) + # if not path: + # logger.warning("No filepaths registered to id '{}'. Register id's with setup_file_id().".format(file_id)) + # return + + # if isinstance(path, list): + # if len(path) == 0: + # return + # elif len(path) != 1: + # logger.error("Multiple filepaths found with id '{}'. Use get_file_handles() instead if you expect to have multiple files.".format(file_id)) + # return + # else: + # path = path[0] + + # # Search for filehandles, if not present create one + # handle = self._file_handles.get(path) + # if not handle: + # try: + # handle = open(path, "r") + # except (OSError, IOError): + # logger.error("Could not open file: '{}'".format(path)) + # else: + # self._file_handles[file_id] = handle + # handle.seek(0, os.SEEK_SET) + # return handle + + # def get_file_handles(self, file_id): + # """Get the handles for multiple files with the given id. Uses cached result + # if available. Always seeks to beginning of files before returning them. + # """ + # # Get the filepath(s) + # paths = self.get_filepath_by_id(file_id) + # if not paths: + # return + # if not isinstance(paths, list): + # paths = [paths] + + # # Search for filehandles, if not present create one + # handles = [] + # for path in paths: + # handle = self._file_handles.get(path) + # if not handle: + # try: + # handle = open(path, "r") + # except (OSError, IOError): + # logger.error("Could not open file: '{}'".format(path)) + # else: + # self._file_handles[file_id] = handle + # handle.seek(0, os.SEEK_SET) + # handles.append(handle) + + # # Return handles + # if len(handles) == 0: + # return None + # else: + # return handles + + # def get_file_contents(self, file_id): + # """Get the contents for the file with the given id. Uses cached result + # if available. Does not cache files that are bigger than a certain + # limit. + # """ + # cache_limit = 10000 + # contents = self._file_contents.get(file_id) + # if not contents: + # fh = self.get_file_handle(file_id) + # fh.seek(0) + # contents = fh.read() + # if self.get_file_size(file_id) <= cache_limit: + # self._file_contents[file_id] = contents + # return contents + + # def get_file_size(self, file_id): + # """Get the size of a file with the given id. Uses cached result + # if available. + # """ + # size = self._file_sizes.get(file_id) + # if not size: + # fh = self.get_file_handle(file_id) + # fh.seek(0, os.SEEK_END) + # size = fh.tell() + # self._file_sizes[file_id] = size + # return size + + # @abstractmethod + # def get_supported_quantities(self): + # """Return a list of the nomad quantities that this parser supports. The + # list should contain the metaInfoNames of the supported quantities. + # """ + # pass + + # @abstractmethod + # def start_parsing(self, name): + # """Start parsing the given quantity and outputs the result to the + # backend. + + # There are two modes of operation: + + # automatic: If this function returns a Result object, the function + # parse_quantity will detect it, convert the units, format the + # result to JSON and send it to the backend. Supports also returning + # iterators that yield multiple results (handy for generator + # functions that loop over e.g. a trajectory file extracting the + # trajectory one configuration at a time without reading the entire + # file into memory). + + # manual: You use the backend explicitly and do the unit + # conversion and JSON formatting "manually". In this case the + # function should return 'None'. + # """ + # pass + + # def check_quantity_availability(self, name): + # """Check if the given quantity can be parsed with this parser setup. + # Checks through the list given by get_supported_quantities and also + # checks the metainfoToSkip parameter given in the JSON input. + # """ + # if name not in self.get_supported_quantities(): + # return False + # if name in self.metainfo_to_skip: + # logger.error("The metaname '{}' cannot be calculated as it is in the list 'metaInfoToSkip'.".format(name)) + # return False + # return True + + # def parse(self): + # """Start parsing the contents. + # """ + # # Determine which values in metainfo are parseable + # metainfos = self.metainfos.itervalues() + # for metainfo in metainfos: + # name = metainfo["name"] + # if self.check_quantity_availability(name): + # self.parse_quantity(name) + + # def parse_quantity(self, name): + # """Given a unique quantity id (=metaInfo name) which is supported by + # the parser, parses the corresponding quantity (if available), converts + # it to SI units and return the value as json. + # """ + + # logger.info("GETTING QUANTITY '{}'".format(name)) + + # #Check availability + # available = self.check_quantity_availability(name) + # if not available: + # return + + # # Get the result by parsing or from cache + # result = self.get_result_object(name) + + # if result is not None: + # if isinstance(result, Result): + # if not self.test_mode: + # metainfo = self.metainfos.get(name) + # result.name = name + # result.dtypstr = metainfo.get("dtypeStr") + # result.repeats = metainfo.get("repeats") + # result.shape = metainfo.get("shape") + # self.result_saver(result) + # # In test mode just return the values directly + # else: + # if result.value is not None: + # if result.value_iterable is None: + # return result.value + # elif result.value_iterable is not None: + # values = [] + # for value in result.value_iterable: + # values.append(value) + # values = np.array(values) + # if values.size != 0: + # return values + + # def get_result_object(self, name): + # # Check cache + # result = self.results.get(name) + # if result is None: + # result = self.start_parsing(name) + # if result: + # if result.cache: + # self.results[name] = result + # return result + + # def result_saver(self, result): + # """Given a result object, saves the results to the backend. + + # The numeric results are automatically converted to SI units if a unit + # has been defined. Automatic conversion to the correct data type + # defined in the metainfo is attempted. + # """ + # name = result.name + # value = result.value + # unit = result.unit + # value_iterable = result.value_iterable + # repeats = result.repeats + # dtypestr = result.dtypstr + # shape = result.shape + + # # Save a single result + # if value is not None: + # if value_iterable is None: + # if repeats: + # logger.error("A repeating value was given in Result.value. Repeating values should be stored in Result.value_iterable instead.") + # return + + # # Save to backend + # section_id = self.backend.openSection(name) + # self.input_value_to_backend(name, value, unit, dtypestr, shape) + # self.backend.closeSection(name, section_id) + # # Save multiple values given by the iterator in Result.value_iterable + # elif value is None: + # if value_iterable is not None: + # if not repeats: + # logger.error("A repeating value was given although the value with metaname '{}' should not repeat.".format(name)) + # return + + # section_id = self.backend.openSection(name) + # for value in value_iterable: + # print value + # # Save to backend + # self.input_value_to_backend(name, value, unit, dtypestr, shape) + # self.backend.closeSection(name, section_id) + + # def input_value_to_backend(self, name, value, unit, dtypestr, shape): + # """Detects the result type and calls the correct backend function. + # """ + # # See if the type is correct or can be automatically casted to + # # the correct type + # value = self.type_checker(value, dtypestr) + + # # Convert to SI units if unit has been specified + # if unit is not None: + # value = convert_unit(value, unit) + + # if len(shape) != 0: + # self.backend.addArrayValues(name, value) + # elif dtypestr == "C" or dtypestr == "b": + # self.backend.addValue(name, value) + # elif dtypestr == "f" or dtypestr == "i": + # self.backend.addRealValue(name, value) + # else: + # logger.error("Could not determine the backend function call for variable type '{}'".format(type(dtypestr))) + + # def type_checker(self, value, expected_type): + # """Check that the result can be interpreted as the expected type. + # """ + # # TODO + # return value + + + +# #=============================================================================== +# class ResultCode(Enum): + # """Enumeration for indicating the result status. + # """ + # fail = 0 + # success = 1 + + +# #=============================================================================== +# class Result(object): + # """ Encapsulates a parsing result. + + # The parser should return results as Result objects, which contain + # additional data for automatic conversion and formatting. + + # The actual value can be single value (string, integer, float, 3D array of + # floats, 1D array of integer, etc.) or an iterable object for repeatable + # quantities (those that have "repeats: true" in metaInfo). + + # If returning a non-repeating value, you can place it to the "value" member. + # Repeatable objects should be placed to the "value_iterable" object. + + # The repeatable values can also be given as generator functions. With + # generators you can easily push results from a big data file piece by piece + # to the backend without loading the entire file into memory. + + # Attributes: + # cache: Boolean indicating whether the result should be cached in memory. + # name: The name of the metainfo corresponding to this result + # value: The value of the result. Used for storing single results. + # value_iterable: Iterable object containing multiple results. + # unit: Unit of the result. Use the Pint units from UnitRegistry. e.g. + # unit = ureg.newton. Used to automatically convert to SI. + # dtypstr: The datatype string specified in metainfo. + # shape: The expected shape of the result specified in metainfo. + # repeats: A boolean indicating if this value can repeat. Specified in + # metainfo. + + # """ + + # def __init__(self): + # self.name = None + # self.value = None + # self.value_iterable = None + # self.unit = None + # self.code = ResultCode.success + # self.error_message = "" + # self.dtypestr = None + # self.repeats = None + # self.shape = None + # self.cache = False diff --git a/cp2kparser/implementation/autoparser.py b/cp2kparser/implementation/autoparser.py index d842009172efb7899e8852aadbbdc60a37054042..295b19a045427ee5cdbd598394746700d2c81df9 100644 --- a/cp2kparser/implementation/autoparser.py +++ b/cp2kparser/implementation/autoparser.py @@ -1,6 +1,6 @@ import os import json -from cp2kparser.implementation.parser import CP2KParser +from cp2kparser.implementation.cp2kparserbuilder import CP2KParserBuilder import sys @@ -33,12 +33,11 @@ def get_parser(path, test_mode=True, stream=sys.stdout): json_input = { "version": "nomadparsein.json 1.0", "metaInfoFile": metaInfoPath, - "tmpDir": "/home", "metainfoToKeep": [], "metainfoToSkip": [], "files": files } - parser = CP2KParser(json.dumps(json_input), test_mode=test_mode, stream=stream) + parser = CP2KParserBuilder(json.dumps(json_input), stream=stream).build_parser() return parser diff --git a/cp2kparser/engines/cp2kinputenginedata/__init__.py b/cp2kparser/implementation/cp2kinputenginedata/__init__.py similarity index 100% rename from cp2kparser/engines/cp2kinputenginedata/__init__.py rename to cp2kparser/implementation/cp2kinputenginedata/__init__.py diff --git a/cp2kparser/engines/cp2kinputenginedata/cp2k_262/cp2k_input.xml b/cp2kparser/implementation/cp2kinputenginedata/cp2k_262/cp2k_input.xml similarity index 100% rename from cp2kparser/engines/cp2kinputenginedata/cp2k_262/cp2k_input.xml rename to cp2kparser/implementation/cp2kinputenginedata/cp2k_262/cp2k_input.xml diff --git a/cp2kparser/engines/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle b/cp2kparser/implementation/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle similarity index 99% rename from cp2kparser/engines/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle rename to cp2kparser/implementation/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle index 7c9a0f28c3a7b3a024fb702da108a247e1710e92..c64587476b0039fcff1ec5ebe193f76cfd291c7b 100644 Binary files a/cp2kparser/engines/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle and b/cp2kparser/implementation/cp2kinputenginedata/cp2k_262/cp2k_input_tree.pickle differ diff --git a/cp2kparser/engines/cp2kinputenginedata/cp2k_262/references.html b/cp2kparser/implementation/cp2kinputenginedata/cp2k_262/references.html similarity index 100% rename from cp2kparser/engines/cp2kinputenginedata/cp2k_262/references.html rename to cp2kparser/implementation/cp2kinputenginedata/cp2k_262/references.html diff --git a/cp2kparser/engines/cp2kinputenginedata/cp2k_262/units.html b/cp2kparser/implementation/cp2kinputenginedata/cp2k_262/units.html similarity index 100% rename from cp2kparser/engines/cp2kinputenginedata/cp2k_262/units.html rename to cp2kparser/implementation/cp2kinputenginedata/cp2k_262/units.html diff --git a/cp2kparser/engines/cp2kinputenginedata/input_tree.py b/cp2kparser/implementation/cp2kinputenginedata/input_tree.py similarity index 100% rename from cp2kparser/engines/cp2kinputenginedata/input_tree.py rename to cp2kparser/implementation/cp2kinputenginedata/input_tree.py diff --git a/cp2kparser/engines/cp2kinputenginedata/xmlpreparser.py b/cp2kparser/implementation/cp2kinputenginedata/xmlpreparser.py similarity index 98% rename from cp2kparser/engines/cp2kinputenginedata/xmlpreparser.py rename to cp2kparser/implementation/cp2kinputenginedata/xmlpreparser.py index 2811016cc6076e920ef32a4e935078db61b1e95a..f469ee12040bfb7e119c009b26d911cbc594f908 100644 --- a/cp2kparser/engines/cp2kinputenginedata/xmlpreparser.py +++ b/cp2kparser/implementation/cp2kinputenginedata/xmlpreparser.py @@ -16,7 +16,7 @@ cp2k_input.xml. import xml.etree.cElementTree as ET import logging import cPickle as pickle -from cp2kparser.engines.cp2kinputenginedata.input_tree import * +from cp2kparser.implementation.cp2kinputenginedata.input_tree import * logger = logging diff --git a/cp2kparser/engines/cp2kinputengine.py b/cp2kparser/implementation/cp2kinputparsers.py similarity index 98% rename from cp2kparser/engines/cp2kinputengine.py rename to cp2kparser/implementation/cp2kinputparsers.py index e3483f55b1881886d1d8d2d0dabdecabab16cfd4..78721246faacd4ac83ce25d9e9303c9fc50593a9 100644 --- a/cp2kparser/engines/cp2kinputengine.py +++ b/cp2kparser/implementation/cp2kinputparsers.py @@ -79,7 +79,7 @@ class CP2KInputEngine(object): return self.input_tree - def setup_version_number(self, version_number): + def setup_version(self, version_number): """ The pickle file which contains preparsed data from the cp2k_input.xml is version specific. By calling this function before parsing the correct file can be found. diff --git a/cp2kparser/implementation/cp2kparserbuilder.py b/cp2kparser/implementation/cp2kparserbuilder.py new file mode 100644 index 0000000000000000000000000000000000000000..f3da8c54c2b2b7d6bd9ef22551a383e6199dd7d1 --- /dev/null +++ b/cp2kparser/implementation/cp2kparserbuilder.py @@ -0,0 +1,583 @@ +import re +from cp2kparser.generics.parserbuilder import ParserBuilder +from cp2kparser.implementation.implementations import * +import logging +import sys +logger = logging.getLogger(__name__) + + +#=============================================================================== +class CP2KParserBuilder(ParserBuilder): + """Builds the correct parser by looking at the given files and the given + input. + + This class handles the initial setup before any parsing can happen. It + determines which version of the software was used and then sets up a + correct implementation. + """ + def __init__(self, input_json_string, stream=sys.stdout): + ParserBuilder.__init__(self, input_json_string, stream=sys.stdout) + + def build_parser(self): + """Setups the version by looking at the output file and the version + specified in it. + """ + # Search for the output file + count = 0 + for filepath in self.parser_context.files.iterkeys(): + if filepath.endswith(".out"): + count += 1 + outputpath = filepath + if count > 1: + logger("Could not determine the correct outputfile because multiple files with extension '.out' were found.") + return + elif count == 0: + logger.error("No output file could be found. The outputfile should have a '.out' extension.") + return + + # Search for the version specification + outputfile = open(outputpath, 'r') + regex = re.compile(r" CP2K\| version string:\s+CP2K version ([\d\.]+)") + for line in outputfile: + result = regex.match(line) + if result: + self.parser_context.version_id = result.group(1).replace('.', '') + break + + # Search for a version specific implementation + class_name = "CP2KImplementation{}".format(self.parser_context.version_id) + class_object = globals().get(class_name) + if class_object: + logger.debug("Using version specific implementation '{}'.".format(class_name)) + self.implementation = class_object(self.parser_context) + else: + logger.debug("No version specific implementation found. Using the default implementation: {}".format(class_name)) + self.parser_context.version_id = "262" + self.implementation = globals()["CP2KImplementation262"](self.parser_context) + + return self.implementation + + + + + + + + + + + + + + + + # self.inputengine.setup_version_number(self.version_number) + # self.input_tree = self.inputengine.parse(self.extended_input) + # Search for a version specific regex class + # class_name = "CP2K{}Regexs".format(version_name) + # self.regexs = globals().get(class_name) + # if self.regexs: + # logger.debug("Using version specific regexs '{}'.".format(class_name)) + # self.regexs = self.regexs() + # else: + # logger.debug("Using default regexs.") + # self.regexs = globals()["CP2KRegexs"]() + + # def determine_file_ids_pre_setup(self): + # """First resolve the files that can be identified by extension. + # """ + # # Input and output files + # for file_path in self.files.iterkeys(): + # if file_path.endswith(".inp"): + # self.setup_file_id(file_path, "input") + # if file_path.endswith(".out"): + # self.setup_file_id(file_path, "output") + + # # Include files + # input_file = self.get_file_contents("input") + # for line in input_file.split("\n"): + # line = line.strip() + # if line.startswith("@INCLUDE") or line.startswith("@include"): + # split = line.split(None, 1) + # filename = split[1] + # if filename.startswith(('\"', '\'')) and filename.endswith(('\"', '\'')): + # filename = filename[1:-1] + # filepath = self.search_file(filename) + # self.setup_file_id(filepath, "include") + + # def parse(self): + # self.implementation.parse() + + # def get_all_quantities(self): + # """Parse all supported quantities.""" + # for method in self.get_supported_quantities: + # self.get_quantity(method) + + # def start_parsing(self, name): + # """Inherited from NomadParser. + # """ + # # Ask the implementation for the quantity + # function = getattr(self.implementation, "_Q_" + name) + # if function: + # return function() + # else: + # logger.error("The function for quantity '{}' is not defined".format(name)) + + # def get_supported_quantities(self): + # """Inherited from NomadParser. + # """ + # supported_quantities = [] + # implementation_methods = [method for method in dir(self.implementation) if callable(getattr(self.implementation, method))] + # for method in implementation_methods: + # if method.startswith("_Q_"): + # method = method[3:] + # supported_quantities.append(method) + + # return supported_quantities + + +# #=============================================================================== +# class CP2KImplementation(object): + # """Defines the basic functions that are used to map results to the + # corresponding NoMaD quantities. + + # This class provides the basic implementations and for a version specific + # updates and additions please make a new class that inherits from this. + + # The functions that return certain quantities are tagged with a prefix '_Q_' + # to be able to automatically determine which quantities have at least some + # level of support. With the tag they can be also looped through. + # """ + # def __init__(self, parser): + # self.parser = parser + # self.regexs = parser.regexs + # self.regexengine = parser.regexengine + # self.csvengine = parser.csvengine + # self.atomsengine = parser.atomsengine + # self.input_tree = parser.input_tree + + # # Define the output parsing tree for this version + # self.outputstructure = SM( + # name='root', + # startReStr="", + # subMatchers=[ + # SM( + # name='new_run', + # startReStr=r" DBCSR\| Multiplication driver", + # endReStr="[.\*]+PROGRAM STOPPED IN", + # required=True, + # sections=['section_run'], + # subMatchers=[ + # SM( + # name="run_datetime", + # startReStr=r"[\*\s]+PROGRAM STARTED AT\s+(?P<cp2k_run_start_date>\d{4}-\d{2}-\d{2}) (?P<cp2k_run_start_time>\d{2}:\d{2}:\d{2}.\d{3})", + # ), + # SM( + # name="version", + # startReStr=r" CP2K\| version string:\s+(?P<program_version>[\w\d\W\s]+)", + # ), + # SM( + # name="svn_revision", + # startReStr=r" CP2K\| source code revision number:\s+svn:(?P<cp2k_svn_revision>\d+)", + # ), + # SM( + # name="cell", + # startReStr=" CELL\|", + # forwardMatch=True, + # subMatchers=[ + # SM( + # name="cell_a", + # startReStr=" CELL\| Vector a \[angstrom\]:\s+(?P<cp2k_cell_vector_a>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + # ), + # SM( + # name="cell_b", + # startReStr=" CELL\| Vector b \[angstrom\]:\s+(?P<cp2k_cell_vector_b>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + # ), + # SM( + # name="cell_c", + # startReStr=" CELL\| Vector c \[angstrom\]:\s+(?P<cp2k_cell_vector_c>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + # ), + # ] + # ) + # ] + # ) + # ] + # ) + + # # The cache settings + # self.cachingLevelForMetaName = { + # 'cp2k_cell_vector_a': CachingLevel.Cache, + # 'cp2k_cell_vector_b': CachingLevel.Cache, + # 'cp2k_cell_vector_c': CachingLevel.Cache, + # } + + # def parse(self): + # """Parses everything that can be found from the given files. The + # results are outputted to std.out by using the backend. The scala layer + # will the take on from that. + # """ + # # Write the starting bracket + # self.parser.stream.write("[") + + # # Use the SimpleMatcher to extract most of the results + # parserInfo = {"name": "cp2k-parser", "version": "1.0"} + # outputfilename = self.parser.get_file_handle("output").name + # metainfoenv = self.parser.metainfoenv + # backend = self.parser.backend + # outputstructure = self.outputstructure + # self.parser.parse_file(outputfilename, outputstructure, metainfoenv, backend, parserInfo, self.cachingLevelForMetaName) + + # # Then extract the things that cannot be extracted by the SimpleMatcher + + # # Write the ending bracket + # self.parser.stream.write("]\n") + + # # def dateconverter(datestring): + + # def _Q_energy_total(self): + # """Return the total energy from the bottom of the input file""" + # result = Result() + # result.unit = "hartree" + # result.value = float(self.regexengine.parse(self.regexs.energy_total, self.parser.get_file_handle("output"))) + # return result + + # def _Q_XC_functional(self): + # """Returns the type of the XC functional. + + # Can currently only determine version if they are declared as parameters + # for XC_FUNCTIONAL or via activating subsections of XC_FUNCTIONAL. + + # Returns: + # A string containing the final result that should + # belong to the list defined in NoMaD wiki. + # """ + # result = Result() + + # # First try to look at the shortcut + # xc_shortcut = self.input_tree.get_parameter("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL") + # if xc_shortcut is not None and xc_shortcut != "NONE" and xc_shortcut != "NO_SHORTCUT": + # logger.debug("Shortcut defined for XC_FUNCTIONAL") + + # # If PBE, check version + # if xc_shortcut == "PBE": + # pbe_version = self.input_tree.get_keyword("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL/PBE/PARAMETRIZATION") + # result.value = { + # 'ORIG': "GGA_X_PBE", + # 'PBESOL': "GGA_X_PBE_SOL", + # 'REVPBE': "GGA_X_PBE_R", + # }.get(pbe_version, "GGA_X_PBE") + # return result + + # result.value = { + # 'B3LYP': "HYB_GGA_XC_B3LYP", + # 'BEEFVDW': None, + # 'BLYP': "GGA_C_LYP_GGA_X_B88", + # 'BP': None, + # 'HCTH120': None, + # 'OLYP': None, + # 'LDA': "LDA_XC_TETER93", + # 'PADE': "LDA_XC_TETER93", + # 'PBE0': None, + # 'TPSS': None, + # }.get(xc_shortcut, None) + # return result + # else: + # logger.debug("No shortcut defined for XC_FUNCTIONAL. Looking into subsections.") + + # # Look at the subsections and determine what part have been activated + + # # Becke88 + # xc_components = [] + # becke_88 = self.input_tree.get_parameter("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL/BECKE88") + # if becke_88 == "TRUE": + # xc_components.append("GGA_X_B88") + + # # Becke 97 + # becke_97 = self.input_tree.get_parameter("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL/BECKE97") + # if becke_97 == "TRUE": + # becke_97_param = self.input_tree.get_keyword("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL/BECKE97/PARAMETRIZATION") + # becke_97_result = { + # 'B97GRIMME': None, + # 'B97_GRIMME': None, + # 'ORIG': "GGA_XC_B97", + # 'WB97X-V': None, + # }.get(becke_97_param, None) + # if becke_97_result is not None: + # xc_components.append(becke_97_result) + + # # Return an alphabetically sorted and joined list of the xc components + # result.value = "_".join(sorted(xc_components)) + # return result + + # def _Q_particle_forces(self): + # """Return the forces that are controlled by + # "FORCE_EVAL/PRINT/FORCES/FILENAME". These forces are typicalle printed + # out during optimization or single point calculation. + + # Supports forces printed in the output file or in a single XYZ file. + # """ + # result = Result() + # result.unit = "force_au" + + # # Determine if a separate force file is used or are the forces printed + # # in the output file. + # separate_file = True + # filename = self.input_tree.get_keyword("FORCE_EVAL/PRINT/FORCES/FILENAME") + # if not filename or filename == "__STD_OUT__": + # separate_file = False + + # # Look for the forces either in output or in separate file + # if not separate_file: + # logger.debug("Looking for forces in output file.") + # forces = self.regexengine.parse(self.regexs.particle_forces, self.parser.get_file_handle("output")) + # if forces is None: + # msg = "No force configurations were found when searching the output file." + # logger.warning(msg) + # result.error_message = msg + # result.code = ResultCode.fail + # return result + + # # Insert force configuration into the array + # i_conf = 0 + # force_array = None + # for force_conf in forces: + # iterator = self.csvengine.iread(force_conf, columns=(-3, -2, -1), comments=("#", "ATOMIC", "SUM"), separator=None) + # i_force_array = iterator.next() + + # # Initialize the numpy array if not done yet + # n_particles = i_force_array.shape[0] + # n_dim = i_force_array.shape[1] + # n_confs = len(forces) + # force_array = np.empty((n_confs, n_particles, n_dim)) + + # force_array[i_conf, :, :] = i_force_array + # i_conf += 1 + + # result.value_iterable = force_array + # return result + # else: + # logger.debug("Looking for forces in separate force file.") + # iterator = self.csvengine.iread(self.parser.get_file_handle("forces"), columns=(-3, -2, -1), comments=("#", "SUM"), separator=r"\ ATOMIC FORCES in \[a\.u\.\]") + # result.value_iterable = iterator + # return result + + # def _Q_particle_number(self): + # """Return the number of particles in the system. + + # CP2K output doesn't automatically print the number of atoms. For this + # reason this function has to look at the initial configuration and + # calculate the number from it. The initial configuration is something + # that must be present for all calculations. + # """ + # result = Result() + # result.cache = True + + # # Check where the coordinates are specified + # coord_format = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/TOPOLOGY/COORD_FILE_FORMAT") + # if not coord_format: + # coord_format = self.input_tree.get_keyword_default("FORCE_EVAL/SUBSYS/TOPOLOGY/COORD_FILE_FORMAT") + + # # Check if the unit cell is multiplied programmatically + # multiples = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/TOPOLOGY/MULTIPLE_UNIT_CELL") + # if not multiples: + # multiples = self.input_tree.get_keyword_default("FORCE_EVAL/SUBSYS/TOPOLOGY/MULTIPLE_UNIT_CELL") + # factors = [int(x) for x in multiples.split()] + # factor = np.prod(np.array(factors)) + + # # See if the coordinates are provided in the input file + # if coord_format == "OFF": + # logger.debug("Using coordinates from the input file.") + # coords = self.input_tree.get_default_keyword("FORCE_EVAL/SUBSYS/COORD") + # coords.strip() + # n_particles = coords.count("\n") + # result.value = factor*n_particles + # elif coord_format in ["CP2K", "G96", "XTL", "CRD"]: + # msg = "Tried to read the number of atoms from the initial configuration, but the parser does not yet support the '{}' format that is used by file '{}'.".format(coord_format, self.parser.file_ids["initial_coordinates"]) + # logger.warning(msg) + # result.error_message = msg + # result.code = ResultCode.fail + # else: + # # External file, use AtomsEngine + # init_coord_file = self.parser.get_file_handle("initial_coordinates") + # if coord_format == "XYZ": + # n_particles = self.atomsengine.n_atoms(init_coord_file, format="xyz") + # if coord_format == "CIF": + # n_particles = self.atomsengine.n_atoms(init_coord_file, format="cif") + # if coord_format == "PDB": + # n_particles = self.atomsengine.n_atoms(init_coord_file, format="pdb") + + # result.value = factor*n_particles + # return result + + # def _Q_particle_position(self): + # """Returns the particle positions (trajectory). + # """ + # result = Result() + + # # Determine the unit + # unit_path = "MOTION/PRINT/TRAJECTORY/UNIT" + # unit = self.input_tree.get_keyword(unit_path) + # unit = unit.lower() + # result.unit = CP2KInput.decode_cp2k_unit(unit) + + # # Read the trajectory + # traj_file = self.parser.get_file_handle("trajectory") + # input_file_format = self.input_tree.get_keyword("MOTION/PRINT/TRAJECTORY/FORMAT") + # file_format = { + # "XYZ": "xyz", + # "XMOL": "xyz", + # "PDB": "pdb-cp2k", + # "ATOMIC": "atomic", + # }.get(input_file_format) + + # if file_format is None: + # logger.error("Unsupported trajectory file format '{}'.".format(input_file_format)) + + # # Use a custom implementation for the CP2K specific weird formats + # if file_format == "pdb-cp2k": + # traj_iter = self.parser.csvengine.iread(traj_file, columns=[3, 4, 5], comments=["TITLE", "AUTHOR", "REMARK", "CRYST"], separator="END") + # elif file_format == "atomic": + # n_atoms = self.parser.get_result_object("particle_number").value + + # def atomic_generator(): + # conf = [] + # i = 0 + # for line in traj_file: + # line = line.strip() + # components = np.array([float(x) for x in line.split()]) + # conf.append(components) + # i += 1 + # if i == n_atoms: + # yield np.array(conf) + # conf = [] + # i = 0 + # traj_iter = atomic_generator() + # else: + # traj_iter = self.atomsengine.iread(traj_file, format=file_format) + + # # Return the iterator + # result.value_iterable = traj_iter + # return result + + # def _Q_cell(self): + # """The cell size can be static or dynamic if e.g. doing NPT. If the + # cell size changes, outputs an Nx3x3 array where N is typically the + # number of timesteps. + # """ + + # def cell_generator(cell_file): + # for line in cell_file: + # line = line.strip() + # if line.startswith("#"): + # continue + # split = line.split() + # A = [float(x) for x in split[2:5]] + # B = [float(x) for x in split[5:8]] + # C = [float(x) for x in split[8:11]] + # result = np.array([A, B, C])*factor + # yield result + + # result = Result() + + # # Determine if the cell is printed during simulation steps + # cell_output_file = self.parser.get_file_handle("cell_output") + # A = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/A") + # B = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/B") + # C = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/C") + # ABC = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/ABC") + # abg = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/ALPHA_BETA_GAMMA") + # cell_input_file = self.parser.get_file_handle("cell_input") + + # # Multiplication factor + # multiples = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/MULTIPLE_UNIT_CELL") + # factors = [int(x) for x in multiples.split()] + # factor = np.prod(np.array(factors)) + + # # Separate file from e.g. NPT + # if cell_output_file: + # logger.debug("Cell output file found.") + # result.unit = "angstrom" + # result.value_iterable = cell_generator(cell_output_file) + # return result + + # # Cartesian cell vectors + # elif A and B and C: + # logger.debug("Cartesian cell vectors found.") + # # Cell given as three vectors + # A_unit = self.input_tree.get_unit("FORCE_EVAL/SUBSYS/CELL/A") + # B_unit = self.input_tree.get_unit("FORCE_EVAL/SUBSYS/CELL/B") + # C_unit = self.input_tree.get_unit("FORCE_EVAL/SUBSYS/CELL/C") + + # A = np.array([float(x) for x in A.split()]) + # B = np.array([float(x) for x in B.split()]) + # C = np.array([float(x) for x in C.split()]) + + # # Convert already here as the different vectors may have different units + # A = convert_unit(A, A_unit) + # B = convert_unit(B, B_unit) + # C = convert_unit(C, C_unit) + + # cell = np.empty((3, 3)) + # cell[0, :] = A + # cell[1, :] = B + # cell[2, :] = C + # result.value = cell*factor + # return result + + # # Cell vector magnitudes and angles + # elif ABC and abg: + # logger.debug("Cell vectors defined with angles and magnitudes found.") + # # Cell given as three vectors + # ABC_unit = self.input_tree.get_unit("FORCE_EVAL/SUBSYS/CELL/ABC") + # abg_unit = self.input_tree.get_unit("FORCE_EVAL/SUBSYS/CELL/ALPHA_BETA_GAMMA") + + # angles = np.array([float(x) for x in abg.split()]) + # magnitudes = np.array([float(x) for x in ABC.split()]) + # a = magnitudes[0] + # b = magnitudes[1] + # c = magnitudes[2] + + # # Convert angles to radians + # angles = (angles*ureg(abg_unit)).to(ureg.radian).magnitude + # alpha = angles[0] + # beta = angles[1] + # gamma = angles[2] + + # A = np.array((a, 0, 0)) + # B = np.array((b*math.cos(gamma), b*math.sin(gamma), 0)) + # b_x = B[0] + # b_y = B[1] + # c_x = c*math.cos(beta) + # c_y = 1.0/b_y*(b*c*math.cos(alpha) - b_x*c_x) + # c_z = math.sqrt(c**2 - c_x**2 - c_y**2) + # C = np.array((c_x, c_y, c_z)) + + # cell = np.zeros((3, 3)) + # cell[0, :] = A + # cell[1, :] = B + # cell[2, :] = C + # result.value = cell*factor + # result.unit = ABC_unit + # return result + + # # Separate cell input file + # elif cell_input_file: + # logger.debug("Separate cell input file found.") + # filename = cell_input_file.name + # if filename.endswith(".cell"): + # logger.debug("CP2K specific cell input file format found.") + # result.value = cell_generator(cell_input_file).next() + # result.unit = "angstrom" + # return result + # else: + # logger.error("The XSC cell file format is not yet supported.") + + # # No cell found + # else: + # logger.error("Could not find cell declaration.") + + +# #=============================================================================== +# class CP2K_262_Implementation(CP2KImplementation): + # def __init__(self, parser): + # CP2KImplementation.__init__(self, parser) diff --git a/cp2kparser/implementation/parser.py b/cp2kparser/implementation/implementations.py similarity index 81% rename from cp2kparser/implementation/parser.py rename to cp2kparser/implementation/implementations.py index 3fb39f689ee1a62126bceb62f997951137845adf..48ee75a5431663d9904e513fdc0e3d0e54b7d52e 100644 --- a/cp2kparser/implementation/parser.py +++ b/cp2kparser/implementation/implementations.py @@ -1,90 +1,65 @@ +import re import os -import re2 as re -from cp2kparser.generics.nomadparser import NomadParser -from cp2kparser.implementation.regexs import * -from cp2kparser.engines.regexengine import RegexEngine +import logging from cp2kparser.engines.csvengine import CSVEngine -from cp2kparser.engines.cp2kinputengine import CP2KInputEngine -from cp2kparser.engines.xmlengine import XMLEngine +from cp2kparser.implementation.cp2kinputparsers import CP2KInputEngine +from cp2kparser.implementation.outputparsers import * from nomadcore.coordinate_reader import CoordinateReader -from nomadcore.unit_conversion.unit_conversion import convert_unit, ureg -from nomadcore.simple_parser import SimpleMatcher as SM -from cp2kparser.engines.cp2kinputenginedata.input_tree import CP2KInput -import numpy as np -import logging -import sys +from cp2kparser.generics.nomadparser import NomadParser logger = logging.getLogger(__name__) -import math #=============================================================================== -class CP2KParser(NomadParser): - """The interface for a NoMaD CP2K parser. All parsing actions will go - through this class. +class CP2KImplementation262(NomadParser): + """Defines the basic functions that are used to map results to the + corresponding NoMaD quantities. - The CP2K version 2.6.2 was used as a reference for this basic - implementation. For other versions there should be classes that extend from - this. + This class provides the basic implementations and for a version specific + updates and additions please make a new class that inherits from this. + + The functions that return certain quantities are tagged with a prefix '_Q_' + to be able to automatically determine which quantities have at least some + level of support. With the tag they can be also looped through. """ - def __init__(self, input_json_string, stream=sys.stdout, test_mode=False): + def __init__(self, parser_context): # Initialize the base class - NomadParser.__init__(self, input_json_string, stream, test_mode) + NomadParser.__init__(self, parser_context) # Engines are created here self.csvengine = CSVEngine(self) - self.regexengine = RegexEngine(self) - self.xmlengine = XMLEngine(self) self.inputengine = CP2KInputEngine() self.atomsengine = CoordinateReader() + self.outputparser = globals()["CP2KOutputParser{}".format(self.version_id)]() - self.version_number = None - self.implementation = None self.input_tree = None - self.regexs = None self.extended_input = None self.determine_file_ids_pre_setup() self.input_preprocessor() - self.setup_version() self.determine_file_ids_post_setup() - def setup_version(self): - """Setups the version by looking at the output file and the version - specified in it. + def determine_file_ids_pre_setup(self): + """First resolve the files that can be identified by extension. """ - # Determine the CP2K version from the output file - beginning = self.read_part_of_file("output", 2048) - version_regex = re.compile(r"CP2K\|\ version\ string:\s+CP2K\ version\ (\d+\.\d+\.\d+)\n") - self.version_number = version_regex.search(beginning).groups()[0].replace('.', '') - self.inputengine.setup_version_number(self.version_number) - self.input_tree = self.inputengine.parse(self.extended_input) - version_name = '_' + self.version_number + '_' - - # Search for a version specific regex class - class_name = "CP2K{}Regexs".format(version_name) - self.regexs = globals().get(class_name) - if self.regexs: - logger.debug("Using version specific regexs '{}'.".format(class_name)) - self.regexs = self.regexs() - else: - logger.debug("Using default regexs.") - self.regexs = globals()["CP2KRegexs"]() - - # Search for a version specific implementation - class_name = "CP2K{}Implementation".format(version_name) - class_object = globals().get(class_name) - if class_object: - logger.debug("Using version specific implementation '{}'.".format(class_name)) - self.implementation = class_object(self) - else: - logger.debug("Using default implementation.") - self.implementation = globals()["CP2KImplementation"](self) + # Input and output files + for file_path in self.files.iterkeys(): + if file_path.endswith(".inp"): + self.setup_file_id(file_path, "input") + if file_path.endswith(".out"): + self.setup_file_id(file_path, "output") - def read_part_of_file(self, file_id, size=1024): - fh = self.get_file_handle(file_id) - buffer = fh.read(size) - return buffer + # Include files + input_file = self.get_file_contents("input") + for line in input_file.split("\n"): + line = line.strip() + if line.startswith("@INCLUDE") or line.startswith("@include"): + split = line.split(None, 1) + filename = split[1] + if filename.startswith(('\"', '\'')) and filename.endswith(('\"', '\'')): + filename = filename[1:-1] + filepath = self.search_file(filename) + self.setup_file_id(filepath, "include") def input_preprocessor(self): """Preprocess the input file. Concatenate .inc files into the main input file and @@ -167,29 +142,8 @@ class CP2KParser(NomadParser): input_variables_replaced.append(new_line) self.extended_input = '\n'.join(input_variables_replaced) - # print self.extended_input - - def determine_file_ids_pre_setup(self): - """First resolve the files that can be identified by extension. - """ - # Input and output files - for file_path in self.files.iterkeys(): - if file_path.endswith(".inp"): - self.setup_file_id(file_path, "input") - if file_path.endswith(".out"): - self.setup_file_id(file_path, "output") - - # Include files - input_file = self.get_file_contents("input") - for line in input_file.split("\n"): - line = line.strip() - if line.startswith("@INCLUDE") or line.startswith("@include"): - split = line.split(None, 1) - filename = split[1] - if filename.startswith(('\"', '\'')) and filename.endswith(('\"', '\'')): - filename = filename[1:-1] - filepath = self.search_file(filename) - self.setup_file_id(filepath, "include") + self.inputengine.setup_version(self.version_id) + self.input_tree = self.inputengine.parse(self.extended_input) def determine_file_ids_post_setup(self): """Determines the file id's after the CP2K verion has been set @@ -312,106 +266,27 @@ class CP2KParser(NomadParser): break return folders - def parse(self): - self.implementation.parse() - - # def get_all_quantities(self): - # """Parse all supported quantities.""" - # for method in self.get_supported_quantities: - # self.get_quantity(method) - - # def start_parsing(self, name): - # """Inherited from NomadParser. - # """ - # # Ask the implementation for the quantity - # function = getattr(self.implementation, "_Q_" + name) - # if function: - # return function() - # else: - # logger.error("The function for quantity '{}' is not defined".format(name)) - - # def get_supported_quantities(self): - # """Inherited from NomadParser. - # """ - # supported_quantities = [] - # implementation_methods = [method for method in dir(self.implementation) if callable(getattr(self.implementation, method))] - # for method in implementation_methods: - # if method.startswith("_Q_"): - # method = method[3:] - # supported_quantities.append(method) - - # return supported_quantities - - -#=============================================================================== -class CP2KImplementation(object): - """Defines the basic functions that are used to map results to the - corresponding NoMaD quantities. - - This class provides the basic implementations and for a version specific - updates and additions please make a new class that inherits from this. - - The functions that return certain quantities are tagged with a prefix '_Q_' - to be able to automatically determine which quantities have at least some - level of support. With the tag they can be also looped through. - """ - def __init__(self, parser): - self.parser = parser - self.regexs = parser.regexs - self.regexengine = parser.regexengine - self.csvengine = parser.csvengine - self.atomsengine = parser.atomsengine - self.input_tree = parser.input_tree - - # Define the output parsing tree for this version - self.outputstructure = SM( - name='root', - startReStr="", - subMatchers=[ - SM( - name='new_run', - startReStr=r" DBCSR\| Multiplication driver", - endReStr="[.\*]+PROGRAM STOPPED IN", - required=True, - sections=['section_run'], - subMatchers=[ - SM( - name="run_datetime", - startReStr=r"[\*\s]+PROGRAM STARTED AT\s+(?P<cp2k_run_start_date>\d{4}-\d{2}-\d{2}) (?P<cp2k_run_start_time>\d{2}:\d{2}:\d{2}.\d{3})", - ), - SM( - name="version", - startReStr=r" CP2K\| version string:\s+(?P<program_version>[\w\d\W\s]+)", - ), - SM( - name="svn_revision", - startReStr=r" CP2K\| source code revision number:\s+svn:(?P<cp2k_svn_revision>\d+)", - ) - ] - ) - ] - ) - def parse(self): """Parses everything that can be found from the given files. The results are outputted to std.out by using the backend. The scala layer will the take on from that. """ # Write the starting bracket - self.parser.stream.write("[") + self.stream.write("[") # Use the SimpleMatcher to extract most of the results parserInfo = {"name": "cp2k-parser", "version": "1.0"} - outputfilename = self.parser.get_file_handle("output").name - metainfoenv = self.parser.metainfoenv - backend = self.parser.backend - outputstructure = self.outputstructure - self.parser.parse_file(outputfilename, outputstructure, metainfoenv, backend, parserInfo) + outputfilename = self.get_file_handle("output").name + metainfoenv = self.metainfoenv + backend = self.backend + outputstructure = self.outputparser.outputstructure + cachingLevelForMetaName = self.outputparser.cachingLevelForMetaName + self.parse_file(outputfilename, outputstructure, metainfoenv, backend, parserInfo, cachingLevelForMetaName) # Then extract the things that cannot be extracted by the SimpleMatcher # Write the ending bracket - self.parser.stream.write("]\n") + self.stream.write("]\n") # def dateconverter(datestring): @@ -758,7 +633,7 @@ class CP2KImplementation(object): logger.error("Could not find cell declaration.") -#=============================================================================== -class CP2K_262_Implementation(CP2KImplementation): - def __init__(self, parser): - CP2KImplementation.__init__(self, parser) +# #=============================================================================== +# class CP2K_262_Implementation(CP2KImplementation): + # def __init__(self, parser): + # CP2KImplementation.__init__(self, parser) diff --git a/cp2kparser/implementation/outputparsers.py b/cp2kparser/implementation/outputparsers.py new file mode 100644 index 0000000000000000000000000000000000000000..863f106334767702995120d73e1b6df0afbdb325 --- /dev/null +++ b/cp2kparser/implementation/outputparsers.py @@ -0,0 +1,71 @@ +from nomadcore.simple_parser import SimpleMatcher as SM +from nomadcore.caching_backend import CachingLevel + + +#=============================================================================== +class CP2KOutputParser262(object): + """The object that goes through the CP2K outputfile and parses everything + it can using the SimpleParser architecture. + """ + + # Define the output parsing tree for this version + outputstructure = SM( + name='root', + startReStr="", + subMatchers=[ + SM( + name='new_run', + startReStr=r" DBCSR\| Multiplication driver", + endReStr="[.\*]+PROGRAM STOPPED IN", + required=True, + sections=['section_run'], + subMatchers=[ + SM( + name="run_datetime", + startReStr=r"[\*\s]+PROGRAM STARTED AT\s+(?P<cp2k_run_start_date>\d{4}-\d{2}-\d{2}) (?P<cp2k_run_start_time>\d{2}:\d{2}:\d{2}.\d{3})", + ), + SM( + name="version", + startReStr=r" CP2K\| version string:\s+(?P<program_version>[\w\d\W\s]+)", + ), + SM( + name="svn_revision", + startReStr=r" CP2K\| source code revision number:\s+svn:(?P<cp2k_svn_revision>\d+)", + ), + SM( + name="cell", + startReStr=" CELL\|", + forwardMatch=True, + subMatchers=[ + SM( + name="cell_a", + startReStr=" CELL\| Vector a \[angstrom\]:\s+(?P<cp2k_cell_vector_a>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + ), + SM( + name="cell_b", + startReStr=" CELL\| Vector b \[angstrom\]:\s+(?P<cp2k_cell_vector_b>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + ), + SM( + name="cell_c", + startReStr=" CELL\| Vector c \[angstrom\]:\s+(?P<cp2k_cell_vector_c>[\d\.]+\s+[\d\.]+\s+[\d\.]+)+" + ), + ] + ) + ] + ) + ] + ) + + # The cache settings + cachingLevelForMetaName = { + 'cp2k_cell_vector_a': CachingLevel.Cache, + 'cp2k_cell_vector_b': CachingLevel.Cache, + 'cp2k_cell_vector_c': CachingLevel.Cache, + } + + # The trigger functions + def onClose_section_single_configuration_calculation(self, backend, gIndex, section): + """trigger called when section_single_configuration_calculation is closed""" + backend.addValue('scf_dft_number_of_iterations', self.scfIterNr) + # start with -1 since zeroth iteration is the initialization + self.scfIterNr = -1 diff --git a/cp2kparser/tests/cp2k_2.6.2/functionals/becke88/becke88.out b/cp2kparser/tests/cp2k_2.6.2/functionals/becke88/becke88.out index d990a99abf8c718fe06c4540ae8aac06cc98065a..14864692ed12c649ee6d81d85cdd577dce9eb350 100644 --- a/cp2kparser/tests/cp2k_2.6.2/functionals/becke88/becke88.out +++ b/cp2kparser/tests/cp2k_2.6.2/functionals/becke88/becke88.out @@ -9,13 +9,13 @@ DBCSR| Communication thread load 87 - **** **** ****** ** PROGRAM STARTED AT 2015-11-06 15:54:15.097 + **** **** ****** ** PROGRAM STARTED AT 2015-12-21 09:24:05.578 ***** ** *** *** ** PROGRAM STARTED ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM STARTED BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 14586 - **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/cp2 - k_2.6.2/functionals/becke88 + ***** ** ** ** ** PROGRAM PROCESS ID 15049 + **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/becke88 CP2K| version string: CP2K version 2.6.2 CP2K| source code revision number: svn:15893 @@ -45,13 +45,13 @@ MEMORY| system memory details [Kb] MEMORY| rank 0 min max average - MEMORY| MemTotal 8070396 8070396 8070396 8070396 - MEMORY| MemFree 3032756 3032756 3032756 3032756 - MEMORY| Buffers 518912 518912 518912 518912 - MEMORY| Cached 2598820 2598820 2598820 2598820 - MEMORY| Slab 340324 340324 340324 340324 - MEMORY| SReclaimable 297836 297836 297836 297836 - MEMORY| MemLikelyFree 6448324 6448324 6448324 6448324 + MEMORY| MemTotal 8070392 8070392 8070392 8070392 + MEMORY| MemFree 5003032 5003032 5003032 5003032 + MEMORY| Buffers 228864 228864 228864 228864 + MEMORY| Cached 1778896 1778896 1778896 1778896 + MEMORY| Slab 238004 238004 238004 238004 + MEMORY| SReclaimable 204124 204124 204124 204124 + MEMORY| MemLikelyFree 7214916 7214916 7214916 7214916 GENERATE| Preliminary Number of Bonds generated: 0 @@ -250,14 +250,14 @@ ROUTINE CALLS TOT TIME [s] AVE VOLUME [Bytes] PERFORMANCE [MB/s] MP_Group 3 0.000 - MP_Bcast 102 0.000 4. 1.66 - MP_Allreduce 1060 0.001 8. 14.98 + MP_Bcast 102 0.000 4. 0.93 + MP_Allreduce 1060 0.001 8. 8.64 MP_Sync 2 0.000 - MP_Alltoall 2316 0.002 522. 784.22 + MP_Alltoall 2316 0.003 522. 482.68 MP_Wait 2424 0.001 - MP_ISend 808 0.002 228. 115.71 - MP_IRecv 808 0.000 228. 394.75 - MP_Memory 2424 0.001 + MP_ISend 808 0.002 228. 89.97 + MP_IRecv 808 0.001 228. 263.78 + MP_Memory 2424 0.002 ------------------------------------------------------------------------------- @@ -334,45 +334,44 @@ ------------------------------------------------------------------------------- SUBROUTINE CALLS ASD SELF TIME TOTAL TIME MAXIMUM AVERAGE MAXIMUM AVERAGE MAXIMUM - CP2K 1 1.0 0.002 0.002 1.095 1.095 - qs_forces 1 2.0 0.000 0.000 1.068 1.068 - qs_energies_scf 1 3.0 0.000 0.000 1.056 1.056 - scf_env_do_scf 1 4.0 0.000 0.000 1.041 1.041 - scf_env_do_scf_inner_loop 100 5.0 0.008 0.008 1.041 1.041 - rebuild_ks_matrix 101 7.0 0.000 0.000 0.767 0.767 - qs_ks_build_kohn_sham_matrix 101 8.0 0.005 0.005 0.767 0.767 - qs_ks_update_qs_env 100 6.0 0.001 0.001 0.758 0.758 - qs_vxc_create 101 9.0 0.001 0.001 0.548 0.548 - xc_vxc_pw_create 101 10.0 0.024 0.024 0.547 0.547 - fft_wrap_pw1pw2 1314 10.7 0.006 0.006 0.449 0.449 - fft_wrap_pw1pw2_30 1112 11.8 0.025 0.025 0.431 0.431 - xc_rho_set_and_dset_create 101 11.0 0.058 0.058 0.336 0.336 - fft3d_s 1315 12.7 0.292 0.292 0.303 0.303 - qs_rho_update_rho 101 6.0 0.000 0.000 0.161 0.161 - calculate_rho_elec 101 7.0 0.064 0.064 0.161 0.161 - sum_up_and_integrate 101 9.0 0.003 0.003 0.142 0.142 - integrate_v_rspace 101 10.0 0.080 0.080 0.139 0.139 - xc_functional_eval 101 12.0 0.001 0.001 0.136 0.136 - xb88_lda_eval 101 13.0 0.136 0.136 0.136 0.136 - density_rs2pw 101 8.0 0.001 0.001 0.095 0.095 - calculate_dm_sparse 100 6.0 0.000 0.000 0.062 0.062 - cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.002 0.002 0.062 0.062 - pw_scatter_s 707 13.0 0.061 0.061 0.061 0.061 - pw_gather_s 607 12.5 0.053 0.053 0.053 0.053 - potential_pw2rs 101 11.0 0.001 0.001 0.053 0.053 - dbcsr_mm_cannon_multiply 101 8.0 0.004 0.004 0.046 0.046 - pw_derive 606 11.5 0.039 0.039 0.039 0.039 - dbcsr_complete_redistribute 302 9.0 0.011 0.011 0.025 0.025 - pw_copy 909 11.2 0.024 0.024 0.024 0.024 - copy_dbcsr_to_fm 400 7.0 0.003 0.003 0.023 0.023 - quickstep_create_force_env 1 2.0 0.000 0.000 0.023 0.023 - pw_poisson_solve 101 9.0 0.017 0.017 0.023 0.023 + CP2K 1 1.0 0.002 0.002 1.588 1.588 + qs_forces 1 2.0 0.000 0.000 1.548 1.548 + qs_energies_scf 1 3.0 0.000 0.000 1.535 1.535 + scf_env_do_scf 1 4.0 0.000 0.000 1.513 1.513 + scf_env_do_scf_inner_loop 100 5.0 0.011 0.011 1.513 1.513 + rebuild_ks_matrix 101 7.0 0.000 0.000 1.085 1.085 + qs_ks_build_kohn_sham_matrix 101 8.0 0.009 0.009 1.085 1.085 + qs_ks_update_qs_env 100 6.0 0.001 0.001 1.076 1.076 + qs_vxc_create 101 9.0 0.002 0.002 0.773 0.773 + xc_vxc_pw_create 101 10.0 0.030 0.030 0.771 0.771 + fft_wrap_pw1pw2 1314 10.7 0.016 0.016 0.683 0.683 + fft_wrap_pw1pw2_30 1112 11.8 0.036 0.036 0.650 0.650 + xc_rho_set_and_dset_create 101 11.0 0.087 0.087 0.460 0.460 + fft3d_s 1315 12.7 0.439 0.439 0.457 0.457 + qs_rho_update_rho 101 6.0 0.001 0.001 0.250 0.250 + calculate_rho_elec 101 7.0 0.101 0.101 0.249 0.249 + sum_up_and_integrate 101 9.0 0.004 0.004 0.206 0.206 + integrate_v_rspace 101 10.0 0.112 0.112 0.202 0.202 + xc_functional_eval 101 12.0 0.001 0.001 0.157 0.157 + xb88_lda_eval 101 13.0 0.156 0.156 0.156 0.156 + density_rs2pw 101 8.0 0.002 0.002 0.146 0.146 + calculate_dm_sparse 100 6.0 0.000 0.000 0.098 0.098 + cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.002 0.002 0.098 0.098 + pw_scatter_s 707 13.0 0.089 0.089 0.089 0.089 + pw_gather_s 607 12.5 0.084 0.084 0.084 0.084 + potential_pw2rs 101 11.0 0.002 0.002 0.081 0.081 + dbcsr_mm_cannon_multiply 101 8.0 0.007 0.007 0.072 0.072 + pw_derive 606 11.5 0.055 0.055 0.055 0.055 + dbcsr_complete_redistribute 302 9.0 0.017 0.017 0.038 0.038 + quickstep_create_force_env 1 2.0 0.000 0.000 0.037 0.037 + copy_dbcsr_to_fm 400 7.0 0.004 0.004 0.035 0.035 + pw_copy 909 11.2 0.032 0.032 0.032 0.032 ------------------------------------------------------------------------------- - **** **** ****** ** PROGRAM ENDED AT 2015-11-06 15:54:16.260 + **** **** ****** ** PROGRAM ENDED AT 2015-12-21 09:24:07.281 ***** ** *** *** ** PROGRAM RAN ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM RAN BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 14586 - **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/cp2 - k_2.6.2/functionals/becke88 + ***** ** ** ** ** PROGRAM PROCESS ID 15049 + **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/becke88 diff --git a/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.inp b/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.inp index 28273804aff996ba0c52007588893816ee44d4e2..7ba69ad72dd8ff38ef0693a17906762344d2f335 100644 --- a/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.inp +++ b/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.inp @@ -1,7 +1,6 @@ &GLOBAL RUN_TYPE ENERGY_FORCE PROJECT_NAME si_bulk - PRINT_LEVEL LOW &END GLOBAL &FORCE_EVAL METHOD Quickstep diff --git a/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.out b/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.out index 6e14047f3b5dbe768e72b161431c6e701c692879..fd249cf2fc625917e74aff909e374a6c030f9863 100644 --- a/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.out +++ b/cp2kparser/tests/cp2k_2.6.2/functionals/blyp/blyp.out @@ -9,13 +9,13 @@ DBCSR| Communication thread load 87 - **** **** ****** ** PROGRAM STARTED AT 2015-11-04 09:48:53.237 + **** **** ****** ** PROGRAM STARTED AT 2015-12-21 09:23:40.236 ***** ** *** *** ** PROGRAM STARTED ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM STARTED BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 2044 - **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/2.6 - .2/functionals/blyp + ***** ** ** ** ** PROGRAM PROCESS ID 4707 + **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/blyp CP2K| version string: CP2K version 2.6.2 CP2K| source code revision number: svn:15893 @@ -26,9 +26,9 @@ CP2K| Input file name blyp.inp GLOBAL| Force Environment number 1 - GLOBAL| Basis set file name /home/lauri/BASIS_SET + GLOBAL| Basis set file name ../../data/BASIS_SET GLOBAL| Geminal file name BASIS_GEMINAL - GLOBAL| Potential file name /home/lauri/GTH_POTENTIALS + GLOBAL| Potential file name ../../data/GTH_POTENTIALS GLOBAL| MM Potential file name MM_POTENTIAL GLOBAL| Coordinate file name __STD_INPUT__ GLOBAL| Method name CP2K @@ -38,25 +38,96 @@ GLOBAL| Run type ENERGY_FORCE GLOBAL| All-to-all communication in single precision F GLOBAL| FFTs using library dependent lengths F - GLOBAL| Global print level LOW + GLOBAL| Global print level MEDIUM GLOBAL| Total number of message passing processes 1 GLOBAL| Number of threads for this process 1 GLOBAL| This output is from process 0 MEMORY| system memory details [Kb] MEMORY| rank 0 min max average - MEMORY| MemTotal 8070396 8070396 8070396 8070396 - MEMORY| MemFree 2580024 2580024 2580024 2580024 - MEMORY| Buffers 430360 430360 430360 430360 - MEMORY| Cached 3154096 3154096 3154096 3154096 - MEMORY| Slab 353540 353540 353540 353540 - MEMORY| SReclaimable 313332 313332 313332 313332 - MEMORY| MemLikelyFree 6477812 6477812 6477812 6477812 + MEMORY| MemTotal 8070392 8070392 8070392 8070392 + MEMORY| MemFree 5131604 5131604 5131604 5131604 + MEMORY| Buffers 223976 223976 223976 223976 + MEMORY| Cached 1705180 1705180 1705180 1705180 + MEMORY| Slab 192372 192372 192372 192372 + MEMORY| SReclaimable 159452 159452 159452 159452 + MEMORY| MemLikelyFree 7220212 7220212 7220212 7220212 + *** Fundamental physical constants (SI units) *** + + *** Literature: B. J. Mohr and B. N. Taylor, + *** CODATA recommended values of the fundamental physical + *** constants: 2006, Web Version 5.1 + *** http://physics.nist.gov/constants + + Speed of light in vacuum [m/s] 2.99792458000000E+08 + Magnetic constant or permeability of vacuum [N/A**2] 1.25663706143592E-06 + Electric constant or permittivity of vacuum [F/m] 8.85418781762039E-12 + Planck constant (h) [J*s] 6.62606896000000E-34 + Planck constant (h-bar) [J*s] 1.05457162825177E-34 + Elementary charge [C] 1.60217648700000E-19 + Electron mass [kg] 9.10938215000000E-31 + Electron g factor [ ] -2.00231930436220E+00 + Proton mass [kg] 1.67262163700000E-27 + Fine-structure constant 7.29735253760000E-03 + Rydberg constant [1/m] 1.09737315685270E+07 + Avogadro constant [1/mol] 6.02214179000000E+23 + Boltzmann constant [J/K] 1.38065040000000E-23 + Atomic mass unit [kg] 1.66053878200000E-27 + Bohr radius [m] 5.29177208590000E-11 + + *** Conversion factors *** + + [u] -> [a.u.] 1.82288848426455E+03 + [Angstrom] -> [Bohr] = [a.u.] 1.88972613288564E+00 + [a.u.] = [Bohr] -> [Angstrom] 5.29177208590000E-01 + [a.u.] -> [s] 2.41888432650478E-17 + [a.u.] -> [fs] 2.41888432650478E-02 + [a.u.] -> [J] 4.35974393937059E-18 + [a.u.] -> [N] 8.23872205491840E-08 + [a.u.] -> [K] 3.15774647902944E+05 + [a.u.] -> [kJ/mol] 2.62549961709828E+03 + [a.u.] -> [kcal/mol] 6.27509468713739E+02 + [a.u.] -> [Pa] 2.94210107994716E+13 + [a.u.] -> [bar] 2.94210107994716E+08 + [a.u.] -> [atm] 2.90362800883016E+08 + [a.u.] -> [eV] 2.72113838565563E+01 + [a.u.] -> [Hz] 6.57968392072181E+15 + [a.u.] -> [1/cm] (wave numbers) 2.19474631370540E+05 + [a.u./Bohr**2] -> [1/cm] 5.14048714338585E+03 + + + CELL_TOP| Volume [angstrom^3]: 160.165 + CELL_TOP| Vector a [angstrom 5.431 0.000 0.000 |a| = 5.431 + CELL_TOP| Vector b [angstrom 0.000 5.431 0.000 |b| = 5.431 + CELL_TOP| Vector c [angstrom 0.000 0.000 5.431 |c| = 5.431 + CELL_TOP| Angle (b,c), alpha [degree]: 90.000 + CELL_TOP| Angle (a,c), beta [degree]: 90.000 + CELL_TOP| Angle (a,b), gamma [degree]: 90.000 + CELL_TOP| Numerically orthorhombic: YES + GENERATE| Preliminary Number of Bonds generated: 0 GENERATE| Achieved consistency in connectivity generation. + CELL| Volume [angstrom^3]: 160.165 + CELL| Vector a [angstrom]: 5.431 0.000 0.000 |a| = 5.431 + CELL| Vector b [angstrom]: 0.000 5.431 0.000 |b| = 5.431 + CELL| Vector c [angstrom]: 0.000 0.000 5.431 |c| = 5.431 + CELL| Angle (b,c), alpha [degree]: 90.000 + CELL| Angle (a,c), beta [degree]: 90.000 + CELL| Angle (a,b), gamma [degree]: 90.000 + CELL| Numerically orthorhombic: YES + + CELL_REF| Volume [angstrom^3]: 160.165 + CELL_REF| Vector a [angstrom 5.431 0.000 0.000 |a| = 5.431 + CELL_REF| Vector b [angstrom 0.000 5.431 0.000 |b| = 5.431 + CELL_REF| Vector c [angstrom 0.000 0.000 5.431 |c| = 5.431 + CELL_REF| Angle (b,c), alpha [degree]: 90.000 + CELL_REF| Angle (a,c), beta [degree]: 90.000 + CELL_REF| Angle (a,b), gamma [degree]: 90.000 + CELL_REF| Numerically orthorhombic: YES + ******************************************************************************* ******************************************************************************* ** ** @@ -76,6 +147,156 @@ ** ** ******************************************************************************* + DFT| Spin restricted Kohn-Sham (RKS) calculation RKS + DFT| Multiplicity 1 + DFT| Number of spin states 1 + DFT| Charge 0 + DFT| Self-interaction correction (SIC) NO + DFT| Cutoffs: density 1.000000E-10 + DFT| gradient 1.000000E-10 + DFT| tau 1.000000E-10 + DFT| cutoff_smoothing_range 0.000000E+00 + DFT| XC density smoothing NONE + DFT| XC derivatives PW + FUNCTIONAL| ROUTINE=NEW + FUNCTIONAL| BECKE88: + FUNCTIONAL| A. Becke, Phys. Rev. A 38, 3098 (1988) {LDA version} + FUNCTIONAL| LYP: + FUNCTIONAL| C. Lee, W. Yang, R.G. Parr, Phys. Rev. B, 37, 785 (1988) {LDA versi + FUNCTIONAL| on} + + QS| Method: GPW + QS| Density plane wave grid type NON-SPHERICAL FULLSPACE + QS| Number of grid levels: 2 + QS| Density cutoff [a.u.]: 25.0 + QS| Multi grid cutoff [a.u.]: 1) grid level 25.0 + QS| 2) grid level 8.3 + QS| Grid level progression factor: 3.0 + QS| Relative density cutoff [a.u.]: 12.5 + QS| Consistent realspace mapping and integration + QS| Interaction thresholds: eps_pgf_orb: 3.2E-02 + QS| eps_filter_matrix: 0.0E+00 + QS| eps_core_charge: 1.0E-05 + QS| eps_rho_gspace: 1.0E-03 + QS| eps_rho_rspace: 1.0E-03 + QS| eps_gvg_rspace: 3.2E-02 + QS| eps_ppl: 1.0E-02 + QS| eps_ppnl: 3.2E-04 + + + ATOMIC KIND INFORMATION + + 1. Atomic kind: Si Number of atoms: 1 + + Orbital Basis Set DZVP-GTH-PADE + + Number of orbital shell sets: 2 + Number of orbital shells: 5 + Number of primitive Cartesian functions: 5 + Number of Cartesian basis functions: 14 + Number of spherical basis functions: 13 + Norm type: 2 + + Normalised Cartesian orbitals: + + Set Shell Orbital Exponent Coefficient + + 1 1 3s 1.203242 0.269412 + 0.468841 -0.102290 + 0.167986 -0.147195 + 0.057562 -0.015996 + + 1 2 4s 1.203242 0.000000 + 0.468841 0.000000 + 0.167986 0.000000 + 0.057562 0.083755 + + 1 3 4px 1.203242 0.085242 + 0.468841 -0.143473 + 0.167986 -0.083408 + 0.057562 -0.014565 + 1 3 4py 1.203242 0.085242 + 0.468841 -0.143473 + 0.167986 -0.083408 + 0.057562 -0.014565 + 1 3 4pz 1.203242 0.085242 + 0.468841 -0.143473 + 0.167986 -0.083408 + 0.057562 -0.014565 + + 1 4 5px 1.203242 0.000000 + 0.468841 0.000000 + 0.167986 0.000000 + 0.057562 0.040189 + 1 4 5py 1.203242 0.000000 + 0.468841 0.000000 + 0.167986 0.000000 + 0.057562 0.040189 + 1 4 5pz 1.203242 0.000000 + 0.468841 0.000000 + 0.167986 0.000000 + 0.057562 0.040189 + + 2 1 3dx2 0.450000 0.406941 + 2 1 3dxy 0.450000 0.704842 + 2 1 3dxz 0.450000 0.704842 + 2 1 3dy2 0.450000 0.406941 + 2 1 3dyz 0.450000 0.704842 + 2 1 3dz2 0.450000 0.406941 + + Potential information for GTH-PADE-q4 + + Description: Goedecker-Teter-Hutter pseudopotential + Goedecker et al., PRB 54, 1703 (1996) + Hartwigsen et al., PRB 58, 3641 (1998) + Krack, TCA 114, 145 (2005) + + Gaussian exponent of the core charge distribution: 2.582645 + Electronic configuration (s p d ...): 2 2 + + Parameters of the local part of the GTH pseudopotential: + + rloc C1 C2 C3 C4 + 0.440000 -7.336103 + + Parameters of the non-local part of the GTH pseudopotential: + + l r(l) h(i,j,l) + + 0 0.422738 5.906928 -1.261894 + -1.261894 3.258196 + 1 0.484278 2.727013 + + + MOLECULE KIND INFORMATION + + + All atoms are their own molecule, skipping detailed information + + + TOTAL NUMBERS AND MAXIMUM NUMBERS + + Total number of - Atomic kinds: 1 + - Atoms: 1 + - Shell sets: 2 + - Shells: 5 + - Primitive Cartesian functions: 5 + - Cartesian basis functions: 14 + - Spherical basis functions: 13 + + Maximum angular momentum of- Orbital basis functions: 2 + - Local part of the GTH pseudopotential: 0 + - Non-local part of the GTH pseudopotential: 2 + + + MODULE QUICKSTEP: ATOMIC COORDINATES IN angstrom + + Atom Kind Element X Y Z Z(eff) Mass + + 1 1 Si 14 0.000000 0.000000 0.000000 4.00 28.0855 + + + SCF PARAMETERS Density guess: ATOMIC -------------------------------------------------------- @@ -94,6 +315,64 @@ -------------------------------------------------------- No outer SCF + PW_GRID| Information for grid number 1 + PW_GRID| Cutoff [a.u.] 25.0 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -12 11 Points: 24 + PW_GRID| Bounds 2 -12 11 Points: 24 + PW_GRID| Bounds 3 -12 11 Points: 24 + PW_GRID| Volume element (a.u.^3) 0.7819E-01 Volume (a.u.^3) 1080.8451 + PW_GRID| Grid span FULLSPACE + + PW_GRID| Information for grid number 2 + PW_GRID| Cutoff [a.u.] 8.3 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -7 7 Points: 15 + PW_GRID| Bounds 2 -7 7 Points: 15 + PW_GRID| Bounds 3 -7 7 Points: 15 + PW_GRID| Volume element (a.u.^3) 0.3203 Volume (a.u.^3) 1080.8451 + PW_GRID| Grid span FULLSPACE + + POISSON| Solver PERIODIC + POISSON| Periodicity XYZ + + RS_GRID| Information for grid number 1 + RS_GRID| Bounds 1 -12 11 Points: 24 + RS_GRID| Bounds 2 -12 11 Points: 24 + RS_GRID| Bounds 3 -12 11 Points: 24 + + RS_GRID| Information for grid number 2 + RS_GRID| Bounds 1 -7 7 Points: 15 + RS_GRID| Bounds 2 -7 7 Points: 15 + RS_GRID| Bounds 3 -7 7 Points: 15 + + DISTRIBUTION OF THE PARTICLES (ROWS) + Process row Number of particles Number of matrix rows + 0 1 -1 + Sum 1 -1 + + DISTRIBUTION OF THE PARTICLES (COLUMNS) + Process col Number of particles Number of matrix columns + 0 1 -1 + Sum 1 -1 + + DISTRIBUTION OF THE NEIGHBOR LISTS + Total number of particle pairs: 7 + Total number of matrix elements: 1183 + Average number of particle pairs: 7 + Maximum number of particle pairs: 7 + Average number of matrix element: 1183 + Maximum number of matrix elements: 1183 + + + DISTRIBUTION OF THE OVERLAP MATRIX + Number of non-zero blocks: 1 + Percentage non-zero blocks: 100.00 + Average number of blocks per CPU: 1 + Maximum number of blocks per CPU: 1 + Average number of matrix elements per CPU: 179 + Maximum number of matrix elements per CPU: 179 + Number of electrons: 4 Number of occupied orbitals: 2 Number of molecular orbitals: 2 @@ -103,110 +382,859 @@ Extrapolation method: initial_guess + Atomic guess: The first density matrix is obtained in terms of atomic orbitals + and electronic configurations assigned to each atomic kind + + Guess for atomic kind: Si + + Electronic structure + Total number of core electrons 10.00 + Total number of valence electrons 4.00 + Total number of electrons 14.00 + Multiplicity not specified + S [ 2.00 2.00] 2.00 + P [ 6.00] 2.00 + + + ******************************************************************************* + Iteration Convergence Energy [au] + ******************************************************************************* + 1 0.191310 -3.618313869735 + 2 0.731569E-01 -3.691159009622 + 3 0.405574E-02 -3.699900512584 + 4 0.328704E-02 -3.699908407293 + 5 0.320845E-02 -3.699909118998 + 6 0.316809E-02 -3.699909477757 + 7 0.331859E-05 -3.699923449535 + 8 0.110258E-06 -3.699923449550 + + Energy components [Hartree] Total Energy :: -3.699923449550 + Band Energy :: -1.012729790251 + Kinetic Energy :: 1.397012768229 + Potential Energy :: -5.096936217779 + Virial (-V/T) :: 3.648453567279 + Core Energy :: -5.703543362687 + XC Energy :: -0.980691562795 + Coulomb Energy :: 2.984311475932 + Total Pseudopotential Energy :: -7.145739758818 + Local Pseudopotential Energy :: -7.987908627736 + Nonlocal Pseudopotential Energy :: 0.842168868918 + Confinement :: 0.451836279031 + + Orbital energies State L Occupation Energy[a.u.] Energy[eV] + + 1 0 2.000 -0.378230 -10.292155 + + 1 1 2.000 -0.128135 -3.486734 + + Re-scaling the density matrix to get the right number of electrons + # Electrons Trace(P) Scaling factor + 4 3.957 1.011 + SCF WAVEFUNCTION OPTIMIZATION Step Update method Time Convergence Total energy Change ------------------------------------------------------------------------------ - 1 P_Mix/Diag. 0.40E+00 0.0 0.91054691 -3.7676530551 -3.77E+00 - 2 P_Mix/Diag. 0.40E+00 0.0 1.43423699 -3.7630769565 4.58E-03 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998453719 0.0001546281 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036805695 + Total charge density g-space grids: -0.0036805695 + + 1 P_Mix/Diag. 0.40E+00 0.5 0.91054691 -3.7676530551 -3.77E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998376779 0.0001623221 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036728755 + Total charge density g-space grids: -0.0036728755 + + 2 P_Mix/Diag. 0.40E+00 0.1 1.43423699 -3.7630769565 4.58E-03 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998261797 0.0001738203 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036613774 + Total charge density g-space grids: -0.0036613774 + 3 P_Mix/Diag. 0.40E+00 0.0 1.17313688 -3.7617744608 1.30E-03 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998114150 0.0001885850 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036466127 + Total charge density g-space grids: -0.0036466127 + 4 P_Mix/Diag. 0.40E+00 0.0 1.19324262 -3.7617213565 5.31E-05 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998216700 0.0001783300 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036568676 + Total charge density g-space grids: -0.0036568676 + 5 P_Mix/Diag. 0.40E+00 0.0 1.53629065 -3.7604565666 1.26E-03 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998178796 0.0001821204 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036530772 + Total charge density g-space grids: -0.0036530772 + 6 P_Mix/Diag. 0.40E+00 0.0 1.04343399 -3.7600601589 3.96E-04 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998070461 0.0001929539 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036422437 + Total charge density g-space grids: -0.0036422437 + 7 P_Mix/Diag. 0.40E+00 0.0 1.11760522 -3.7602421542 -1.82E-04 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998183755 0.0001816245 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036535731 + Total charge density g-space grids: -0.0036535731 + 8 P_Mix/Diag. 0.40E+00 0.0 1.55241328 -3.7597597549 4.82E-04 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998160227 0.0001839773 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036512204 + Total charge density g-space grids: -0.0036512204 + 9 P_Mix/Diag. 0.40E+00 0.0 1.31913505 -3.7596485929 1.11E-04 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998090244 0.0001909756 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036442221 + Total charge density g-space grids: -0.0036442221 + 10 P_Mix/Diag. 0.40E+00 0.0 1.42124885 -3.7596975373 -4.89E-05 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998147598 0.0001852402 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036499574 + Total charge density g-space grids: -0.0036499574 + 11 P_Mix/Diag. 0.40E+00 0.0 1.55681371 -3.7595305017 1.67E-04 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998139593 0.0001860407 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036491569 + Total charge density g-space grids: -0.0036491569 + 12 P_Mix/Diag. 0.40E+00 0.0 1.54366578 -3.7595254937 5.01E-06 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998120286 0.0001879714 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036472262 + Total charge density g-space grids: -0.0036472262 + 13 P_Mix/Diag. 0.40E+00 0.0 1.54961040 -3.7595329296 -7.44E-06 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998132641 0.0001867359 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036484617 + Total charge density g-space grids: -0.0036484617 + 14 P_Mix/Diag. 0.40E+00 0.0 1.55797923 -3.7595065213 2.64E-05 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998131267 0.0001868733 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036483243 + Total charge density g-space grids: -0.0036483243 + 15 P_Mix/Diag. 0.40E+00 0.0 1.55791464 -3.7595065030 1.83E-08 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998127882 0.0001872118 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036479858 + Total charge density g-space grids: -0.0036479858 + 16 P_Mix/Diag. 0.40E+00 0.0 1.55729009 -3.7595080837 -1.58E-06 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998130039 0.0001869961 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036482015 + Total charge density g-space grids: -0.0036482015 + 17 P_Mix/Diag. 0.40E+00 0.0 1.55805803 -3.7595030999 4.98E-06 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129817 0.0001870183 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481793 + Total charge density g-space grids: -0.0036481793 + 18 P_Mix/Diag. 0.40E+00 0.0 1.55810813 -3.7595030814 1.85E-08 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129240 0.0001870760 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481216 + Total charge density g-space grids: -0.0036481216 + 19 P_Mix/Diag. 0.40E+00 0.0 1.55791276 -3.7595033429 -2.62E-07 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129617 0.0001870383 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481593 + Total charge density g-space grids: -0.0036481593 + 20 P_Mix/Diag. 0.40E+00 0.0 1.55804481 -3.7595023489 9.94E-07 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129580 0.0001870420 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481556 + Total charge density g-space grids: -0.0036481556 + 21 P_Mix/Diag. 0.40E+00 0.0 1.55805434 -3.7595023347 1.42E-08 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129479 0.0001870521 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481456 + Total charge density g-space grids: -0.0036481456 + 22 P_Mix/Diag. 0.40E+00 0.0 1.55801129 -3.7595023719 -3.72E-08 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129547 0.0001870453 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481523 + Total charge density g-space grids: -0.0036481523 + 23 P_Mix/Diag. 0.40E+00 0.0 1.55803848 -3.7595021729 1.99E-07 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129540 0.0001870460 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481517 + Total charge density g-space grids: -0.0036481517 + 24 P_Mix/Diag. 0.40E+00 0.0 1.55803991 -3.7595021675 5.44E-09 - 25 P_Mix/Diag. 0.40E+00 0.0 1.55803093 -3.7595021713 -3.83E-09 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129522 0.0001870478 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481499 + Total charge density g-space grids: -0.0036481499 + + 25 P_Mix/Diag. 0.40E+00 0.1 1.55803093 -3.7595021713 -3.83E-09 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129535 0.0001870465 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481511 + Total charge density g-space grids: -0.0036481511 + 26 P_Mix/Diag. 0.40E+00 0.0 1.55803669 -3.7595021317 3.96E-08 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129534 0.0001870466 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481510 + Total charge density g-space grids: -0.0036481510 + 27 P_Mix/Diag. 0.40E+00 0.0 1.55803686 -3.7595021300 1.69E-09 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129530 0.0001870470 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481507 + Total charge density g-space grids: -0.0036481507 + 28 P_Mix/Diag. 0.40E+00 0.0 1.55803502 -3.7595021299 7.46E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129533 0.0001870467 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 29 P_Mix/Diag. 0.40E+00 0.0 1.55803625 -3.7595021221 7.84E-09 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129533 0.0001870467 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 30 P_Mix/Diag. 0.40E+00 0.0 1.55803625 -3.7595021216 4.75E-10 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481508 + Total charge density g-space grids: -0.0036481508 + 31 P_Mix/Diag. 0.40E+00 0.0 1.55803588 -3.7595021214 2.11E-10 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 32 P_Mix/Diag. 0.40E+00 0.0 1.55803614 -3.7595021198 1.54E-09 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 33 P_Mix/Diag. 0.40E+00 0.0 1.55803613 -3.7595021197 1.26E-10 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 34 P_Mix/Diag. 0.40E+00 0.0 1.55803606 -3.7595021196 8.77E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 35 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021193 2.99E-10 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 36 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021193 3.25E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 37 P_Mix/Diag. 0.40E+00 0.0 1.55803610 -3.7595021193 2.81E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 38 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 5.71E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 39 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.14E-12 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 40 P_Mix/Diag. 0.40E+00 0.0 1.55803610 -3.7595021192 8.09E-12 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 41 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.07E-11 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 42 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.00E-12 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 43 P_Mix/Diag. 0.40E+00 0.0 1.55803610 -3.7595021192 2.20E-12 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 44 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.94E-12 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 45 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.83E-13 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 46 P_Mix/Diag. 0.40E+00 0.0 1.55803610 -3.7595021192 5.81E-13 - 47 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 3.32E-13 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + + 47 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 3.32E-13 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 48 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.16E-13 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 49 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.50E-13 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 50 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 5.06E-14 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 51 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.71E-14 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 52 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.04E-14 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 53 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.00E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 54 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 6.22E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 55 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.07E-14 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 56 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 57 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.33E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 58 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 3.55E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 59 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 0.00E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 60 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 61 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 62 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -1.78E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 63 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 64 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.78E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 65 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 0.00E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 66 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 67 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 68 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -1.78E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 69 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 70 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 71 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 72 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 73 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.22E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 74 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -1.78E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 75 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 76 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 77 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -1.33E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 78 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 0.00E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 79 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.33E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 80 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 81 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 82 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.22E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 83 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -2.66E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 84 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 85 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 86 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -1.78E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 87 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 88 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.66E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 89 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -2.22E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 90 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 91 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 1.33E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 92 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -2.22E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 93 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 94 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 2.66E-15 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 95 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -8.88E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 96 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 0.00E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 97 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 0.00E+00 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 98 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 -4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 99 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + 100 P_Mix/Diag. 0.40E+00 0.0 1.55803611 -3.7595021192 4.44E-16 *** SCF run NOT converged *** @@ -225,6 +1253,30 @@ Total energy: -3.75950211916622 + + MULLIKEN POPULATION ANALYSIS + + # Atom Element Kind Atomic population Net charge + 1 Si 1 4.000000 -0.000000 + # Total charge 4.000000 -0.000000 + + + !-----------------------------------------------------------------------------! + Hirschfeld Charges + + #Atom Element Kind Ref Charge Population Net charge + 1 Si 1 4.000 3.460 0.540 + + Total Charge 0.540 + !-----------------------------------------------------------------------------! + + Trace(PS): 4.0000000000 + Electronic density on regular grids: -3.9998129532 0.0001870468 + Core density on regular grids: 3.9961648024 -0.0038351976 + Total charge density on r-space grids: -0.0036481509 + Total charge density g-space grids: -0.0036481509 + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -3.743992420430962 @@ -242,6 +1294,13 @@ marketing flops 68276 ------------------------------------------------------------------------------- + ------------------------------------------------------------------------------- + ---- MULTIGRID INFO ---- + ------------------------------------------------------------------------------- + count for grid 1: 311 cutoff [a.u.] 25.00 + count for grid 2: 332 cutoff [a.u.] 8.33 + total gridlevel count : 643 + ------------------------------------------------------------------------------- - - - MESSAGE PASSING PERFORMANCE - @@ -250,14 +1309,14 @@ ROUTINE CALLS TOT TIME [s] AVE VOLUME [Bytes] PERFORMANCE [MB/s] MP_Group 3 0.000 - MP_Bcast 102 0.000 4. 1.62 - MP_Allreduce 1060 0.001 8. 13.60 + MP_Bcast 102 0.009 4. 0.05 + MP_Allreduce 1170 0.001 8. 9.90 MP_Sync 2 0.000 - MP_Alltoall 2316 0.002 522. 768.26 + MP_Alltoall 2316 0.002 522. 569.59 MP_Wait 2424 0.001 - MP_ISend 808 0.002 228. 115.30 - MP_IRecv 808 0.000 228. 426.19 - MP_Memory 2424 0.001 + MP_ISend 808 0.002 228. 97.51 + MP_IRecv 808 0.001 228. 276.41 + MP_Memory 2424 0.002 ------------------------------------------------------------------------------- @@ -341,45 +1400,50 @@ ------------------------------------------------------------------------------- SUBROUTINE CALLS ASD SELF TIME TOTAL TIME MAXIMUM AVERAGE MAXIMUM AVERAGE MAXIMUM - CP2K 1 1.0 0.002 0.002 1.213 1.213 - qs_forces 1 2.0 0.000 0.000 1.181 1.181 - qs_energies_scf 1 3.0 0.000 0.000 1.172 1.172 - scf_env_do_scf 1 4.0 0.000 0.000 1.157 1.157 - scf_env_do_scf_inner_loop 100 5.0 0.008 0.008 1.157 1.157 - rebuild_ks_matrix 101 7.0 0.000 0.000 0.887 0.887 - qs_ks_build_kohn_sham_matrix 101 8.0 0.006 0.006 0.886 0.886 - qs_ks_update_qs_env 100 6.0 0.001 0.001 0.880 0.880 - qs_vxc_create 101 9.0 0.001 0.001 0.663 0.663 - xc_vxc_pw_create 101 10.0 0.024 0.024 0.662 0.662 - xc_rho_set_and_dset_create 101 11.0 0.057 0.057 0.461 0.461 - fft_wrap_pw1pw2 1314 10.7 0.007 0.007 0.452 0.452 - fft_wrap_pw1pw2_30 1112 11.8 0.026 0.026 0.433 0.433 - fft3d_s 1315 12.7 0.290 0.290 0.301 0.301 - xc_functional_eval 202 12.0 0.001 0.001 0.246 0.246 - qs_rho_update_rho 101 6.0 0.000 0.000 0.156 0.156 - calculate_rho_elec 101 7.0 0.063 0.063 0.156 0.156 - sum_up_and_integrate 101 9.0 0.003 0.003 0.136 0.136 - xb88_lda_eval 101 13.0 0.134 0.134 0.134 0.134 - integrate_v_rspace 101 10.0 0.078 0.078 0.133 0.133 - lyp_lda_eval 101 13.0 0.111 0.111 0.111 0.111 - density_rs2pw 101 8.0 0.001 0.001 0.092 0.092 - pw_scatter_s 707 13.0 0.066 0.066 0.066 0.066 - calculate_dm_sparse 100 6.0 0.000 0.000 0.062 0.062 - cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.001 0.001 0.061 0.061 - pw_gather_s 607 12.5 0.051 0.051 0.051 0.051 - potential_pw2rs 101 11.0 0.001 0.001 0.050 0.050 - dbcsr_mm_cannon_multiply 101 8.0 0.004 0.004 0.046 0.046 - pw_derive 606 11.5 0.040 0.040 0.040 0.040 - quickstep_create_force_env 1 2.0 0.000 0.000 0.029 0.029 - pw_copy 909 11.2 0.026 0.026 0.026 0.026 - pw_poisson_solve 101 9.0 0.018 0.018 0.026 0.026 - dbcsr_complete_redistribute 302 9.0 0.011 0.011 0.024 0.024 + CP2K 1 1.0 0.041 0.041 4.579 4.579 + qs_forces 1 2.0 0.020 0.020 4.099 4.099 + qs_energies_scf 1 3.0 0.313 0.313 4.064 4.064 + scf_env_do_scf 1 4.0 0.000 0.000 2.027 2.027 + scf_env_do_scf_inner_loop 100 5.0 0.081 0.081 2.015 2.015 + init_scf_run 1 4.0 0.013 0.013 1.519 1.519 + scf_env_initial_rho_setup 1 5.0 0.327 0.327 1.237 1.237 + rebuild_ks_matrix 101 7.0 0.000 0.000 1.221 1.221 + qs_ks_build_kohn_sham_matrix 101 8.0 0.044 0.044 1.221 1.221 + qs_ks_update_qs_env 100 6.0 0.001 0.001 1.211 1.211 + qs_vxc_create 101 9.0 0.007 0.007 0.878 0.878 + xc_vxc_pw_create 101 10.0 0.028 0.028 0.871 0.871 + calculate_first_density_matrix 1 6.0 0.000 0.000 0.837 0.837 + calculate_atomic_block_dm 1 7.0 0.154 0.154 0.837 0.837 + fft_wrap_pw1pw2 1314 10.7 0.012 0.012 0.638 0.638 + fft_wrap_pw1pw2_30 1112 11.8 0.044 0.044 0.611 0.611 + xc_rho_set_and_dset_create 101 11.0 0.077 0.077 0.568 0.568 + atom_int_setup 1 8.0 0.481 0.481 0.481 0.481 + fft3d_s 1315 12.7 0.389 0.389 0.459 0.459 + quickstep_create_force_env 1 2.0 0.066 0.066 0.382 0.382 + xc_functional_eval 202 12.0 0.002 0.002 0.298 0.298 + qs_rho_update_rho 101 6.0 0.001 0.001 0.289 0.289 + calculate_rho_elec 101 7.0 0.164 0.164 0.288 0.288 + cp_fm_cholesky_decompose 1 5.0 0.244 0.244 0.244 0.244 + eigensolver 100 6.0 0.000 0.000 0.237 0.237 + sum_up_and_integrate 101 9.0 0.004 0.004 0.210 0.210 + integrate_v_rspace 101 10.0 0.129 0.129 0.206 0.206 + calculate_atom 1 8.0 0.000 0.000 0.202 0.202 + calculate_atom_restricted 1 9.0 0.202 0.202 0.202 0.202 + calculate_dm_sparse 100 6.0 0.000 0.000 0.177 0.177 + cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.091 0.091 0.177 0.177 + qs_init_subsys 1 3.0 0.073 0.073 0.167 0.167 + qs_energies_init_hamiltonians 1 4.0 0.000 0.000 0.163 0.163 + xb88_lda_eval 101 13.0 0.151 0.151 0.151 0.151 + lyp_lda_eval 101 13.0 0.145 0.145 0.145 0.145 + density_rs2pw 101 8.0 0.001 0.001 0.123 0.123 + cp_fm_upper_to_full 100 7.0 0.111 0.111 0.111 0.111 + pw_gather_s 607 12.5 0.100 0.100 0.100 0.100 ------------------------------------------------------------------------------- - **** **** ****** ** PROGRAM ENDED AT 2015-11-04 09:48:54.523 + **** **** ****** ** PROGRAM ENDED AT 2015-12-21 09:23:45.724 ***** ** *** *** ** PROGRAM RAN ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM RAN BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 2044 - **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/2.6 - .2/functionals/blyp + ***** ** ** ** ** PROGRAM PROCESS ID 4707 + **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/blyp diff --git a/cp2kparser/tests/cp2k_2.6.2/functionals/pade/pade.out b/cp2kparser/tests/cp2k_2.6.2/functionals/pade/pade.out index a0032c16308c1e9bb513f11e0343acd8adca2455..7b9d266e54fd739a52227a9e63f9b18c4735289c 100644 --- a/cp2kparser/tests/cp2k_2.6.2/functionals/pade/pade.out +++ b/cp2kparser/tests/cp2k_2.6.2/functionals/pade/pade.out @@ -9,13 +9,13 @@ DBCSR| Communication thread load 87 - **** **** ****** ** PROGRAM STARTED AT 2015-11-04 09:08:17.640 + **** **** ****** ** PROGRAM STARTED AT 2015-12-21 09:24:22.893 ***** ** *** *** ** PROGRAM STARTED ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM STARTED BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 838 - **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/2.6 - .2/functionals/pade + ***** ** ** ** ** PROGRAM PROCESS ID 24732 + **** ** ******* ** PROGRAM STARTED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/pade CP2K| version string: CP2K version 2.6.2 CP2K| source code revision number: svn:15893 @@ -26,9 +26,9 @@ CP2K| Input file name pade.inp GLOBAL| Force Environment number 1 - GLOBAL| Basis set file name /home/lauri/BASIS_SET + GLOBAL| Basis set file name ../../data/BASIS_SET GLOBAL| Geminal file name BASIS_GEMINAL - GLOBAL| Potential file name /home/lauri/GTH_POTENTIALS + GLOBAL| Potential file name ../../data/GTH_POTENTIALS GLOBAL| MM Potential file name MM_POTENTIAL GLOBAL| Coordinate file name __STD_INPUT__ GLOBAL| Method name CP2K @@ -45,13 +45,13 @@ MEMORY| system memory details [Kb] MEMORY| rank 0 min max average - MEMORY| MemTotal 8070396 8070396 8070396 8070396 - MEMORY| MemFree 2735980 2735980 2735980 2735980 - MEMORY| Buffers 413220 413220 413220 413220 - MEMORY| Cached 3095888 3095888 3095888 3095888 - MEMORY| Slab 351316 351316 351316 351316 - MEMORY| SReclaimable 312100 312100 312100 312100 - MEMORY| MemLikelyFree 6557188 6557188 6557188 6557188 + MEMORY| MemTotal 8070392 8070392 8070392 8070392 + MEMORY| MemFree 4942396 4942396 4942396 4942396 + MEMORY| Buffers 231624 231624 231624 231624 + MEMORY| Cached 1841976 1841976 1841976 1841976 + MEMORY| Slab 241832 241832 241832 241832 + MEMORY| SReclaimable 207232 207232 207232 207232 + MEMORY| MemLikelyFree 7223228 7223228 7223228 7223228 GENERATE| Preliminary Number of Bonds generated: 0 @@ -108,7 +108,7 @@ Step Update method Time Convergence Total energy Change ------------------------------------------------------------------------------ - 1 P_Mix/Diag. 0.40E+00 0.0 0.74330726 -3.7598777522 -3.76E+00 + 1 P_Mix/Diag. 0.40E+00 0.1 0.74330726 -3.7598777522 -3.76E+00 2 P_Mix/Diag. 0.40E+00 0.0 1.18951813 -3.7551065407 4.77E-03 3 P_Mix/Diag. 0.40E+00 0.0 1.03914579 -3.7542350804 8.71E-04 4 P_Mix/Diag. 0.40E+00 0.0 0.95382681 -3.7545873699 -3.52E-04 @@ -250,13 +250,13 @@ ROUTINE CALLS TOT TIME [s] AVE VOLUME [Bytes] PERFORMANCE [MB/s] MP_Group 3 0.000 - MP_Bcast 102 0.000 4. 1.67 - MP_Allreduce 1060 0.001 8. 14.61 + MP_Bcast 102 0.000 4. 1.50 + MP_Allreduce 1060 0.001 8. 14.56 MP_Sync 2 0.000 - MP_Alltoall 2316 0.002 522. 784.20 + MP_Alltoall 2316 0.001 522. 809.13 MP_Wait 2424 0.001 - MP_ISend 808 0.002 228. 121.42 - MP_IRecv 808 0.000 228. 393.22 + MP_ISend 808 0.002 228. 119.91 + MP_IRecv 808 0.001 228. 352.57 MP_Memory 2424 0.001 ------------------------------------------------------------------------------- @@ -328,50 +328,44 @@ ------------------------------------------------------------------------------- SUBROUTINE CALLS ASD SELF TIME TOTAL TIME MAXIMUM AVERAGE MAXIMUM AVERAGE MAXIMUM - CP2K 1 1.0 0.003 0.003 0.627 0.627 - qs_forces 1 2.0 0.000 0.000 0.595 0.595 - qs_energies_scf 1 3.0 0.000 0.000 0.591 0.591 - scf_env_do_scf 1 4.0 0.000 0.000 0.574 0.574 - scf_env_do_scf_inner_loop 100 5.0 0.008 0.008 0.574 0.574 - rebuild_ks_matrix 101 7.0 0.000 0.000 0.294 0.294 - qs_ks_build_kohn_sham_matrix 101 8.0 0.005 0.005 0.294 0.294 - qs_ks_update_qs_env 100 6.0 0.001 0.001 0.293 0.293 - fft_wrap_pw1pw2 607 10.0 0.003 0.003 0.174 0.174 - fft_wrap_pw1pw2_30 405 10.7 0.010 0.010 0.159 0.159 - qs_rho_update_rho 101 6.0 0.000 0.000 0.158 0.158 - calculate_rho_elec 101 7.0 0.065 0.065 0.158 0.158 - sum_up_and_integrate 101 9.0 0.002 0.002 0.140 0.140 - integrate_v_rspace 101 10.0 0.079 0.079 0.137 0.137 - fft3d_s 608 12.0 0.105 0.105 0.117 0.117 - density_rs2pw 101 8.0 0.001 0.001 0.092 0.092 - qs_vxc_create 101 9.0 0.001 0.001 0.080 0.080 - xc_vxc_pw_create 101 10.0 0.009 0.009 0.079 0.079 - xc_rho_set_and_dset_create 101 11.0 0.001 0.001 0.070 0.070 - xc_functional_eval 101 12.0 0.066 0.066 0.066 0.066 - calculate_dm_sparse 100 6.0 0.000 0.000 0.063 0.063 - cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.002 0.002 0.063 0.063 - potential_pw2rs 101 11.0 0.001 0.001 0.052 0.052 - dbcsr_mm_cannon_multiply 101 8.0 0.004 0.004 0.047 0.047 - quickstep_create_force_env 1 2.0 0.000 0.000 0.028 0.028 - dbcsr_complete_redistribute 302 9.0 0.011 0.011 0.025 0.025 - copy_dbcsr_to_fm 400 7.0 0.003 0.003 0.024 0.024 - pw_poisson_solve 101 9.0 0.016 0.016 0.022 0.022 + CP2K 1 1.0 0.002 0.002 0.784 0.784 + qs_forces 1 2.0 0.000 0.000 0.685 0.685 + qs_energies_scf 1 3.0 0.000 0.000 0.681 0.681 + scf_env_do_scf 1 4.0 0.000 0.000 0.666 0.666 + scf_env_do_scf_inner_loop 100 5.0 0.008 0.008 0.666 0.666 + rebuild_ks_matrix 101 7.0 0.000 0.000 0.393 0.393 + qs_ks_build_kohn_sham_matrix 101 8.0 0.006 0.006 0.393 0.393 + qs_ks_update_qs_env 100 6.0 0.001 0.001 0.392 0.392 + fft_wrap_pw1pw2 607 10.0 0.003 0.003 0.187 0.187 + fft_wrap_pw1pw2_30 405 10.7 0.010 0.010 0.172 0.172 + qs_vxc_create 101 9.0 0.001 0.001 0.161 0.161 + xc_vxc_pw_create 101 10.0 0.009 0.009 0.160 0.160 + qs_rho_update_rho 101 6.0 0.000 0.000 0.154 0.154 + calculate_rho_elec 101 7.0 0.062 0.062 0.154 0.154 + xc_rho_set_and_dset_create 101 11.0 0.002 0.002 0.150 0.150 + xc_functional_eval 101 12.0 0.146 0.146 0.146 0.146 + sum_up_and_integrate 101 9.0 0.003 0.003 0.145 0.145 + integrate_v_rspace 101 10.0 0.078 0.078 0.142 0.142 + fft3d_s 608 12.0 0.117 0.117 0.127 0.127 + quickstep_create_force_env 1 2.0 0.000 0.000 0.095 0.095 + density_rs2pw 101 8.0 0.001 0.001 0.091 0.091 + qs_init_subsys 1 3.0 0.072 0.072 0.080 0.080 + calculate_dm_sparse 100 6.0 0.000 0.000 0.062 0.062 + cp_dbcsr_plus_fm_fm_t_native 101 7.0 0.001 0.001 0.062 0.062 + potential_pw2rs 101 11.0 0.001 0.001 0.059 0.059 + dbcsr_mm_cannon_multiply 101 8.0 0.004 0.004 0.046 0.046 + dbcsr_complete_redistribute 302 9.0 0.011 0.011 0.024 0.024 + pw_poisson_solve 101 9.0 0.018 0.018 0.024 0.024 + pw_scatter_s 303 12.0 0.023 0.023 0.023 0.023 + copy_dbcsr_to_fm 400 7.0 0.003 0.003 0.023 0.023 pw_gather_s 304 12.0 0.022 0.022 0.022 0.022 - pw_scatter_s 303 12.0 0.021 0.021 0.021 0.021 - create_qs_kind_set 1 3.0 0.000 0.000 0.019 0.019 - read_qs_kind 1 4.0 0.011 0.011 0.019 0.019 - qs_diis_b_step 99 6.0 0.001 0.001 0.019 0.019 - eigensolver 100 6.0 0.000 0.000 0.016 0.016 - pw_copy 606 10.8 0.015 0.015 0.015 0.015 - dbcsr_finalize 726 10.0 0.002 0.002 0.014 0.014 - dbcsr_make_images 202 9.0 0.000 0.000 0.014 0.014 - make_images 202 10.0 0.002 0.002 0.013 0.013 + qs_diis_b_step 99 6.0 0.001 0.001 0.018 0.018 ------------------------------------------------------------------------------- - **** **** ****** ** PROGRAM ENDED AT 2015-11-04 09:08:18.339 + **** **** ****** ** PROGRAM ENDED AT 2015-12-21 09:24:23.832 ***** ** *** *** ** PROGRAM RAN ON lauri-Lenovo-Z50-70 ** **** ****** PROGRAM RAN BY lauri - ***** ** ** ** ** PROGRAM PROCESS ID 838 - **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/NoMaD Personal/gi - tlab/parser-cp2k/cp2kparser/tests/2.6 - .2/functionals/pade + ***** ** ** ** ** PROGRAM PROCESS ID 24732 + **** ** ******* ** PROGRAM STOPPED IN /home/lauri/Dropbox/nomad-dev/parser- + cp2k/cp2kparser/tests/cp2k_2.6.2/func + tionals/pade diff --git a/library.md b/library.md index b96dfe85f1b4f4fb37c721b964a8607127411e58..1500e36aa96de47b39c34e05e7ba16fb133acde7 100644 --- a/library.md +++ b/library.md @@ -1,10 +1,20 @@ -## NomadParser +## More Complex Parsing Scenarios -The NomadParser class can be used as a base class for parsers in the NoMaD -project. The NomadParser class will automatically convert results to SI units, -format the results as JSON and push them to the backend. It will also validate -that the results match the type and shape defined for the quantity in the -metainfo file. A minimal example of a class that inherits NomadParser: +The utilities in simple_parser.py can be used alone to make a parser in many +cases. The SimpleMatchers provide a very nice declarative way to define the +parsing process and takes care of unit conversion and pushing the results to +the scala layer. + +Still you may find it useful to have additional help in handling more complex +scenarios. During the parser development you may encounter these questions: + - How to manage different versions of the parsed code? + - How to handle multiple files? + - How to integrate all this with the functionality that is provided in simple_parser.py? + +The NomadParser class is meant help in structuring your code. It uses the same +input and output format as the mainFunction in simple_parser.py. Here is a +minimal example of a parser that subclasses NomadParser Here is a minimal +example of a parser that subclasses NomadParser: ```python class MyParser(NomadParser): @@ -18,17 +28,6 @@ class MyParser(NomadParser): self.version = None self.implementation = None self.setup_version() - # You would typically also setup some file id's here to help handling - # the files. In this example the id's are already given in the JSON - # input. To register a file you can call 'setup_file_id()' - - def start_parsing(self, name): - """Asks the implementation object to give the result object by calling - the function corresponding to the quantity name (=metaname). The - NomadParser then automatically handles the conversion, validation and - saving of the results. - """ - return getattr(self.implementation, name)() def setup_version(self): """The parsers should be able to support different version of the same @@ -39,8 +38,11 @@ class MyParser(NomadParser): self.version = "1" self.implementation = globals()["MyParserImplementation{}".format(self.version)](self) - def get_supported_quantities(self): - return self.implementation.supported_quantities + def parse(self): + """After the version has been identified and an implementation is + setup, you can start parsing. + """ + return getattr(self.implementation, name)() ``` The class MyParser only defines how to setup a parser based on the given input. @@ -181,4 +183,4 @@ The 'files' object contains all the files that are given to the parser. The attribute names are the file paths and their values are optional id's. The id's are not typically given and they have to be assigned by using the setup_file_id() function of NomadParser. Assigning id's helps to manage the -files. \ No newline at end of file +files.