synthesizer.utils.profiling_utils

A submodule containing some utility functions for profiling Synthesizer.

This module defines a set of helper functions for running different types of “onboard” performance tests on the Synthesizer package.

For further details see the documentation on the functions below.

Functions

synthesizer.utils.profiling_utils.parse_and_collect_runtimes(output, threads, average_over, log_outpath, low_thresh)[source]

Parse the output from the scaling test and collect runtimes.

Parameters:
  • output (str) – The captured output from the test.

  • threads (list) – The list of thread counts used in the test.

  • average_over (int) – The number of times to average the test over.

  • log_outpath (str) – The path to save the log file.

  • low_thresh (float) – The threshold for low runtimes.

Returns:

A dictionary containing the runtimes for each key. linestyles (dict):

A dictionary mapping keys to their respective linestyles.

Return type:

atomic_runtimes (dict)

synthesizer.utils.profiling_utils.plot_speed_up_plot(atomic_runtimes, threads, linestyles, outpath)[source]

Plot a strong scaling test.

Parameters:
  • atomic_runtimes (dict) – A dictionary containing the runtimes for each key.

  • threads (list) – A list of thread counts.

  • linestyles (dict) – A dictionary mapping keys to their respective linestyles.

  • outpath (str) – The path to save the plot.

synthesizer.utils.profiling_utils.run_scaling_test(max_threads, average_over, log_outpath, plot_outpath, operation_function, kwargs, total_msg, low_thresh)[source]

Run a scaling test for the Synthesizer package.

For this to deliver the full profiling potential Synthesizer should be installed with the ATOMIC_TIMING configuration option.

Parameters:
  • max_threads (int) – The maximum number of threads to test.

  • average_over (int) – The number of times to average the test over.

  • log_outpath (str) – The path to save the log file.

  • plot_outpath (str) – The path to save the plot.

  • operation_function (function) – The function to test.

  • kwargs (dict) – The keyword arguments to pass to the function.

  • total_msg (str) – The message to print for the total time.

  • low_thresh (float) – The threshold for low runtimes.