Skip to content

DiffcrashRun

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

Class for handling the settings of a diffcrash run

__init__(project_dir, crash_code, reference_run, simulation_runs, exclude_runs, diffcrash_home='', use_id_mapping=False, config_file=None, parameter_file=None, n_processes=1, logfile_dir=None)

Object handling a diffcrash run

Parameters:

Name Type Description Default
project_dir str

directory to put all buffer files etc., in

required
crash_code str

crash code to use.

required
reference_run str

filepath to the reference run

required
simulation_runs typing.Sequence[str]

patterns used to search for simulation runs

required
diffcrash_home str

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

''
use_id_mapping bool

whether to use id mapping instead of nearest neighbor mapping

False
config_file str

filepath to a config file

None
parameter_file str

filepath to the parameter file

None
n_processes int

number of processes to spawn for worker pool

1
logfile_dir str

directory to put logfiles in

None

check_if_logfiles_show_success(pattern)

Check if a logfiles with given pattern show success

Parameters:

Name Type Description Default
pattern str

file pattern used to search for logfiles

required

Returns:

Name Type Description
messages List[str]

list with messages of failed log checks

clear_project_dir()

Clears the entire project dir

create_project_dirs()

Creates all project relevant directores

Notes

Created dirs:
 - logfile_dir
 - project_dir

is_logfile_successful(logfile)

Checks if a logfile indicates a success

Parameters:

Name Type Description Default
logfile str

filepath to the logfile

required

Returns:

Name Type Description
success bool

read_config_file(config_file)

Read a diffcrash config file

Parameters:

Name Type Description Default
config_file str

path to the config file

required

Notes

From the official diffcrash docs ... seriously.

run_eigen(pool)

Run diffcrash eigen

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_export(pool)

Run diffcrash export

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_import(pool)

Run diffcrash import of runs

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_math(pool)

Run diffcrash math

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_matrix(pool)

Run diffcrash matrix

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_merge(pool)

Run diffcrash merge

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required

run_setup(pool)

Run diffcrash setup

Parameters:

Name Type Description Default
pool futures.ThreadPoolExecutor

multiprocessing pool

required