Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow benchmarking from a matrix list file #503

Merged
merged 4 commits into from
Apr 24, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Review updates.
+ Fix the detailed variable management for when nothing is passed.
+ Add an error when the matrix list file is set but cannot be found.
+ Use BASH_REMATCH regex form for extracting the matrix group and name.

Co-authored-by: Yuhsiang M. Tsai <[email protected]>
  • Loading branch information
tcojean and yhmtsai committed Apr 24, 2020
commit f228adb5c788bd64a5abfa1826702925690fcd08
11 changes: 7 additions & 4 deletions benchmark/run_all_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fi

# Control whether to run detailed benchmarks or not.
# Default setting is detailed=false. To activate, set DETAILED=1.
if [ "${DETAILED}" -eq 0 ]; then
if [ ! "${DETAILED}" ] || [ "${DETAILED}" -eq 0 ]; then
DETAILED_STR="--detailed=false"
else
DETAILED_STR="--detailed=true"
Expand All @@ -80,6 +80,9 @@ if [ ! "${MATRIX_LIST_FILE}" ]; then
use_matrix_list_file=0
elif [ -f "${MATRIX_LIST_FILE}" ]; then
use_matrix_list_file=1
else
echo -e "A matrix list file was set to ${MATRIX_LIST_FILE} but it cannot be found."
exit 1
fi
tcojean marked this conversation as resolved.
Show resolved Hide resolved


Expand Down Expand Up @@ -223,9 +226,9 @@ parse_matrix_list() {
if [[ ! "$mtx" =~ ^[0-9]+$ ]]; then
if [[ "$mtx" =~ ^[a-zA-Z0-9_-]+$ ]]; then
id=$(${SSGET} -s "[ @name == $mtx ]")
elif [[ "$mtx" =~ ^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$ ]]; then
local group=$(echo $mtx | cut -d"/" -f1)
local name=$(echo $mtx | cut -d"/" -f2)
elif [[ "$mtx" =~ ^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)$ ]]; then
local group="${BASH_REMATCH[1]}"
local name="${BASH_REMATCH[2]}"
id=$(${SSGET} -s "[ @name == $name ] && [ @group == $group ]")
else
>&2 echo -e "Could not recognize entry $mtx."
Expand Down