PowerMeterMPI
¤
PowerMeterMPI(
project_name="test_project",
output_filepath=None,
config_file=None,
output_format="csv",
print_to_cli=True,
)
PowerMeter¤
Multi-node capable class for monitoring power consumption.
Attributes:
-
DATETIME_FORMAT(str) –The format for datetime objects.
-
DEFAULT_CONFIG_FILE(str) –The default configuration file name to use for wrapper.
-
DEFAULT_OUTPUT_FILEPATH(str) –The default output file path to save results.
-
LOGGING_FILE(str) –The filename for the experimentation logging file.
-
project_name(str) –Name of the experimentation project.
-
config_file(str) –Path to the configuration file for the wrapper initialisation.
-
output_filepath(str) –Path to the output file for results of profiling.
-
output_format(str) –Format for the output file (e.g. csv).
-
print_to_cli(bool) –Flag to print the result of measurement in Terminal at the end (default True).
-
power(PowerWrapper) –Instance of PowerWrapper class for power measurement.
-
used_package(str) –Name of the package of algorithm to profile during power measurement.
-
used_algorithm(str) –Name of the profiled algorithm for power measurement.
-
used_algorithm_description(str) –Description of the algorithm used during power measurement.
-
logging_filename(str) –Path to the logging file of experiment.
Methods:
-
measure_power–Decorator to measure power consumption during the execution of a function.
-
__set_used_arguments–Set the arguments used during power measurement.
-
__call__–Set the arguments used during power measurement using a decorator syntax.
-
__enter__–Enter method for context manager. Starts power measurement.
-
__exit__–Exit method for context manager. Stops power measurement.
-
start_measure–Start measuring power consumption.
-
stop_measure–Stop measuring power consumption.
-
__record_data_to_file–Record power data to a file.
-
__log_records–Log recorded power data.
Initialize the PowerMeter instance. This initialization is done on every node of the system.
Parameters:
-
config_file(str, default:None) –Path to the configuration file.
-
project_name(str, default:'test_project') –Name of the project.
-
output_filepath(str, default:None) –Path to the output file.
-
output_format(str, default:'csv') –Format for the output file.
-
print_to_cli(bool, default:True) –To print the result of measurement in Terminal at the end
Source code in ea2p/src/power_meter_mpi.py
__call__
¤
Set the arguments used during power measurement using a decorator syntax.
Parameters:
-
package(str) –Package name of the algorithm to profile.
-
algorithm(str) –Name of the algorithm to profile in the list of instruction of the decorated function.
-
algorithm_description(str, default:'') –Description of the profiled algorithm acording to the experimental setup or tesbet details (eg, dataset used, epochs for training, batch size, etc...).
Source code in ea2p/src/power_meter_mpi.py
__enter__
¤
Enter method for context manager. Starts power measurement.
__exit__
¤
__log_records
¤
Log recorded power data.
Parameters:
-
recorded_power(DataFrame) –Recorded power data.
-
package(str, default:'') –Package name of the algorithm to profile.
-
algorithm(str, default:'') –Name of the algorithm to profile in the list of instruction of the decorated function.
-
algorithm_description(str, default:'') –Description of the profiled algorithm acording to the experimental setup or tesbet details (eg, dataset used, epochs for training, batch size, etc...).
Source code in ea2p/src/power_meter_mpi.py
__record_data_to_file
¤
Record power data to a file.
Parameters:
-
data(DataFrame) –Power data to be recorded.
Returns: True if recording is successful, False otherwise.
Source code in ea2p/src/power_meter_mpi.py
__set_used_arguments
¤
Set the arguments used during power measurement.
Parameters:
-
package(str) –Package name of the algorithm to profile.
-
algorithm(str) –Name of the algorithm to profile in the list of instruction of the decorated function.
-
algorithm_description(str, default:'') –Description of the profiled algorithm acording to the experimental setup or tesbet details (eg, dataset used, epochs for training, batch size, etc...).
Source code in ea2p/src/power_meter_mpi.py
measure_power
¤
Decorator to measure power consumption during the execution of a function.
Parameters:
-
package(str) –Package name of the algorithm to profile.
-
algorithm(str) –Name of the algorithm to profile in the list of instruction of the decorated function.
-
algorithm_description(str, default:'') –Description of the profiled algorithm acording to the experimental setup or tesbet details (eg, dataset used, epochs for training, batch size, etc...).
Returns: Decorator function.
Source code in ea2p/src/power_meter_mpi.py
start_measure
¤
Start measuring power consumption on each MPI rank.
Parameters:
-
package(str) –Package name of the algorithm to profile.
-
algorithm(str) –Name of the algorithm to profile in the list of instruction of the decorated function.
-
algorithm_description(str, default:'') –Description of the profiled algorithm acording to the experimental setup or tesbet details (eg, dataset used, epochs for training, batch size, etc...).
Source code in ea2p/src/power_meter_mpi.py
stop_measure
¤
Stop measuring power consumption and gather results from all MPI processes.