Lua-Performance-Paper.zip

Read full text
Authors: Simão Cunha, João Saraiva, Miguel Guimarães, André Brandão, Diogo Matos
Cited by: 0

Abstract

Experiments details - CPU baseline temperature: 32.2°C - Number of times: 10 Requirements - Debian-based Linux distributions - Intel processor (compatible with RAPL) - Non-containerized environment - Docker (only to install LuaJIT-Remake) Required Libraries 1. RAPL 2. lm-sensors 3. Powercap 4. Raplcap Install all dependencies by running: ```bash sudo bash scripts/install.sh ``` Prerequisites and Configuration Before running measurements, you need to configure the following: 1. Wi-Fi Interface Configuration The measurement script will automatically disable Wi-Fi during measurements to reduce interference. You need to set your Wi-Fi interface name in the script: 1. Find your Wi-Fi interface name: ```bash ip link show | grep -E "wl|wifi" ``` 2. Edit `scripts/measure.sh` and update line 4: ```bash WIFI_INTERFACE="your_interface_name" # e.g., "wlp2s0", "wlan0", "wlo1" ``` 2. System Permissions The script requires sudo privileges for: - Wi-Fi interface control - RAPL energy measurements 3. Environment Variables Ensure the following environment variable is set: ```bash export LANG=C.UTF-8 ``` 4. Power Caps ConfigurationThis repository supports power capping. Since power capping is not a focus of this paper, set the `POWER_CAPS` array to `(-1)`. ```bash POWER_CAPS=(-1) ``` -----------------------------------------// Running RAPL Measurements Important: Ensure you have completed the Prerequisites and Configuration section above before running measurements. To generate energy consumption measurements for all programs in all languages, run: ```bash sudo -E bash scripts/measure.sh [language2] ... | all ``` - Replace [language2] ... with one or more of the supported languages listed below, or use all to run measurements for every supported language. - Supported languages: All supported languages correspond to the folders listed in the `Languages/` directory. This script will append the results to a top-level `measurements.csv` file. Example usages: ```bash # Measure all supported languages sudo -E bash scripts/measure.sh all # Measure only C and Lua_JIT sudo -E bash scripts/measure.sh C "Lua_JIT" ``` If a specified language or directory is not found, the script will exit with an error message. Automatic System Restoration The measurement script automatically handles system cleanup: - Wi-Fi: Automatically restored when the script completes or encounters an error - Error handling: System settings are restored even if the script is interrupted (Ctrl+C) or crashes This ensures your system won't be left in a dimmed state or with Wi-Fi disabled if something goes wrong during measurements. -----------------------------------------// Temperature Calibration To calibrate the average CPU core temperature, execute the following: ```bash cd RAPL make ./main --temperature-calibration XX ``` Replace `XX` with the number of seconds to idle (sleep) before measuring the temperature. The output will be saved to `/tmp/cores_temperature.txt`. --- Powercap Calibration As previously stated, this repository supports power capping. Since power capping is not a focus of this paper, we will not detail the power cap calibration process, even though it is implemented in this framework. If you are curious to determine the most energy-efficient power cap setting for your system (according to the `Package` energy consumption), you must specify custom programs for calibration. The tool supports both compiled and interpreted languages. Run the following commands for more details: ```bash cd RAPL make ./main --help ``` Parametrized Execution To perform energy measurements on a specific program, use the following syntax: ```bash ./main ``` Arguments Argument: Description ``: The command to execute (e.g., `./my_program`) ``: Programming language (e.g., `C`, `Python`) ``: Name of the program being tested ``: Number of times to execute the program (must be > 0) ``: Acceptable temperature variance (in Celsius, must be ≥ 0 ``: Timeout limit per execution (in minutes, must be > 0) ``: Idle time before execution (in seconds, must be ≥ 0) ``: Power cap in watts (-1 for no power cap, or > 0 for power cap) Examples ```bash cd RAPL make # Run with 15W power cap sudo -E ./main "./my_program" C my_program 5 3 20 10 15 # Run without power cap (set to -1) sudo -E ./main "./my_program" C my_program 5 3 20 10 -1 # Python example with 20W power cap sudo -E ./main "python3 script.py" Python script 3 5 30 5 20 ``` The first example will: - Perform idle measurement for 10 seconds - Execute the program 5 times with a 15W power cap - Add 3°C to the temperature variance - Terminate executions exceeding 20 minutes -----------------------------------------// CSV Output Format The `measurements.csv` contains the following columns: Language: Programming language Program: Program name Powercap: Power cap value applied (Watts) Package: Energy used by the full socket (cores + GPU + other components) Core: Energy used by CPU cores and caches GPU: Energy used by GPU DRAM: Energy used by RAM Time: Execution time (in milliseconds) Temperature: Average core temperature (in Celsius) Memory: Total physical memory used (in KBytes) -----------------------------------------// Makefile Target Explanation This document explains each target in the Makefiles used to build and evaluate several programs. 1. `compile` **Command:** ```sh make compile ``` Compiles the source code into an optimized executable binary (when possible). 2. `run` **Command:** ```sh make run ``` Runs the program - either runs a executable binary or runs a interpreted program. **Command executed:** ```sh ./my_program [input] ``` 3. `measure` **Command:** ```sh make measure ``` **Purpose:** Measures energy consumption and executing time by running the program using the RAPL interface. **Command breakdown:** ```sh sudo ./main "./my_program [input]" [language] [program] $(n_times) $(variance) $(time_out_limit) $(sleep_secs) ``` 4. `clean` **Command:** ```sh make clean ``` Removes generated files and cleans up the project directory.

Fields of Study & Subjects

Parallel Computing and Optimization Techniques Energy Efficiency in Computing Green IT and Sustainability

Publication details

Journal / source
Figshare
Publication date
1 January 2026
Document type
Dataset