Skip to content

Commit

Permalink
Organize benchmark_results into levels (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamaguchi1024 authored Oct 26, 2024
1 parent 17daf61 commit 055cd02
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
6 changes: 3 additions & 3 deletions analytics_tools/graphing/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def aggregate(data):
plt.tick_params(axis="y", which="both", length=0)

level_name = level.__name__.replace("_", " ").capitalize()
plt.title(f"{level_name} Geomean of runtime of {lib} / {EXOBLAS_NAME}" + f" ({BACKEND})")
plt.title(f"Runtime of {lib} / {EXOBLAS_NAME}" + f" ({BACKEND})")
plt.xlabel("N")

nrows, ncols = data.shape
Expand All @@ -347,10 +347,10 @@ def aggregate(data):
level_dir = GRAPHS_DIR / "all" / level.__name__
level_dir.mkdir(parents=True, exist_ok=True)
filename = level_dir / f"{bench_type.name}_p{p}_disc_gmean_{lib}_x_ExoBLAS"
png_path = filename.with_suffix('.png')
#png_path = filename.with_suffix('.png')
pdf_path = filename.with_suffix('.pdf')

plt.savefig(png_path)
#plt.savefig(png_path)
plt.savefig(pdf_path)


Expand Down
56 changes: 56 additions & 0 deletions analytics_tools/graphing/organize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Check if the directory path is provided
if [ -z "$1" ]; then
echo "Usage: $0 <directory_path>"
exit 1
fi

DIR="$1"

# Create level1 and level2 directories inside the provided directory
mkdir -p "$DIR/level1"
mkdir -p "$DIR/level2"

# List of subdirectories to copy
SUBDIRS=("exo" "FLAME" "Intel10_64lp_seq" "OpenBLAS")

# Copy the subdirectories into level1 and level2
for SUBDIR in "${SUBDIRS[@]}"; do
cp -r "$DIR/$SUBDIR" "$DIR/level1/"
cp -r "$DIR/$SUBDIR" "$DIR/level2/"
done

# BLAS Level 1 operations
LEVEL1_OPS=(
"asum.json" "axpy.json" "copy.json" "dot.json" "dsdot.json"
"rot.json" "rotm.json" "sdsdot.json" "scal.json" "swap.json"
)

# Files to keep in level2
LEVEL2_KEEP=(
"gemv.json" "ger.json" "symv.json" "syr2.json"
"syr.json" "trmv.json" "trsv.json"
)

# Function to delete files not in a given list
delete_unwanted_files() {
local TARGET_DIR="$1"
shift
local KEEP_FILES=("$@")

for SUBDIR in "${SUBDIRS[@]}"; do
for FILE in "$TARGET_DIR/$SUBDIR/"*.json; do
BASENAME=$(basename "$FILE")
if [[ ! " ${KEEP_FILES[@]} " =~ " $BASENAME " ]]; then
rm -f "$FILE"
fi
done
done
}

# Delete unwanted files in level1
delete_unwanted_files "$DIR/level1" "${LEVEL1_OPS[@]}"

# Delete unwanted files in level2
delete_unwanted_files "$DIR/level2" "${LEVEL2_KEEP[@]}"

0 comments on commit 055cd02

Please sign in to comment.