Skip to content

Commit d778ae3

Browse files
author
Can Gokmen
committed
Worked more on cleanup
1 parent 879f5ad commit d778ae3

13 files changed

Lines changed: 33 additions & 388 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
2424
# add_executable(main main.cpp)
2525
# add_executable(insert_profiling insert_profiling.cpp)
2626
add_executable(run run.cpp)
27-
add_executable(test_compress test/test_compress.cpp)
2827

2928
# TPC-C insert experiment (ART paper replication, warehouse=1)
30-
# Note: ArtNodeNewMethods.cpp is #include'd from the QuART headers,
29+
# Note: QuArtNodeMethods.cpp is #include'd from the QuART headers,
3130
# so it must NOT be listed as a separate translation unit here.
3231
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tpcc/tpcc_art.cpp")
3332
add_executable(tpcc_art tpcc/tpcc_art.cpp)

compare_bulkload.sh

Lines changed: 0 additions & 102 deletions
This file was deleted.

experiments/5.2-quart-vs-quit/run.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# Environment variables (all optional):
1212
# WORKLOAD_DIR – directory containing BoDS workload .bin files
1313
# (default: /scratch/cgokmen/bods/workloads)
14-
# REPEAT – number of timed repetitions per configuration (default: 5)
14+
# REPEAT – number of timed repetitions per configuration (default: 1)
15+
# (set to 5 to reproduce the paper's numbers; substantially longer)
1516
#
1617
# Output:
1718
# experiments/5.2-quart-vs-quit/results/results_<TIMESTAMP>.csv
@@ -42,7 +43,7 @@ if [[ ! -x "$QUIT_BUILD/run_quit_2k" ]]; then
4243
fi
4344

4445
WORKLOAD_DIR="${WORKLOAD_DIR:-$WORKLOAD_DIR}"
45-
REPEAT="${REPEAT:-5}"
46+
REPEAT="${REPEAT:-1}" # paper used 5; increase for publication-quality averages
4647
N=500000000
4748

4849
SUFFIX=$(date +"%Y%m%d_%H%M%S")
@@ -64,7 +65,7 @@ echo ""
6465
# ---------------------------------------------------------------------------
6566
echo "workload,K,L,tree_type,avg_insert_ns,avg_query_ns" > "$RESULTS_FILE"
6667

67-
TREES=(QuART_stail QuIT_2k)
68+
TREES=(QuART_stail QuIT)
6869

6970
# ---------------------------------------------------------------------------
7071
# Helper: run one (workload, tree) configuration REPEAT times and average
@@ -73,7 +74,7 @@ run_config() {
7374
local FILE="$1" N_VAL="$2" K_VAL="$3" L_VAL="$4" TREE="$5"
7475
local WNAME LOG INSERT_SUM QUERY_SUM FAILED BINARY
7576
WNAME="$(basename "$FILE" .bin)"
76-
LOG="$LOG_DIR/${WNAME}_${TREE}.log"
77+
LOG="$LOG_DIR/${WNAME}.log"
7778
INSERT_SUM=0
7879
QUERY_SUM=0
7980
FAILED=0
@@ -85,7 +86,7 @@ run_config() {
8586
BINARY="$BUILD/run"
8687
fi
8788

88-
echo "=== workload=$WNAME tree=$TREE ===" > "$LOG"
89+
echo "=== workload=$WNAME tree=$TREE ===" >> "$LOG"
8990

9091
for ((i=1; i<=REPEAT; i++)); do
9192
echo "--- Run $i/$REPEAT ---" >> "$LOG"
@@ -98,7 +99,7 @@ run_config() {
9899
if [[ $STATUS -ne 0 || -z "$OUTPUT" ]]; then
99100
echo " [WARN] run failed: K=$K_VAL L=$L_VAL tree=$TREE run=$i" >&2
100101
FAILED=1
101-
break
102+
continue
102103
fi
103104

104105
CSV_LINE=$(echo "$OUTPUT" | tail -1)

experiments/5.3-tpch/run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# Environment variables (all optional):
1313
# WORKLOAD_FILE – path to the TPC-H .bin workload file
1414
# (default: /scratch/cgokmen/bods/workloads/workload_N6000000_K9667_L01.bin)
15-
# REPEAT – number of timed repetitions per configuration (default: 5)
15+
# REPEAT – number of timed repetitions per configuration (default: 10)
16+
# (set to 200 to reproduce the paper's numbers; substantially longer)
1617
#
1718
# Output:
1819
# experiments/5.3-tpch/results/results_<TIMESTAMP>.csv
@@ -43,7 +44,7 @@ if [[ ! -x "$QUIT_BUILD/run_quit_2k" || ! -x "$QUIT_BUILD/run_quit_base_2k" ]];
4344
fi
4445

4546
WORKLOAD_FILE="${WORKLOAD_FILE:-$WORKLOAD_DIR/workload_N6000000_K9667_L01.bin}"
46-
REPEAT="${REPEAT:-5}"
47+
REPEAT="${REPEAT:-10}" # paper used 200; increase for publication-quality averages
4748
N=6000000
4849

4950
SUFFIX=$(date +"%Y%m%d_%H%M%S")

experiments/5.4-bulkload/run.sh

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
# for increasing numbers of sorted keys (100M to 2B). Output corresponds to
66
# Figure 11 in the paper: insertion time vs. number of elements.
77
#
8-
# The bulk-load path generates sequential keys 1..N synthetically (independent
9-
# of the workload file) to guarantee a fully sorted input. The regular-insert
10-
# path reads the first N keys from the sorted workload file; sizes larger than
11-
# the file are skipped automatically.
8+
# Both regular and bulk-load paths generate sequential keys 1..N synthetically
9+
# (no workload file required), guaranteeing a fully sorted input.
1210
#
1311
# Usage:
1412
# bash experiments/5.4-bulkload/run.sh
1513
#
1614
# Environment variables (all optional):
17-
# WORKLOAD_FILE – sorted (K=0) .bin workload file
18-
# (default: /scratch/cgokmen/bods/workloads/workload_N500000000_K0_L0.bin)
1915
# REPEAT – number of timed repetitions per configuration (default: 5)
2016
#
2117
# Output:
@@ -36,7 +32,6 @@ BUILD="$REPO_ROOT/build"
3632
# Bootstrap: clone deps, generate workloads, build binaries (idempotent)
3733
source "$SCRIPT_DIR/../setup.sh"
3834

39-
WORKLOAD_FILE="${WORKLOAD_FILE:-$WORKLOAD_DIR/workload_N500000000_K0_L0.bin}"
4035
REPEAT="${REPEAT:-5}"
4136

4237
# Test sizes matching Figure 11 (100M to 2B)
@@ -49,10 +44,7 @@ LOG_DIR="$RESULTS_DIR/logs_${SUFFIX}"
4944

5045
mkdir -p "$RESULTS_DIR" "$LOG_DIR"
5146

52-
# Determine number of keys available in the workload file
53-
FILE_KEYS=$(( $(stat -c%s "$WORKLOAD_FILE") / 4 ))
5447
echo "Experiment 5.4 — Bulk Loading Performance"
55-
echo " WORKLOAD_FILE : $WORKLOAD_FILE (${FILE_KEYS} keys)"
5648
echo " REPEAT : $REPEAT"
5749
echo " Results : $RESULTS_FILE"
5850
echo " Logs : $LOG_DIR"
@@ -68,8 +60,8 @@ echo "N,insertion_method,avg_insert_ns,avg_query_ns" > "$RESULTS_FILE"
6860
# ---------------------------------------------------------------------------
6961
run_config() {
7062
local N_VAL="$1" METHOD="$2"
71-
local EXTRA_ARGS=""
72-
[[ "$METHOD" == "bulkload" ]] && EXTRA_ARGS="--bulkload"
63+
local EXTRA_ARGS="--synthetic"
64+
[[ "$METHOD" == "bulkload" ]] && EXTRA_ARGS="--synthetic --bulkload"
7365

7466
local LOG="$LOG_DIR/N${N_VAL}_${METHOD}.log"
7567
local INSERT_SUM=0 QUERY_SUM=0 FAILED=0
@@ -79,7 +71,7 @@ run_config() {
7971
for ((i=1; i<=REPEAT; i++)); do
8072
echo "--- Run $i/$REPEAT ---" >> "$LOG"
8173
# shellcheck disable=SC2086
82-
OUTPUT=$("$BUILD/run" -f "$WORKLOAD_FILE" -N "$N_VAL" -t ART $EXTRA_ARGS 2>>"$LOG") || true
74+
OUTPUT=$("$BUILD/run" -N "$N_VAL" -t ART $EXTRA_ARGS 2>>"$LOG") || true
8375
STATUS=$?
8476
echo "$OUTPUT" >> "$LOG"
8577

@@ -110,16 +102,10 @@ run_config() {
110102
for N in "${TEST_SIZES[@]}"; do
111103
echo ">>> N=$N"
112104

113-
# Regular insertion requires the file to have enough keys
114-
if (( N <= FILE_KEYS )); then
115-
echo " [regular]"
116-
run_config "$N" "regular"
117-
else
118-
echo " [regular] SKIP — workload file has only ${FILE_KEYS} keys (need $N)" >&2
119-
echo "$N,regular,SKIPPED,SKIPPED" >> "$RESULTS_FILE"
120-
fi
105+
echo " [regular]"
106+
run_config "$N" "regular"
121107

122-
# Bulk load always works: it generates sequential keys 1..N synthetically
108+
# Bulk load uses grouped insertion on the same synthetic key sequence
123109
echo " [bulkload]"
124110
run_config "$N" "bulkload"
125111
done

insert_profiling.cpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

run.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "trees/QuART_lil.h"
1212
#include "trees/QuART_tail.h"
1313
#include "trees/QuART_stail.h"
14-
#include "ArtNodeBulkLoadMethods.cpp"
14+
#include "QuArtNodeBulkLoadMethods.cpp"
1515

1616
using namespace std;
1717

@@ -47,9 +47,10 @@ std::vector<key_type> read_file(const std::string& filename) {
4747
int main(int argc, char** argv) {
4848
bool verbose = false; // optional argument
4949
int N = 500000000; // optional argument
50-
string input_file = "/scratch/cgokmen/Qu-ART/tpch/benchmarksql_workdir/workload.txt"; // required argument
50+
string input_file = ""; // optional argument (-f)
5151
string tree_type = "ART"; // default tree type
5252
bool use_bulkload = false; // optional argument
53+
bool use_synthetic = false; // optional argument: generate keys 1..N instead of reading a file
5354

5455
// Query 1% of entries
5556
uint64_t minval = 0;
@@ -71,6 +72,9 @@ int main(int argc, char** argv) {
7172
} else if (string(argv[i]) == "--bulkload") {
7273
use_bulkload = true;
7374
i++;
75+
} else if (string(argv[i]) == "--synthetic") {
76+
use_synthetic = true;
77+
i++;
7478
} else {
7579
i++;
7680
}
@@ -79,7 +83,13 @@ int main(int argc, char** argv) {
7983
uint64_t maxval = N-1;
8084

8185
// read data
82-
auto keys = read_file<uint32_t>(input_file);
86+
std::vector<uint32_t> keys;
87+
if (use_synthetic) {
88+
keys.resize(N);
89+
for (int i = 0; i < N; i++) keys[i] = static_cast<uint32_t>(i + 1);
90+
} else {
91+
keys = read_file<uint32_t>(input_file);
92+
}
8393

8494
if (tree_type == "ART") {
8595
ART::ART* tree = new ART::ART();

0 commit comments

Comments
 (0)