diff --git a/examples/hyper_threading/hyper-threading b/examples/hyper_threading/hyper-threading new file mode 100644 index 0000000000..912b6cac75 --- /dev/null +++ b/examples/hyper_threading/hyper-threading @@ -0,0 +1,17 @@ +#!/bin/bash + +thread_counts=(1 2 4 6 8 10 12 16 24 32 ) +binary="target/release/hyper_threading" + + +cmd="hyperfine -r 1" + +# Build the command string with all thread counts +for threads in "${thread_counts[@]}"; do + # For hyperfine, wrap each command in 'sh -c' to correctly handle the environment variable + cmd+=" -n \"threads: ${threads}\" 'sh -c \"RAYON_NUM_THREADS=${threads} ${binary}\"'" +done + +# Execute the hyperfine command +echo "Executing benchmark for all thread counts" +eval $cmd diff --git a/examples/hyper_threading/hyper-threading-workflow.sh b/examples/hyper_threading/hyper-threading-workflow.sh index 62c6432fd8..cd36f706c7 100644 --- a/examples/hyper_threading/hyper-threading-workflow.sh +++ b/examples/hyper_threading/hyper-threading-workflow.sh @@ -4,7 +4,7 @@ thread_counts=(1 2 4 6 8 16 32) # Define una lista con los nombres de los binarios -binaries=("hyper_threading_main" "hyper_threading_pr") +binaries=("hyper_threading_main_binary/hyper_threading_main" "hyper_threading_pr_binary/hyper_threading_pr") # Itera sobre la lista de thread_counts for threads in "${thread_counts[@]}"; do