Skip to content

Commit

Permalink
Add feature to run in different directory
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Apr 28, 2023
1 parent 21c65e5 commit dc2d426
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions benchmarks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Set Defaults
COMMAND=data
BENCHMARK=all
DATAFUSION_DIR=${DATAFUSION_DIR:-$SCRIPT_DIR/..}
DATA_DIR=${DATA_DIR:-$SCRIPT_DIR/data}
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
BRANCH_NAME=$(cd ${DATAFUSION_DIR} && git rev-parse --abbrev-ref HEAD)
BRANCH_NAME=${BRANCH_NAME//\//_} # mind blowing syntax to replace / with _
RESULTS_DIR=${RESULTS_DIR:-"$SCRIPT_DIR/results/$BRANCH_NAME"}
#CARGO_COMMAND=$CARGO_COMMAND:"cargo run --release"}
Expand All @@ -49,7 +50,11 @@ Usage: $0 <command> [benchmark]
Examples:
**********
./bench.sh gen # Create the datasets for all benchmarks in $DATA_DIR
# Create the datasets for all benchmarks in $DATA_DIR
./bench.sh data
# Run the 'tpch' benchmark on the datafusion checkout in /source/arrow-datafusion
DATAFASION_DIR=/source/arrow-datafusion ./bench.sh run tpch
**********
* Commands
Expand Down Expand Up @@ -118,6 +123,7 @@ main() {
echo "DataFusion Benchmark Script"
echo "COMMAND: ${COMMAND}"
echo "BENCHMARK: ${BENCHMARK}"
echo "DATAFUSION_DIR: ${DATAFUSION_DIR}"
echo "BRACH_NAME: ${BRANCH_NAME}"
echo "DATA_DIR: ${DATA_DIR}"
echo "RESULTS_DIR: ${RESULTS_DIR}"
Expand Down Expand Up @@ -145,6 +151,8 @@ main() {
esac
;;
run)
# navigate to the appropriate checkout
pushd "${DATAFUSION_DIR}/benchmarks"
mkdir -p "${RESULTS_DIR}"
case "$BENCHMARK" in
all)
Expand All @@ -161,6 +169,7 @@ main() {
usage
;;
esac
popd "${DATAFUSION_DIR}/benchmarks"
;;
*)
echo "Error: unknown command: $COMMAND"
Expand Down

0 comments on commit dc2d426

Please sign in to comment.