Utils

class tools.config_manager.ConfigManager

Bases: object

Manages configuration settings loaded from the JSON config file and optionally overridden by command-line arguments.

This class ensures that required parameters are present and valid, while applying defaults for optional settings.

CONFIG_HELP_MSG = 'Path to the JSON configuration file (required).'
HELP_DESCRIPTION = 'Override JSON config fields with command line arguments.'
OPTIONAL_PARAMS = {'cgcnn_batch_size': (256, 'Batch size for CGCNN.'), 'cpu_account': ('', 'The cpu account name on the current machine (forwarded to the workload manager).'), 'formation_energy_threshold': (-0.2, 'A formation energy threshold used for selecting the structures, after the CGCNN prediction.'), 'gpu_account': ('', 'The gpu account name on the current machine (forwarded to the workload manager).'), 'hull_energy_threshold': (0.1, 'Maximum Ehull (eV/atom) to display for metastable phases'), 'mp_rester_api_key': ('', 'An API key for accessing the MP data (https://docs.materialsproject.org). Required if --post_processing_output_dir is set. '), 'num_workers': (128, 'Number of threads used for generating, predicting and selecting the structures.'), 'output_level': ('INFO', 'Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL'), 'post_processing_output_dir': ('', 'A full path to a directory that will contain all the post-processing results. If not set, the post-processing step will be skipped.'), 'vasp_nnodes': (1, 'Number of nodes used for VASP calculations.'), 'vasp_nstructures': (-1, 'Number of structures to be processed with VASP. (-1 means all).'), 'vasp_nsw': (100, 'VASP NSW: gives the number of steps in all molecular dynamics runs.'), 'vasp_ntasks_per_run': (1, 'Number of MPI processes per VASP calculation (useful for CPU-only Parsl configurations).'), 'vasp_timeout': (1800, 'Max walltime in seconds for a VASP calculation.')}
REQUIRED_PARAMS = {'cms_dir': (<class 'str'>, 'Path to the CMS directory (required).'), 'elements': (<class 'str'>, "Elements, e.g. 'Ce-Co-B' (required)."), 'initial_structures_dir': (<class 'str'>, 'Path to the directory that containts the initial crystal structures.'), 'parsl_config': (<class 'str'>, 'Parsl config name, previously registered (required).'), 'vasp_output_file': (<class 'str'>, 'Output file name for storing the result of the VASP calculations (required).'), 'vasp_pot_dir': (<class 'str'>, 'Path to the PAW potentials directory containing kinetic energy densities for meta-GGA calculations (required).'), 'vasp_std_exe': (<class 'str'>, 'VASP executable (required).'), 'vasp_work_dir': (<class 'str'>, 'Path to a work directory for VASP-specific operations (required).'), 'work_dir': (<class 'str'>, 'Path to a work directory used for generating and selecting all the structures (required).')}
get_json_config()

Return the JSON configuration.

setup_vasp_calculations()

Calculate nstart and nend for VASP calculations. All structures in [nstart, nend) will be run.

class tools.logging_config.ExaAmdLogger(level_name='INFO', logger_name='exa-amd')

Bases: object

Lightweight logging utility.

Supports five standard logging levels, in order of increasing severity: DEBUG, INFO, WARNING, ERROR, and CRITICAL.

Parameters:
  • level_name (str, optional) – Logging level name.

  • logger_name (str, optional) – Name prefix for all log messages.

LEVEL_MAP = {'CRITICAL': 50, 'DEBUG': 10, 'ERROR': 40, 'INFO': 20, 'WARNING': 30}
configure(level_name='INFO')

Set the logging level. If unsupported level, fall back to INFO.

critical(message)

Log a critical-level message to stderr and terminate the program.

debug(message)

Log an debug-level message to stderr if permitted by current log level.

error(message)

Log an error-level message to stderr if permitted by current log level.

info(message)

Log an info-level message to stderr if permitted by current log level.

warning(message)

Log an warning-level message to stderr if permitted by current log level.

tools.post_processing.get_vasp_hull(config)

Construct or update the convex hull for the chemical system. Structures on or near the hull are considered potentially stable, while those significantly above the hull are likely metastable or unstable.

Parameters:

config (dict) –

ConfigManager. The following fields are used:

  • CK.ELEMENTS

  • CK.MPRester_API_KEY

  • CK.POT_DIR

  • CK.CMS_DIR

  • CK.VASP_WORK_DIR

  • CK.SUBDIR_STABLE_PHASES

  • CK.POST_PROCESSING_OUT_DIR

  • CK.MP_STABLE_OUT

  • CK.ENERGY_DAT_OUT

See ConfigManager for detailed field descriptions.

Returns:

The function performs its work through side effects—creating directories, launching VASP calculations, and emitting the final hull summary file. No value is returned.

Return type:

None

Raises:

Exception – If directory navigation or file operations fail.