69 lines
No EOL
2.2 KiB
Bash
Executable file
69 lines
No EOL
2.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Function to write results to CSV
|
|
write_to_csv() {
|
|
local csv_file="$1"
|
|
local noc_factor="$2"
|
|
local comp_factor="$3"
|
|
local time_per_rep_microseconds="$4"
|
|
|
|
if [ ! -f "$csv_file" ]; then
|
|
echo "noc_factor,comp_factor,time_per_rep_microseconds" > "$csv_file"
|
|
fi
|
|
echo "$noc_factor,$comp_factor,$time_per_rep_microseconds" >> "$csv_file"
|
|
}
|
|
|
|
echo "Starting run_para_explor_gem5.sh script..."
|
|
script_start=$(date +%s)
|
|
|
|
csv_file="/home/sfischer/Documents/projects/wk_LinProg/optimization_results/inception70/resultsGem5.csv"
|
|
|
|
# for noc_factor in $(seq 1.0 -0.1 0.1); do
|
|
# for comp_factor in $(seq 1.0 -0.1 0.1); do
|
|
|
|
for noc_factor in 0.1 1; do
|
|
for comp_factor in 0.1 1; do
|
|
|
|
echo "---------------------------------------------"
|
|
echo "Running LinProg with noc_factor=$noc_factor and comp_factor=$comp_factor"
|
|
|
|
step_start=$(date +%s)
|
|
|
|
cd /home/sfischer/Documents/projects/wk_LinProg/LinProg_Scripts
|
|
|
|
echo "Executing LinProg..."
|
|
sim_start=$(date +%s)
|
|
papermill Task_LinProg.ipynb output.ipynb -p param1 "$noc_factor" -p param2 "$comp_factor"
|
|
|
|
cd /home/sfischer/Documents/projects/wk_LinProg/XML_Scripts
|
|
jupyter execute Graph2XML.ipynb
|
|
|
|
cd /home/sfischer/Documents/projects/wk_LinProg/XML_Scripts
|
|
jupyter execute mappingXML.ipynb
|
|
|
|
sim_end=$(date +%s)
|
|
|
|
|
|
echo "Total time for LinProg $noc_factor $comp_factor: $((sim_end - sim_start)) seconds."
|
|
|
|
step_start=$(date +%s)
|
|
|
|
|
|
cd /home/sfischer/Documents/projects/wk_LinProg/simulation/scripts
|
|
|
|
|
|
# ./run_linProg.sh "NoOpt_NoC_${noc_factor}_Comp_${comp_factor}"
|
|
# Call your run_linProg.sh and capture the output
|
|
time_per_rep_microseconds=$(./run_linProg.sh "Opt_NoC_${noc_factor}_Comp_${comp_factor}" | tail -1)
|
|
|
|
# Write to CSV
|
|
write_to_csv "$csv_file" "$noc_factor" "$comp_factor" "$time_per_rep_microseconds"
|
|
|
|
step_end=$(date +%s)
|
|
echo "Total time for LinProg $noc_factor $comp_factor: $((step_end - step_start)) seconds."
|
|
done
|
|
done
|
|
|
|
script_end=$(date +%s)
|
|
echo "All runs completed."
|
|
echo "Total script time: $((script_end - script_start)) seconds." |