Documentation of modules
Extra functionality for reframe
- modules.reframe_extras.patch_launcher_command(job)[source]
Patch the job launcher command for mpirun and mpiexec. We remove -np/-n arguments as we pass them manually inside ReFrame test
- modules.reframe_extras.patch_job_names(job, stagedir)[source]
Patch the job name, stdout and stderr to remove special characters injected by fixtures
- class modules.reframe_extras.CachedRunTest(*args, **kwargs)[source]
Mixin.
Classes using this can be derive from
rfm.RunOnlyRegressionTest
Assumes saved output files are in a directorycache/
in same parent directory (and with same directory tree) as theoutput/
andstage/
directories.set
self.use_cache
to True or a path relative to cwd.NB Any class using this MUST NOT change self.executable in a method decorated with
@rfm.run_before('run')
as that will override functionality here.
- class modules.reframe_extras.CachedCompileOnlyTest(*args, **kwargs)[source]
A compile-only test with caching of binaries between
reframe
runs.Test classes derived from this class will save
self.executable
to a./builds/{system}/{partition}/{environment}/{self.name}
directory after compilation. However if this path (including the filename) exists before compilation (i.e. on the next run):No compilation occurs
self.sourcesdir
is set to this directory, soreframe
will copy thebinary to the staging dir (as if compilation had occured)
A new attribute
self.build_path
is set to this path (otherwise None)
Note that
self.sourcesdir
is only manipulated if no compilation occurs, so compilation test-cases which modify this to specify the source directory should be fine.
- class modules.reframe_extras.CachedGitCloneTest(*args, **kwargs)[source]
A git clone-only test with caching between the
reframe
runs.This test clones the git repository and copies the repository to
$PWD/src
folder on the first run. Once the$PWD/src
is there with repository inside it, it simply sets this directory asself.sourcesdir
so new cloning is avoided for the next run.If a new clone is needed the user simply need to remove $PWD/src before running reframe.
We need to set few variables for this test to work
repo_name
: Name of the repositoryrepo_url
: URL of git repository
- class modules.reframe_extras.FetchSourcesBase(*args, **kwargs)[source]
Fixture to fetch source code
- class modules.reframe_extras.MultiRunMixin(*args, **kwargs)[source]
This mixin creates a uniquely identifiable ID for tests that are run multiple times. Over all tests that are run with one reframe call, this yields the same unique key.
- class modules.reframe_extras.AppBase(*args, **kwargs)[source]
A base test class that includes common methods for application reframe tests.
This base class defines several methods that are common to different reframe tests
- property num_tasks_assigned
Get number of job tasks
- property run_command_emitted
Get job run command
- class modules.reframe_extras.SpackBase(*args, **kwargs)[source]
A base class that includes common methods for deploying software stack using Spack
- merge_spack_configs()[source]
Merge all seperate Spack config files into spack.yaml and place it stage dir
- modules.reframe_extras.slurm_node_info(partition=None)[source]
Get information about slurm nodes. Returns a sequence of dicts, one per node with keys/values all strs as follows:
“NODELIST”: name of node
“NODES”: number of nodes
“PARTITION”: name of partition, * appended if default
“STATE”: e.g. “idle”
“CPUS”: str number of cpus
“S:C:T”: Extended processor information: number of sockets, cores, threads in format “S:C:T”
“MEMORY”: Size of memory in megabytes
“TMP_DISK”: Size of temporary disk space in megabytes
“WEIGHT”: Scheduling weight of the node
“AVAIL_FE”: ?
“REASON”: The reason a node is unavailable (down, drained, or draining states) or “none”
See
man sinfo
forsinfo --Node --long
for full details.
- modules.reframe_extras.hostlist_to_hostnames(s)[source]
Convert a Slurm ‘hostlist expression’ to a list of individual node names. Uses scontrol command.
- class modules.reframe_extras.SchedulerInfo(rfm_partition, exclude_states=None, only_states=None)[source]
Information from the scheduler.
The returned object has attributes:
num_nodes
: number of nodessockets_per_node
: number of sockets per nodepcores_per_node
: number of physical cores per nodelcores_per_node
: number of logical cores per node
If
rfm_partition
is None the above attributes describe the default scheduler partition. Otherwise the followingsbatch
directives in the access property of the ReFrame partition will affect the information returned:--partition
--exclude
- Parameters
rfm_partition –
reframe.core.systems.SystemPartition
exclude_states – sequence of str, exclude nodes in these Slurm node states
only_states – sequence of str, only include nodes in these Slurm node states
Utility functions for SDP benchmark tests
- class modules.utils.GenerateHplConfig(num_nodes, num_procs, nb, mem, alpha=0.8)[source]
Class to generate HPL.dat file for LINPACK benchmark
- modules.utils.sdp_benchmark_tests_root()[source]
Returns the root directory of SKA SDP Benchmark tests
- Returns
Path of the root directory
- Return type
- modules.utils.parse_path_metadata(path)[source]
Return a dict of reframe info from a results path
- Parameters
path – ReFrame stage/output path
- Returns
ReFrame system/partition info
- Return type
- modules.utils.find_perf_logs(root, benchmark)[source]
Get perflog file names for given test
- Parameters
root – Root where perflogs exist
benchmark – Name of the benchmark
- Returns
List of perflog file names
- Return type
- modules.utils.read_perflog(path)[source]
Return a pandas dataframe from a ReFrame performance log. NB: This currently depends on having a non-default handlers_perflog.filelog.format in reframe’s configuration. See code. The returned dataframe will have columns for:
all keys returned by parse_path_metadata()
all fields in a performance log record, noting that: - ‘completion_time’ is converted to a datetime.datetime - ‘tags’ is split on commas into a list of strs
‘perf_var’ and ‘perf_value’, derived from ‘perf_info’ field
<key> for any tags of the format “<key>=<value>”, with values converted to int or float if possible
- Parameters
path (str) – Path to log file
- Returns
Dataframe of perflogs
- Return type
pandas.DataFrame
- modules.utils.load_perf_logs(root='.', test=None, extras=None, last=False, aggregate_multi_runs=<function median>)[source]
Convenience wrapper around read_perflog().
- Parameters
root (str) – Path to root of tree containing perf logs
test (str) – Shell-style glob pattern matched against last directory component to restrict loaded logs, or None to load all in tree
extras (list) – Additional dataframe headers to add
last (bool) – True to only return the most-recent record for each system/partition/enviroment/testname/perf_var combination.
aggregate_multi_runs (Callable) – How to aggregate the perf-values of multiple runs. If None, no aggregation is applied. Defaults to np.median
- Returns
Single pandas.dataframe concatenated from all loaded logs, or None if no logs exist
- Return type
pandas.DataFrame
- modules.utils.tabulate_last_perf(test, root='../../perflogs', extras=None, **kwargs)[source]
Retrieve last perf_log entry for each system/partition/environment.
- Parameters
test (str) – Shell-style glob pattern matched against last directory component to restrict loaded logs, or None to load all in tree
root (str) – Path to root of tree containing perf logs of interest - default assumes this is called from an apps/<application>/ directory
extras (list) – Additional dataframe headers to add
- Returns
A dataframe with columns: - case: name of the system, partition and environ - perf_var: Performance variable - add_var: Any additional variable passed as argument
- Return type
pandas.DataFrame
- modules.utils.tabulate_partitions(root)[source]
Tabulate the list of partitions defined with ReFrame config file and high level overview of each partition. We tabulate only partitions that are found in the perflog directory
- Parameters
root (str) – Perflog root directory
- Returns
A dataframe with all partition details
- Return type
pandas.DataFrame
- modules.utils.filter_systems_by_name(patterns)[source]
Filter systems based on patterns in the name. If all patterns are found in the name, the system is chosen.
- modules.utils.filter_systems_by_env(envs)[source]
Filter systems based on valid environments defined for them.
- modules.utils.git_describe(dir)[source]
Return a string describing the state of the git repo in which the dir is. See git describe –dirty –always for full details.
- modules.utils.get_scheduler_env_list(scheduler_name)[source]
Return the environment variables that stores different job details of different schedulers