Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ impl Jobs {
results_dir: &str,
events_by_vendor: &EventsByVendor,
os_flavor: String,
g5k_username: String
) -> Result<(), JobError> {
let sites = inventories::get_inventory_sites(inventories_dir)?;
let mut clusters_nodes: Vec<Vec<(String, String, Node)>> = Vec::new();
Expand Down Expand Up @@ -479,7 +480,7 @@ impl Jobs {
)?;
fs::create_dir_all(results_dir)?;

scripts::generate_script_file(&job, events_by_vendor)?;
scripts::generate_script_file(&job, events_by_vendor, g5k_username.clone())?;

job.submit_job().await?;
self.jobs.push(job);
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ async fn main() -> Result<(), BenchmarkError> {
&benchmark_args.results_directory,
)?;

let g5k_username = env::var("G5K_USERNAME").unwrap_or_else(|_| "debug".to_string());
let events_by_vendor = load_events_config(&benchmark_args.config_file)?;
let mut jobs: Jobs = load_or_init_jobs(&benchmark_args.jobs_file)?;

Expand Down Expand Up @@ -317,6 +318,7 @@ async fn main() -> Result<(), BenchmarkError> {
&benchmark_args.results_directory,
&events_by_vendor,
benchmark_args.os_flavor.clone(),
g5k_username.clone()
)
.await?;

Expand Down
5 changes: 5 additions & 0 deletions src/scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct BenchmarkTemplate {
perf_events: PerfEvents,
cpu_ops_per_core_list: Vec<u32>,
os_flavor: String,
g5k_username: String
}

impl BenchmarkTemplate {
Expand Down Expand Up @@ -84,6 +85,7 @@ impl BenchmarkTemplate {
perf_events: PerfEvents,
cpu_ops_per_core_list: &[u32],
os_flavor: String,
g5k_username: String,
) -> Self {
Self {
nb_iterations,
Expand Down Expand Up @@ -115,6 +117,7 @@ impl BenchmarkTemplate {
perf_events,
cpu_ops_per_core_list: cpu_ops_per_core_list.into(),
os_flavor,
g5k_username
}
}
}
Expand All @@ -130,6 +133,7 @@ pub enum ScriptError {
pub fn generate_script_file(
job: &jobs::Job,
events_by_vendor: &EventsByVendor,
g5k_username: String
) -> Result<(), ScriptError> {
dotenv::dotenv().ok();
debug!("Creating file : {}", &job.script_file);
Expand Down Expand Up @@ -183,6 +187,7 @@ pub fn generate_script_file(
perf_events,
CPU_OPS_PER_CORE_LIST,
job.os_flavor.clone(),
g5k_username.clone()
);
let benchmark = benchmark.render().unwrap();
file.write_all(benchmark.as_bytes())?;
Expand Down
2 changes: 1 addition & 1 deletion templates/alumet_alone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git checkout "v0.7.0"
cd app-agent
cargo build --release --features local_x86
${SUDO_CMD}ln -s $(realpath ../target/release/alumet-local-agent) /usr/local/bin/alumet
cd /home/nleblond
cd /home/{{ g5k_username }}
alumet regen-config

{% for core_value in core_values %}
Expand Down
2 changes: 1 addition & 1 deletion templates/alumet_and_perf.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### ALUMET with ${CORE_VALUE} CPU * ${CPU_OPS_PER_CORE} OPS
TEMPERATURE_START=$(get_average_temperature)
sed -i 's/poll_interval = "[0-9]*m\{0,1\}s"/poll_interval = "1000ms"/' /home/nleblond/alumet-config.toml
sed -i 's/poll_interval = "[0-9]*m\{0,1\}s"/poll_interval = "1000ms"/' /home/{{ g5k_username }}/alumet-config.toml
${SUDO_CMD}bash -c "alumet --plugins 'csv,rapl' --output '/tmp/alumet_and_perf_${CORE_VALUE}_${CPU_OPS_PER_CORE}_${i}.csv' & echo \$!" > /tmp/alumet_pid_$i
ALUMET_PID=$(cat /tmp/alumet_pid_$i)
${SUDO_CMD}bash -c "perf stat -a -o /tmp/perf_and_alumet_${CORE_VALUE}_${CPU_OPS_PER_CORE}_$i {% for perf_event in perf_events.iter() %}-e {{ perf_event }} {% endfor %} & echo \$!" > /tmp/perf_pid_$i
Expand Down
8 changes: 4 additions & 4 deletions templates/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source codecarbon/bin/activate
sed -i 's/Timer(self.interval, self._run)/Timer(self.interval\/1000, self._run)/' codecarbon/codecarbon/external/scheduler.py
sed -i 's/logging.Formatter(format, datefmt="%H:%M:%S")/logging.Formatter(format, datefmt=None)/' codecarbon/codecarbon/external/logger.py
pip install /tmp/codecarbon
${SUDO_CMD}ln -s /home/nleblond/.local/bin/codecarbon /usr/local/bin/codecarbon
${SUDO_CMD}ln -s /home/{{ g5k_username }}/.local/bin/codecarbon /usr/local/bin/codecarbon
{% endif %}


Expand All @@ -33,7 +33,7 @@ git checkout "v0.7.0"
cd app-agent
cargo build --release --features local_x86
${SUDO_CMD}ln -s $(realpath ../target/release/alumet-local-agent) /usr/local/bin/alumet
cd /home/nleblond
cd /home/{{ g5k_username }}
alumet regen-config
{% endif %}

Expand All @@ -50,15 +50,15 @@ git checkout "v1.0.1"
sed -i 's/riemann_client = { version = "0.9.0"/riemann_client = { path = "..\/rust-riemann_client"/' Cargo.toml
cargo build --release
${SUDO_CMD}ln -s $(realpath ./target/release/scaphandre) /usr/local/bin/scaphandre
cd /home/nleblond
cd /home/{{ g5k_username }}
{% endif %}

{% if vjoule_alone || vjoule_and_perf %}
cd /tmp
wget https://github.com/davidson-consulting/vjoule/releases/download/v1.3.0/vjoule-tools_1.3.0.deb
dpkg -i vjoule-tools_1.3.0.deb
${SUDO_CMD}systemctl start vjoule_service
cd /home/nleblond
cd /home/{{ g5k_username }}

${SUDO_CMD}systemctl status vjoule_service
sleep 30
Expand Down
2 changes: 1 addition & 1 deletion templates/codecarbon_alone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python3.12 -m venv codecarbon
cd codecarbon/
source bin/activate
pip install codecarbon
cd /home/nleblond
cd /home/{{ g5k_username }}

{% for core_value in core_values %}
{% for cpu_ops_per_core in cpu_ops_per_core_list %}
Expand Down
2 changes: 1 addition & 1 deletion templates/frequencies_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#ALUMET
TEMPERATURE_START=$(get_average_temperature)
sed -i 's/poll_interval = "[0-9]*m\{0,1\}s"/poll_interval = "{{ 1000 / target_frequency }}ms"/' /home/nleblond/alumet-config.toml
sed -i 's/poll_interval = "[0-9]*m\{0,1\}s"/poll_interval = "{{ 1000 / target_frequency }}ms"/' /home/{{ g5k_username }}/alumet-config.toml
${SUDO_CMD}bash -c "alumet --plugins 'csv,rapl' --output '/tmp/frequency_{{ target_frequency }}_alumet_and_perf_${i}.csv' & echo \$!" > /tmp/alumet_pid_$i
ALUMET_PID=$(cat /tmp/alumet_pid_$i)
${SUDO_CMD}perf stat -a -o /tmp/frequency_{{ target_frequency }}_perf_and_alumet_$i {% for perf_event in perf_events.iter() %}-e {{ perf_event }} {% endfor %} sleep 40
Expand Down
2 changes: 1 addition & 1 deletion templates/scaphandre_alone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd scaphandre
git checkout "v1.0.1"
cargo build --release
${SUDO_CMD}ln -s $(realpath ./target/release/scaphandre) /usr/local/bin/scaphandre
cd /home/nleblond
cd /home/{{ g5k_username }}

{% for core_value in core_values %}
{% for cpu_ops_per_core in cpu_ops_per_core_list %}
Expand Down
2 changes: 1 addition & 1 deletion templates/vjoule_alone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cd /tmp
wget https://github.com/davidson-consulting/vjoule/releases/download/v1.3.0/vjoule-tools_1.3.0.deb
dpkg -i vjoule-tools_1.3.0.deb
${SUDO_CMD}systemctl start vjoule_service
cd /home/nleblond
cd /home/{{ g5k_username }}

${SUDO_CMD}systemctl status vjoule_service
sleep 30
Expand Down
4 changes: 2 additions & 2 deletions templates/zip_results.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cd {{ results_directory }}/..
tar -cJf /home/nleblond/{{ results_directory }}.tar.xz /home/nleblond/{{ results_directory }}
cd /home/nleblond
tar -cJf /home/{{ g5k_username }}/{{ results_directory }}.tar.xz /home/{{ g5k_username }}/{{ results_directory }}
cd /home/{{ g5k_username }}
rm -rf {{ results_directory }}
md5sum {{ results_directory }}.tar.xz > {{ results_directory }}.tar.xz.md5
Loading