Skip to content

Commit

Permalink
Remove AiidaDFTK.jl log file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Nov 9, 2024
1 parent f3e6e68 commit 3bdda9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
10 changes: 1 addition & 9 deletions src/aiida_dftk/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def define(cls, spec):
options['withmpi'].default = True

# Exit codes
# TODO: Log file should be removed in favor of using stdout. Needs a change in AiidaDFTK.jl.
# TODO: Code 100 is already used in the super class!
spec.exit_code(100, 'ERROR_MISSING_LOG_FILE', message='The output file containing DFTK logs is missing.')
# TODO: Codes 1xx are already used in the super class!
spec.exit_code(101, 'ERROR_MISSING_SCFRES_FILE', message='The output file containing SCF results is missing.')
spec.exit_code(102, 'ERROR_MISSING_FORCES_FILE', message='The output file containing forces is missing.')
spec.exit_code(103, 'ERROR_MISSING_STRESSES_FILE', message='The output file containing stresses is missing.')
Expand Down Expand Up @@ -178,11 +176,6 @@ def _generate_cmdline_params(self) -> ty.List[str]:
cmd_params.extend(['-e', 'using AiidaDFTK; AiidaDFTK.run()', self.metadata.options.input_filename])
return cmd_params

@staticmethod
def get_log_file(input_filename: str) -> str:
"""Gets the name of the log file based on the name of the input file."""
return Path(input_filename).stem + '.log'

def _generate_retrieve_list(self, parameters: orm.Dict) -> list:
"""Generate the list of files to retrieve based on the type of calculation requested in the input parameters.
Expand All @@ -195,7 +188,6 @@ def _generate_retrieve_list(self, parameters: orm.Dict) -> list:
f"{item['$function']}.json" if item['$function'] == 'compute_bands' else f"{item['$function']}.hdf5"
for item in parameters['postscf']
]
retrieve_list.append(DftkCalculation.get_log_file(self.inputs.metadata.options.input_filename))
retrieve_list.append('timings.json')
retrieve_list.append(f'{self.SCFRES_SUMMARY_NAME}')
return retrieve_list
Expand Down
10 changes: 0 additions & 10 deletions src/aiida_dftk/parsers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
"""`Parser` implementation for DFTK."""
import json
from os import path
import pathlib as pl
from tempfile import TemporaryDirectory
import numpy as np

from aiida.common.exceptions import NotExistent
from aiida.engine import ExitCode
from aiida.orm import ArrayData, Dict
from aiida.parsers import Parser
Expand Down Expand Up @@ -34,13 +31,6 @@ class DftkParser(Parser):

def parse(self, **kwargs):
"""Parse DFTK output files."""
log_file_name = DftkCalculation.get_log_file(self.node.get_options()["input_filename"])
if log_file_name not in self.retrieved.base.repository.list_object_names():
return self.exit_codes.ERROR_MISSING_LOG_FILE
# TODO: how to make this log available? This unfortunately doesn't output to the process report.
# TODO: maybe DFTK could log in a way that allows us to map its log levels to aiida's
self.logger.info(self.retrieved.base.repository.get_object_content(log_file_name))

# if ran_out_of_walltime (terminated illy)
if self.node.exit_status == DftkCalculation.exit_codes.ERROR_SCHEDULER_OUT_OF_WALLTIME.status:
# if SCF summary file is not in the list of retrieved files, SCF terminated illy
Expand Down

0 comments on commit 3bdda9e

Please sign in to comment.