mod eb_hooks

module eb_hooks

PARALLELISM_LIMITS from an EESSI eb_hooks.py, read as Python source.

software-layer-scripts keeps its per-package parallelism limits in a module-level dict that post_ready_hook reads. A key whose value is an (op, argument) tuple is a CPU target’s own limit. A key whose value is a dict is a software name, and that dict’s keys are CPU targets or '*'. A key is a string or a module-level string constant such as CPU_TARGET_A64FX. The ops are divide_by_factor and set_maximum. The file is parsed, never run. A row this reader cannot model is an error that names its line, because the parallel levels would be wrong without it.

The same file is checked for a statement that adds to a name and drops the result: msg+ "..." on a line of its own builds a longer string and throws it away, where msg += "..." appends.

Variables

const LIMITS_NAME: &str

The dict post_ready_hook looks a build up in.

Functions

fn parse_hooks(text: &str, file: &str) -> Result<HooksFile>

Read PARALLELISM_LIMITS and the dropped sums from text.

file names the file in errors and in each row’s location. The last module-level assignment to PARALLELISM_LIMITS is the one post_ready_hook sees, and its keys resolve through the string constants bound before it.

Structs and Unions

struct DroppedSum

name + ... as a statement of its own: the sum is computed and lost.

line: usize

1-based line of the statement.

function: Option<String>

The innermost def around the statement. None at module level.

name: String

The name left of +, msg.

statement: String

The statement’s first source line, trimmed.

Implementations

impl DroppedSum

Functions

fn message(&self, file: &str) -> String

The warning stack oom prints, with file as the location.

struct HooksFile

What stack oom reads from one eb_hooks.py.

limits: Vec<HookLimit>

PARALLELISM_LIMITS rows. A key the dict repeats keeps its last value, as Python does.

dropped_sums: Vec<DroppedSum>

Statements that add to a name and drop the sum.