PyTimeloop
|
Call Timeloop from Python. More...
Functions | |
delayed_import () | |
str | _specification_to_yaml_string (BaseSpecification specification, bool for_model=False) |
Converts specification into YAML string, which may require transpilation. | |
Tuple[List[str], str] | _pre_call (BaseSpecification specification, str output_dir, Optional[List[str]] extra_input_files=None, bool for_model=False) |
Prepare to call Timeloop or Accelergy from Python ! | |
Union[int, subprocess.Popen] | _call (str call, List[str] input_paths, str output_dir, Optional[Dict[str, str]] environment=None, Optional[str] dump_intermediate_to=None, Optional[str] log_to=None, List[str] extra_args=(), bool return_proc=False) |
Call a Timeloop or Accelergy command from Python. | |
Union[int, subprocess.Popen] | _parse_output (BaseSpecification specification, str output_dir, Union[int, subprocess.Popen] result, bool for_model=False) |
Union[int, subprocess.Popen] | call_mapper (BaseSpecification specification, str output_dir, Optional[Dict[str, str]] environment=None, Optional[List[str]] extra_input_files=None, Optional[str] dump_intermediate_to=None, Optional[Union[str, Any]] log_to=None, List[str] extra_args=(), bool return_proc=False) |
Call Timeloop Mapper from Python. | |
Union[int, subprocess.Popen] | call_model (BaseSpecification specification, str output_dir, Optional[Dict[str, str]] environment=None, Optional[List[str]] extra_input_files=None, Optional[str] dump_intermediate_to=None, Optional[Union[str, Any]] log_to=None, List[str] extra_args=(), bool return_proc=False) |
Call Timeloop Model from Python. | |
Union[int, subprocess.Popen] | call_accelergy_verbose (BaseSpecification specification, str output_dir, Optional[Dict[str, str]] environment=None, Optional[List[str]] extra_input_files=None, Optional[str] dump_intermediate_to=None, Optional[Union[str, Any]] log_to=None, List[str] extra_args=(), bool return_proc=False) |
Call Accelergy from Python. | |
call_stop (Optional[subprocess.Popen] proc=None, Optional[int] max_wait_time=None, bool force=False) | |
Stop Timeloop subprocesses. | |
"AccelergyInvocationResult" | accelergy_app (BaseSpecification specification, str output_dir, Optional[List[str]] extra_input_files=None) |
Call the PyTimeloop Accelergy interface. | |
to_mapper_app (BaseSpecification specification, str output_dir, Optional[List[str]] extra_input_files=None) | |
Create a PyTimeloop MapperApp object from a specification. | |
to_model_app (BaseSpecification specification, str output_dir, Optional[List[str]] extra_input_files=None) | |
Create a PyTimeloop ModelApp object from a specification. | |
Variables | |
bool | DELAYED_IMPORT_DONE = False |
Call Timeloop from Python.
|
protected |
Call a Timeloop or Accelergy command from Python.
Args: call (str): Which command to call. input_paths (List[str]): The content of the input file. output_dir (str): The directory to run Timeloop in. environment (Optional[Dict[str, str]]): A dictionary of environment variables to pass. dump_intermediate_to (Optional[str]): If not None, dump the input content to this file before calling. log_to (Optional[str]): If not None, log the output of the call to this file or file-like object. extra_args (List[str]): A list of extra arguments to pass to the call. return_proc (bool): If True, return the subprocess.Popen object instead of the return code.
Returns: Union[int, subprocess.Popen]: The return code of the call, or the subprocess.Popen object if return_proc is True.
|
protected |
|
protected |
Prepare to call Timeloop or Accelergy from Python !
specification | The specification with which to call Timeloop. ! |
output_dir | The directory to run Timeloop in. ! |
extra_input_files | A list of extra input files to pass to Timeloop. ! |
for_model | Whether the result is for Timeloop model or mapper |
|
protected |
Converts specification into YAML string, which may require transpilation.
!
specification | The specification with which to call Timeloop. ! |
for_model | Whether the result is for Timeloop model or mapper |
"AccelergyInvocationResult" pytimeloop.timeloopfe.common.backend_calls.accelergy_app | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[List[str]] | extra_input_files = None ) |
Call the PyTimeloop Accelergy interface.
Args: specification (BaseSpecification): The specification with which to call Accelergy. output_dir (str): The directory to run Accelergy in. extra_input_files (Optional[List[str]]): A list of extra input files to pass to Accelergy
Returns: AccelergyInvocationResult: The result of the Accelergy invocation.
Union[int, subprocess.Popen] pytimeloop.timeloopfe.common.backend_calls.call_accelergy_verbose | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[Dict[str, str]] | environment = None, | ||
Optional[List[str]] | extra_input_files = None, | ||
Optional[str] | dump_intermediate_to = None, | ||
Optional[Union[str, Any]] | log_to = None, | ||
List[str] | extra_args = (), | ||
bool | return_proc = False ) |
Call Accelergy from Python.
Args: specification (BaseSpecification): The specification with which to call Accelergy. output_dir (str): The directory to run Accelergy in. environment (Optional[Dict[str, str]]): A dictionary of environment variables to pass to Accelergy. extra_input_files (Optional[List[str]]): A list of extra input files to pass to Accelergy dump_intermediate_to (Optional[str]): If not None, dump the input content to this file before calling Accelergy. log_to (Optional[Union[str, Any]]): If not None, log the output of the Accelergy call to this file or file-like object. extra_args (List[str]): A list of extra arguments to pass to Accelergy. return_proc (bool): If True, return the subprocess.Popen object instead of the return code.
Union[int, subprocess.Popen] pytimeloop.timeloopfe.common.backend_calls.call_mapper | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[Dict[str, str]] | environment = None, | ||
Optional[List[str]] | extra_input_files = None, | ||
Optional[str] | dump_intermediate_to = None, | ||
Optional[Union[str, Any]] | log_to = None, | ||
List[str] | extra_args = (), | ||
bool | return_proc = False ) |
Call Timeloop Mapper from Python.
Args: specification (BaseSpecification): The specification with which to call Timeloop. output_dir (str): The directory to run Timeloop in. environment (Optional[Dict[str, str]]): A dictionary of environment variables to pass to Timeloop. extra_input_files (Optional[List[str]]): A list of extra input files to pass to Timeloop dump_intermediate_to (Optional[str]): If not None, dump the input content to this file before calling Timeloop. log_to (Optional[Union[str, Any]]): If not None, log the output of the Timeloop call to this file or file-like object. extra_args (List[str]): A list of extra arguments to pass to Timeloop. return_proc (bool): If True, return the subprocess.Popen object instead of the return code.
Returns: Union[int, subprocess.Popen]: The return code of the call, or the subprocess.Popen object if return_proc is True.
Union[int, subprocess.Popen] pytimeloop.timeloopfe.common.backend_calls.call_model | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[Dict[str, str]] | environment = None, | ||
Optional[List[str]] | extra_input_files = None, | ||
Optional[str] | dump_intermediate_to = None, | ||
Optional[Union[str, Any]] | log_to = None, | ||
List[str] | extra_args = (), | ||
bool | return_proc = False ) |
Call Timeloop Model from Python.
Args: specification (BaseSpecification): The specification with which to call Timeloop. output_dir (str): The directory to run Timeloop in. environment (Optional[Dict[str, str]]): A dictionary of environment variables to pass to Timeloop extra_input_files (Optional[List[str]]): A list of extra input files to pass to Timeloop dump_intermediate_to (Optional[str]): If not None, dump the input content to this file before calling Timeloop. log_to (Optional[Union[str, Any]]): If not None, log the output of the Timeloop call to this file or file-like object. extra_args (List[str]): A list of extra arguments to pass to Timeloop. return_proc (bool): If True, return the subprocess.Popen object instead of the return code.
Returns: Union[int, subprocess.Popen]: The return code of the call, or the subprocess.Popen object if return_proc is True.
pytimeloop.timeloopfe.common.backend_calls.call_stop | ( | Optional[subprocess.Popen] | proc = None, |
Optional[int] | max_wait_time = None, | ||
bool | force = False ) |
Stop Timeloop subprocesses.
Args: proc (Optional[subprocess.Popen]): The subprocess to stop. If None, stop all Timelojson processes. max_wait_time (Optional[int]): The maximum time to wait for the process to stop. If 0, do not wait. force (bool): If True, force kill the process instead of sending SIGINT.
pytimeloop.timeloopfe.common.backend_calls.delayed_import | ( | ) |
pytimeloop.timeloopfe.common.backend_calls.to_mapper_app | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[List[str]] | extra_input_files = None ) |
Create a PyTimeloop MapperApp object from a specification.
Args: specification (BaseSpecification): The specification with which to call Timeloop. output_dir (str): The directory to run Timeloop in. extra_input_files (Optional[List[str]]): A list of extra input files to pass to Timeloop
Returns: MapperApp: The MapperApp object.
pytimeloop.timeloopfe.common.backend_calls.to_model_app | ( | BaseSpecification | specification, |
str | output_dir, | ||
Optional[List[str]] | extra_input_files = None ) |
Create a PyTimeloop ModelApp object from a specification.
Args: specification (BaseSpecification): The specification with which to call Timeloop. output_dir (str): The directory to run Timeloop in. extra_input_files (Optional[List[str]]): A list of extra input files to pass to Timeloop
Returns: ModelApp: The ModelApp object.
bool pytimeloop.timeloopfe.common.backend_calls.DELAYED_IMPORT_DONE = False |