DiffcrashRun

This class can be used in order to automate diffcrash runs in a hopefully comfortable manner.

class lasso.diffcrash.DiffcrashRun(project_dir: str, crash_code: str, reference_run: str, simulation_runs: Sequence[str], exclude_runs: Sequence[str], diffcrash_home: str = '', use_id_mapping: bool = False, config_file: str = None, parameter_file: str = None, n_processes: int = 1, logfile_dir: str = None)

Object handling a diffcrash run

Parameters
project_dirstr

directory to put all buffer files etc in

crash_codestr

crash code to use.

reference_runstr

filepath to the reference run

simulation_runs: `list` of `str`

patterns used to search for simulation runs

diffcrash_homestr

home directory of diffcrash installation. Uses environment variable DIFFCRASHHOME if not set.

use_id_mappingbool

whether to use id mapping instead of nearest neighbor mapping

config_filestr

filepath to a config file

parameter_filestr

filepath to the parameter file

n_processesint

number of processes to spawn for worker pool

logfile_dirstr

directory to put logfiles in

Methods

check_if_logfiles_show_success

clear_project_dir

create_project_dirs

is_logfile_successful

read_config_file

run_eigen

run_export

run_import

run_math

run_matrix

run_merge

run_setup

__init__(self, project_dir: str, crash_code: str, reference_run: str, simulation_runs: Sequence[str], exclude_runs: Sequence[str], diffcrash_home: str = '', use_id_mapping: bool = False, config_file: str = None, parameter_file: str = None, n_processes: int = 1, logfile_dir: str = None)

Object handling a diffcrash run

Parameters
project_dirstr

directory to put all buffer files etc in

crash_codestr

crash code to use.

reference_runstr

filepath to the reference run

simulation_runs: `list` of `str`

patterns used to search for simulation runs

diffcrash_homestr

home directory of diffcrash installation. Uses environment variable DIFFCRASHHOME if not set.

use_id_mappingbool

whether to use id mapping instead of nearest neighbor mapping

config_filestr

filepath to a config file

parameter_filestr

filepath to the parameter file

n_processesint

number of processes to spawn for worker pool

logfile_dirstr

directory to put logfiles in

check_if_logfiles_show_success(self, pattern: str) → List[str]

Check if a logfiles with given pattern show success

Parameters
patternstr

file pattern used to search for logfiles

Returns
messageslist

list with messages of failed log checks

clear_project_dir(self)

Clears the entire project dir

create_project_dirs(self)

Creates all project relevant directores

Notes

Created dirs:
  • logfile_dir

  • project_dir

is_logfile_successful(self, logfile: str) → bool

Checks if a logfile indicates a success

Parameters
logfilestr

filepath to the logile

Returns
successbool
read_config_file(self, config_file: str) → List[str]

Read a diffcrash config file

Parameters
config_filestr

path to the config file

Notes

From the official diffcrash docs … seriously.

run_eigen(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash eigen

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_export(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash export

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_import(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash import of runs

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_math(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash math

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_matrix(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash matrix

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_merge(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash merge

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool

run_setup(self, pool: concurrent.futures.thread.ThreadPoolExecutor)

Run diffcrash setup

Parameters
poolconcurrent.futures.ThreadPoolExecutor

multiprocessing pool