Miscellaneous Modules¶
Supporting modules are grouped here to keep the main navigation focused on the top-level workflows.
Validation¶
Module for validating an existing input file
Laboratory Assistant¶
Class that manages and provides toolchains, sysroots and platforms
- class LaboratoryAssistant¶
Bases:
objectManager of toolchains, sysroots and platforms in Amphimixis global config
- CONFIG_DIR_PATH = '/home/zst/.config/amphimixis'¶
- TOOLBOX_PATH = '/home/zst/.config/amphimixis/toolbox.yml'¶
- static parse_config_file() dict¶
Search ~/.config/amphimixis/toolbox.yml and parse or create it
- Return type:
- Returns:
Toolbox content from Amphimixis global config
- static find_platform(platform_name: str) MachineInfo | None¶
Find platform in Amphimixis global config (toolbox) by name
- Parameters:
platform_name (str) – Name of platform
- Return type:
MachineInfo | None
- Returns:
info about machine if found else None
- static find_platform_by_address(address: str) str¶
Find platform in Amphimixis global config (toolbox) by address
- static add_platform(name: str, machine: MachineInfo) bool¶
Add platform to Amphimixis global config (toolbox)
- Parameters:
name (str) – Name of platform
machine (MachineInfo) – Information about machine to write to global config
- Return type:
- Returns:
True if platform successfully added to global config
- static delete_platform(name: str) None¶
Delete platform from Amphimixis global config by name
- Parameters:
name (str) – Name of platform
- Return type:
None
- static find_toolchain_by_name(name: str) Toolchain | None¶
Find toolchain by name in global config
- Parameters:
name (str) – name of toolchain in global config
- Return type:
Toolchain | None
- Returns:
Toolchain constructed from Amphimixis global config found by name
if not found then return None
- static add_toolchain(toolchain: Toolchain, machine: MachineInfo | str, target_arch: Arch) bool¶
Add toolchain to Amphimixis global config (toolbox)
- Parameters:
toolchain (Toolchain) – Toolchain to adding
machine (MachineInfo | str) – Platform that contains toolchain
target_arch (Arch) – The architecture for that the toolchain generates code
machine
- Return type:
- Returns:
True if toolchain successfully added to global config
Shell¶
Shell module
- class Shell(project: Project, machine: MachineInfo, ui: IUI = NullUI(), connect_timeout=10)¶
Bases:
objectShell class to manage shell operations.
bash is used as shell.
- Parameters:
project (Project) – Project object.
machine (MachineInfo) – machine to run profiling at.
int (connect_timeout) – connection to machine timeout.
ui (IUI)
- run(*commands: str) Tuple[int, List[List[str]], List[List[str]]]¶
Run the commands through the shell.
- Execute commands one by one until:
non-zero return code occurs or OR all commands have been executed.
- Parameters:
*commands (str) –
commands to be executed
- Return type:
- Returns:
A tuple of three :
- int:
error code of the last executed command
- List[List[str]]:
List[str] is lines of the stdout of an executed command.
- List[List[str]]:
List[str] is lines of the stderr of an executed command.
- copy_to_remote(source: str, destination: str) bool¶
Send a file or folder to the target machine.
Absolute paths are needed.
- copy_to_host(source: str, destination: str) bool¶
Gets a file or folder from the target machine.
Absolute paths are needed.
- get_project_workdir() str¶
Gets a working directory for amphimixis.
- Return type:
- Returns:
In case of remote machine: expanded ~/${AMPHIMIXIS_DIRECTORY_NAME}/${PROJECT_NAME}_builds.
In case of local machine: python process current working directory.
- get_home() str¶
Gets a home directory for current connection (user@machine).
- Return type:
- Returns:
Expanded ~ for the current connection (user@machine).
- get_source_dir() str¶
Gets a directory for the project source code on the target machine.
- Return type:
- Returns:
In case of remote machine: expanded
~/${AMPHIMIXIS_DIRECTORY_NAME}/${PROJECT_NAME}.
In case of local machine: project path.
Logger¶
Module to operate logging
Build Systems¶
Module containing dictionary of build systems and implementations of build systems
- class CMake(project: Project, runner: ILowLevelBuildSystem = DummyRunner(), ui: IUI = NullUI())¶
Bases:
BuildSystem,IHighLevelBuildSystemImplementation of working with CMake build system
- Parameters:
project (Project)
runner (ILowLevelBuildSystem)
ui (IUI)
- class Make(project: Project, runner: ILowLevelBuildSystem = DummyRunner(), ui: IUI = NullUI())¶
Bases:
BuildSystem,IHighLevelBuildSystem,ILowLevelBuildSystemImplementation of working with Make build system
- Parameters:
project (Project)
runner (ILowLevelBuildSystem)
ui (IUI)
- class Ninja(project: Project, runner: ILowLevelBuildSystem = DummyRunner(), ui: IUI = NullUI())¶
Bases:
BuildSystem,ILowLevelBuildSystemImplementation of working with Ninja build system
- Parameters:
project (Project)
runner (ILowLevelBuildSystem)
ui (IUI)
Performance Analyzer¶
Compare two perf output files.
- class LLMAnalyzer(api_key=None, base_url=None, model_name=None, project=None)¶
Bases:
objectAn OpenAI API wrapper
- ask(system_prompt, user_prompt, temperature=0.2)¶
Send a prompt to the LLM and return the response.
- print_comparison_table(event_name, data_a, data_b, max_rows, build_a='Build A', build_b='Build B')¶
Prints statistics comparison for a specific event.
- analyze_with_llm(table, samples_a, samples_b)¶
Analyzes performance data using a Large Language Model (LLM) and saves the output to a file.