spliced.experiment package

Submodules

spliced.experiment.base module

class spliced.experiment.base.Experiment[source]

Bases: object

A base Experiment holds information for a splice experiment!

add_splice(result, success=False, splice=None, command=None, different_libs=False, package=None)[source]

Add a splice to the experiment

A splice can either be successful (so it will have libs, binaries, etc) or it can represent a failed state (for any number of reasons)

TODO refactor so we do one splice at a time TODO can we cache the splice setup? # ALSO add cache variable to save cache for smeagle (add to spack experiment)

init(package, splice, experiment, replace=None, validate=True, splice_versions=None)[source]

Init config variables directly

load(config_file, validate=True)[source]

Load a config from a yaml file

property name
property package
property package_so_prefix
predict(names=None, skip=None, predict_type=None)[source]

Given a single named predictor (or a list to skip) make predictions.

property replace
run()[source]

run the experiment.

property splice
property splice_so_prefix
property splice_versions
to_dict()[source]

Return a dictionary of results

to_json()[source]

Return a json dump of results

validate()[source]
class spliced.experiment.base.Splice(package=None, splice=None, experiment=None, replace=None, result=None, success=False, different_libs=False)[source]

Bases: object

A Splice holds the metadata for a splice, and if successful (or possible) will hold a result. A default splice result is not successful

add_identifier(key, identifier)[source]

Add some experiment specific identifier (e.g., dag hash for spack)

add_spec(key, spec)[source]

Add a spec (with a key) to metadata

match_libs()[source]

Try to match dependencies between spliced/original library for comparison

to_dict()[source]

Return the result as a dictionary

to_json()[source]

Return the result as json

spliced.experiment.spack module

class spliced.experiment.spack.SpackDiffExperiment[source]

Bases: SpackExperiment

The main spack experiment does a diff.

diff(specA, specB)[source]

Prepare setup to do a diff.

specA: the main package specB: the to splice

run(*args, **kwargs)[source]

Perform an install with spack of some spec A and some spec B, across versions.

Arguments: package (specA_name): the name of package A replace (specB_name): the name of package B

For many cases, specA and specB might be the same, but not always.

class spliced.experiment.spack.SpackExperiment[source]

Bases: Experiment

concretize(spec_name=None, error_message='spec-concretization-failed', spec=None, different_libs=False)[source]

A shared function to attempt concretization.

do_install(spec, error_message, name=None, different_libs=False)[source]

Helper function to do an install.

get_sorted_versions(spec)[source]

Helper function to get sorted versions (for consistency)

get_spack_ld_library_paths(original)[source]

Get all of spack’s changes to the LD_LIBRARY_PATH for elfcall

populate_elfcall(splice, original, spliced_spec)[source]

Derive library metadata for each of the original and splice spec

run_elfcall(lib, ld_library_paths=None)[source]

A wrapper to run elfcall and ensure we add LD_LIBRARY_PATH additions (usually from spack)

class spliced.experiment.spack.SpackSpliceExperiment[source]

Bases: SpackExperiment

do_splice(splice_name, spec_main, transitive=True)[source]

do the splice, the spliced spec goes into the main spec

mock_splice(splice_name, replace_name, spec_main)[source]

A mock splice is not possible with spack (it usually means replacing one dependency with another that isn’t an actual dependency) but we can still install the needed specs and then add their libs / binaries for other predictors. A “mock” of different libs means different_libs is set to True on the splice.

run(*args, **kwargs)[source]

Perform a splice with a SpecA (a specific spec with a binary), and SpecB (the high level spec that is a dependency that we can test across versions).

Arguments: package (specA_name): the name of the main package we are splicing up splice (specB_name): the spec we are removing / switching out replace (specC_name): the spec we are splicing in (replacing with)

For many cases, specB and specC might be the same, but not always.

spliced.experiment.spack.add_contenders(spec, loc='lib', match=None)[source]

Given a spec, find contender binaries and/or libs

spliced.experiment.spack.add_libraries(spec, library_name=None)[source]

Given a spliced spec, get a list of its libraries matching a name (e.g., a library that has been spliced in). E.g., if the spec is curl, we might look for zlib.

spliced.experiment.spack.get_linked_deps(spec)[source]

A helper function to only return a list of linked deps

Module contents