Skip to content

Commit 44a26c2

Browse files
committed
check if mvn and java is installed,
1 parent 64e68d6 commit 44a26c2

File tree

12 files changed

+181
-134
lines changed

12 files changed

+181
-134
lines changed

data/include/data.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "float/float_dataset.hpp"
99
#include "generated_columns.hpp"
1010
#include <fstream>
11+
#include <vector>
1112

1213
namespace alp_data {
1314

publication/script/install_dependencies.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,23 @@ sudo apt-get install -y python3-pip
4141
pip3 install --upgrade pip --break-system-packages
4242
pip3 install pandas seaborn --break-system-packages
4343

44+
# Install Java version 8
45+
echo "Installing Java 8..."
46+
sudo apt-get install -y openjdk-8-jdk
47+
48+
# Set Java 8 as default
49+
echo "Setting Java 8 as the default Java version..."
50+
sudo update-alternatives --config java <<<'1'
51+
52+
# Verify Java installation
53+
java -version
54+
55+
# Install Maven
56+
echo "Installing Maven..."
57+
sudo apt-get install -y maven
58+
59+
# Verify Maven installation
60+
mvn -v
61+
4462
# Final check
45-
echo "All dependencies installed successfully! Python dependencies are installed system-wide."
63+
echo "All dependencies installed successfully: Clang++, CMake, Boost, BZIP2, OpenSSL, libcurl, g++, Python (pip, pandas, seaborn), Java 8, and Maven."

publication/script/master_script.sh

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ green_echo() {
99
}
1010

1111
brown_echo() {
12-
echo -e "\033[33m $1\033[0m" >/dev/tty
12+
echo -e "\033[33m-- $1\033[0m" >/dev/tty
1313
}
1414

1515
black_echo() {
16-
echo -e "\033[30m $1\033[0m" >/dev/tty
16+
echo -e "\033[30m--$1\033[0m" >/dev/tty
1717
}
1818

1919
red_echo() {
20-
echo -e "\033[31mError: $1\033[0m" >/dev/tty
20+
echo -e "\033[31m-- Error: $1\033[0m" >/dev/tty
2121
}
2222

2323
# Set up workspace variables
2424
green_echo "Setting up workspace variables..."
2525
WORKSPACE=$(pwd)
2626
REPO_URL="https://github.com/cwida/ALP.git"
2727
CLONED_DIR="$WORKSPACE/ALP"
28-
BRANCH="repro"
28+
BRANCH="elf"
2929

3030
# Clone or update the repository
3131
green_echo "Cloning or updating repository..."
@@ -57,6 +57,33 @@ fi
5757
green_echo "Navigating to target directory..."
5858
cd "$CLONED_DIR"
5959

60+
# Check if Java is installed
61+
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
62+
brown_echo "Detected Java version: $java_version"
63+
64+
if [[ "$java_version" == 1.8* || "$java_version" == 8* ]]; then
65+
green_echo "Java 8 is installed and set as the default version."
66+
else
67+
red_echo "Error: Java 8 is not installed or not set as the default version."
68+
exit 1
69+
fi
70+
71+
# Check if Maven is installed
72+
if command -v mvn >/dev/null 2>&1; then
73+
maven_version=$(mvn -v | awk '/Apache Maven/ {print $3}')
74+
java_version_in_maven=$(mvn -v | awk -F '"' '/Java version/ {print $2}')
75+
76+
green_echo "Maven is installed. Detected Maven version: $maven_version"
77+
brown_echo "Maven is using Java version: $java_version_in_maven"
78+
else
79+
red_echo "Error: Maven is not installed."
80+
exit 1
81+
fi
82+
83+
green_echo "Running ELF benchmarks..."
84+
mvn -f "$CLONED_DIR/publication/source_code/extern/elf/pom.xml" clean
85+
mvn -f "$CLONED_DIR/publication/source_code/extern/elf/pom.xml" test
86+
6087
# Create build directory
6188
green_echo "Creating build directory..."
6289
mkdir -p "$CLONED_DIR/build"
@@ -103,11 +130,6 @@ if [ $? -ne 0 ]; then
103130
exit 1
104131
fi
105132

106-
# ELF
107-
green_echo "Running ELF benchmarks..."
108-
mvn -f "$CLONED_DIR/publication/source_code/extern/elf/pom.xml" clean
109-
mvn -f "$CLONED_DIR/publication/source_code/extern/elf/pom.xml" test
110-
111133
green_echo "Running compression ratio benchmarks..."
112134
"$CLONED_DIR/build/publication/source_code/bench_compression_ratio/publication_bench_alp_compression_ratio"
113135
"$CLONED_DIR/build/publication/source_code/bench_compression_ratio/publication_bench_alp32_compression_ratio"
@@ -129,33 +151,33 @@ if [ "$ARCH" == "arm64" ]; then
129151
"$CLONED_DIR/build/publication/source_code/generated/arm64v8/neon_intrinsic_uf1/arm64v8_neon_intrinsic_1024_uf1_falp_bench"
130152
else
131153

132-
# 4xLarge benchmarks
133-
green_echo "Running I4I_4XLarge speed benchmarks..."
134-
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx512bw_intrinsic_1024_uf1_falp_bench"
135-
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx512bw_intrinsic_1024_uf1_falp_bench_bw"
136-
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx2_intrinsic_1024_uf1_falp_bench"
137-
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/fallback_scalar_aav_1024_uf1_falp_bench"
138-
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/fallback_scalar_nav_1024_uf1_falp_bench"
139-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_cutter_decode"
140-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_cutter_encode"
141-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_encode"
142-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_without_sampling"
143-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_chimp"
144-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_chimp128"
145-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_gorillas"
146-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_patas"
147-
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_zstd"
148-
149-
# End-to-end benchmark
150-
SCRIPT_DIR=$(dirname "$(realpath "$0")")
151-
OUTPUT_FILE="$SCRIPT_DIR/publication/end_to_end_bench/result"
152-
HEADER="dataset,repetition,warmup_repetition,scheme,thread_n,query,time(s),result(tpc),corrected_result(tpc),validity,compression_cycles,cycles"
153-
green_echo "Running end-to-end benchmark and saving results to $OUTPUT_FILE ..."
154-
export CLONED_DIR="$CLONED_DIR"
155-
bash "$CLONED_DIR/publication/script/run_end_to_end.sh" >"$OUTPUT_FILE" 2>&1
156-
# Ensure the header line is at the start of the file
157-
echo -e "$HEADER\n$(cat "$OUTPUT_FILE")" >"$OUTPUT_FILE"
158-
green_echo "Benchmark completed. Results are saved in $OUTPUT_FILE."
154+
# 4xLarge benchmarks
155+
green_echo "Running I4I_4XLarge speed benchmarks..."
156+
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx512bw_intrinsic_1024_uf1_falp_bench"
157+
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx512bw_intrinsic_1024_uf1_falp_bench_bw"
158+
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/x86_64_avx2_intrinsic_1024_uf1_falp_bench"
159+
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/fallback_scalar_aav_1024_uf1_falp_bench"
160+
"$CLONED_DIR/build/publication/source_code/generated/x86_64/avx512bw_intrinsic_uf1/fallback_scalar_nav_1024_uf1_falp_bench"
161+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_cutter_decode"
162+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_cutter_encode"
163+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_encode"
164+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_alp_without_sampling"
165+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_chimp"
166+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_chimp128"
167+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_gorillas"
168+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_patas"
169+
"$CLONED_DIR/build/publication/source_code/bench_speed/publication_bench_zstd"
170+
171+
# End-to-end benchmark
172+
SCRIPT_DIR=$(dirname "$(realpath "$0")")
173+
OUTPUT_FILE="$SCRIPT_DIR/publication/end_to_end_bench/result"
174+
HEADER="dataset,repetition,warmup_repetition,scheme,thread_n,query,time(s),result(tpc),corrected_result(tpc),validity,compression_cycles,cycles"
175+
green_echo "Running end-to-end benchmark and saving results to $OUTPUT_FILE ..."
176+
export CLONED_DIR="$CLONED_DIR"
177+
bash "$CLONED_DIR/publication/script/run_end_to_end.sh" >"$OUTPUT_FILE" 2>&1
178+
# Ensure the header line is at the start of the file
179+
echo -e "$HEADER\n$(cat "$OUTPUT_FILE")" >"$OUTPUT_FILE"
180+
green_echo "Benchmark completed. Results are saved in $OUTPUT_FILE."
159181

160182
# Clone and build the BENCH_PDE repository
161183
green_echo "Cloning the BENCH_PDE repository..."

publication/source_code/bench_end_to_end/include/common/runtime/Import.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ void importTPCH(std::string dir, Database& db);
1212
void importSSB(std::string dir, Database& db);
1313

1414
/// imports alp benchmark from CSVs in dir into db
15-
double import_alp(alp_bench::Column& col, Database& db, encoding::scheme& encoding);
15+
double import_alp(alp_bench::ALPColumnDescriptor& col, Database& db, encoding::scheme& encoding);
1616
} // namespace runtime
1717

1818
namespace experiment {
19-
void remove_binary_file(alp_bench::Column& col);
20-
void expand_binary_x_times(alp_bench::Column& col, size_t x);
21-
bool is_expanded(alp_bench::Column& col);
22-
void clean_compressed_data(alp_bench::Column& col, encoding::scheme& scheme);
19+
void remove_binary_file(alp_bench::ALPColumnDescriptor& col);
20+
void expand_binary_x_times(alp_bench::ALPColumnDescriptor& col, size_t x);
21+
bool is_expanded(alp_bench::ALPColumnDescriptor& col);
22+
void clean_compressed_data(alp_bench::ALPColumnDescriptor& col, encoding::scheme& scheme);
2323
double sum(double* in, size_t c);
2424

2525
} // namespace experiment

publication/source_code/bench_end_to_end/src/benchmarks/alp/run_query.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ double alp_profile(std::function<void()> fn, uint64_t rep_c, uint64_t warmup_rep
209209
return end - start;
210210
}
211211

212-
alp_bench::Column& get_dataset(const std::string& col_name) {
213-
static std::unordered_map<std::string, alp_bench::Column> ALP_END_TO_END_DATASET = {
212+
alp_bench::ALPColumnDescriptor& get_dataset(const std::string& col_name) {
213+
static std::unordered_map<std::string, alp_bench::ALPColumnDescriptor> ALP_END_TO_END_DATASET = {
214214
{"food_prices", {0, "food_prices_tw", "", "", 16, 12, 46, 20}},
215215
{"city_temperature_f", {1, "city_temperature_f_tw", "", "", 14, 13, 0, 11}},
216216
{"bitcoin_transactions_f", {2, "bitcoin_transactions_f_tw", "", "", 14, 10, 10, 25}},
@@ -273,7 +273,7 @@ int main(int argc, char* argv[]) {
273273
throw std::runtime_error("Wrong Scheme Type.");
274274
}
275275

276-
alp_bench::Column& col = get_dataset(dataset_string);
276+
alp_bench::ALPColumnDescriptor& col = get_dataset(dataset_string);
277277

278278
runtime::cur_q_mtd.repetition = cfg::rep_c;
279279
runtime::cur_q_mtd.warm_up_repetition = cfg::warmup_rep_c;

publication/source_code/bench_end_to_end/src/common/runtime/Import.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ void importSSB(std::string dir, Database& db) {
10941094
// NO SUPPORT FOR SSB
10951095
}
10961096

1097-
double import_alp(alp_bench::Column& col, Database& db, encoding::scheme& scheme) {
1097+
double import_alp(alp_bench::ALPColumnDescriptor& col, Database& db, encoding::scheme& scheme) {
10981098
auto& rel = db[cfg::tbl_name];
10991099
rel.name = col.name;
11001100
auto columns = configX({{cfg::schema, col.name, make_unique<algebra::Double>(), scheme}});
@@ -1116,7 +1116,7 @@ double sum(double* in, size_t c) {
11161116
return result;
11171117
}
11181118

1119-
void expand_binary_x_times(alp_bench::Column& col, size_t x) {
1119+
void expand_binary_x_times(alp_bench::ALPColumnDescriptor& col, size_t x) {
11201120
/**/
11211121

11221122
std::string col_file_path = cfg::data_dir + col.name + ".bin";
@@ -1136,7 +1136,7 @@ void expand_binary_x_times(alp_bench::Column& col, size_t x) {
11361136
// std::cout << __FUNCTION__ << " : " << col_file_path << " has been extended " << x << " times." << std::endl;
11371137
}
11381138

1139-
bool is_expanded(alp_bench::Column& col) {
1139+
bool is_expanded(alp_bench::ALPColumnDescriptor& col) {
11401140
/**/
11411141
bool file_exist;
11421142
bool has_correct_size;
@@ -1165,13 +1165,13 @@ static void remove_file(std::string_view file_path) {
11651165
// std::cout << __FUNCTION__ << " : " << file_path << " has been removed successfully." << std::endl;
11661166
}
11671167

1168-
void remove_binary_file(alp_bench::Column& col) {
1168+
void remove_binary_file(alp_bench::ALPColumnDescriptor& col) {
11691169
/**/
11701170
std::string col_extended_file_path = cfg::data_ext_dir + col.name + +".bin";
11711171
remove_file(col_extended_file_path);
11721172
}
11731173

1174-
void clean_compressed_data(alp_bench::Column& col, encoding::scheme& scheme) {
1174+
void clean_compressed_data(alp_bench::ALPColumnDescriptor& col, encoding::scheme& scheme) {
11751175
/**/
11761176
std::vector<std::string> path_vec = ff::file::get_col_paths(col.name, scheme);
11771177
for (auto& file_path : path_vec) {

publication/source_code/bench_speed/bench_alp_cutter_decode.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
using namespace alp::config;
88

99
/* Bench ALP encode. */
10-
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run b_a_e(const double* dbl_arr,
11-
uint16_t* exc_arr,
12-
uint16_t* pos_arr,
13-
uint16_t* exc_c_arr,
14-
int64_t* encoded_arr,
15-
uint8_t& bw,
16-
int64_t* ffor_arr,
17-
int64_t* base_arr,
18-
alp::state<double>& stt,
19-
alp_bench::ALPColumnDescriptor& dataset,
20-
uint64_t* ffor_right_arr,
21-
uint16_t* ffor_left_arr,
22-
uint64_t* right_arr,
23-
uint16_t* left_arr,
24-
uint64_t* unffor_right_arr,
25-
uint16_t* unffor_left_arr,
26-
double* glue_arr) {
10+
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run b_a_e(const double* dbl_arr,
11+
uint16_t* exc_arr,
12+
uint16_t* pos_arr,
13+
uint16_t* exc_c_arr,
14+
int64_t* encoded_arr,
15+
uint8_t& bw,
16+
int64_t* ffor_arr,
17+
int64_t* base_arr,
18+
alp::state<double>& stt,
19+
alp_bench::ALPColumnDescriptor& dataset,
20+
uint64_t* ffor_right_arr,
21+
uint16_t* ffor_left_arr,
22+
uint64_t* right_arr,
23+
uint16_t* left_arr,
24+
uint64_t* unffor_right_arr,
25+
uint16_t* unffor_left_arr,
26+
double* glue_arr) {
2727

2828
int benchmark_number = dataset.id;
2929

publication/source_code/bench_speed/bench_chimp128.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run
66
bench_decode_chimp128(const double* dbl_arr,
7-
alp_bench::ALPColumnDescriptor& dataset,
7+
alp_bench::ALPColumnDescriptor& dataset,
88
uint8_t leading_zero_block_count,
99
alp_bench::Chimp128CompressionState<uint64_t, false> com_stt,
1010
idx_t leading_zero_block_size,
@@ -93,7 +93,7 @@ bench_decode_chimp128(const double* dbl_a
9393
}
9494

9595
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run
96-
bench_encode_chimp128(alp_bench::ALPColumnDescriptor& dataset,
96+
bench_encode_chimp128(alp_bench::ALPColumnDescriptor& dataset,
9797
alp_bench::Chimp128CompressionState<uint64_t, false> com_stt,
9898
uint8_t leading_zero_block_count,
9999
idx_t leading_zero_block_size,

publication/source_code/bench_speed/bench_patas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "patas/patas.hpp"
44

55
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run
6-
bench_decoding_patas(alp_bench::ALPColumnDescriptor& dataset,
6+
bench_decoding_patas(alp_bench::ALPColumnDescriptor& dataset,
77
uint16_t* packed_metadata,
88
uint8_t* data_arr,
99
uint64_t* dec_arr,
@@ -46,7 +46,7 @@ bench_decoding_patas(alp_bench::ALPColumnDescriptor& dat
4646
}
4747

4848
static __attribute__((noinline)) benchmark::BenchmarkReporter::Run
49-
bench_encoding_patas(alp_bench::ALPColumnDescriptor& dataset,
49+
bench_encoding_patas(alp_bench::ALPColumnDescriptor& dataset,
5050
alp_bench::patas::PatasCompressionState<uint64_t, false> patas_state,
5151
uint8_t* data_arr,
5252
uint16_t* packed_metadata,

0 commit comments

Comments
 (0)