Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cmake/aws-sdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ExternalProject_Add(
libawscpp-download
PREFIX "vendor/libawscpp-download"
GIT_REPOSITORY "https://github.com/aws/aws-sdk-cpp.git"
GIT_TAG "1.9.370"
GIT_TAG "1.11.414"
TIMEOUT 10
LIST_SEPARATOR "|"
CMAKE_ARGS
Expand Down
25 changes: 15 additions & 10 deletions cmake/tbb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ find_package(Git REQUIRED)
# Get rapidjson
ExternalProject_Add(
tbb_src
PREFIX "vendor/intel/tbb"
GIT_REPOSITORY "https://github.com/wjakob/tbb.git"
GIT_TAG b066defc0229a1e92d7a200eb3fe0f7e35945d95
PREFIX "vendor/intel"
GIT_REPOSITORY "https://github.com/oneapi-src/oneTBB.git"
GIT_TAG 2a7e0dbe46855b75497355ed3808c31af14a35b6
TIMEOUT 10
BUILD_COMMAND make
UPDATE_COMMAND "" # to prevent rebuilding everytime
INSTALL_COMMAND ""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/vendor/tbb_cpp
-DTBB_TEST=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/vendor/intel
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
)

# Prepare json
ExternalProject_Get_Property(tbb_src source_dir)
ExternalProject_Get_Property(tbb_src binary_dir)
# Prepare tbb
# ExternalProject_Get_Property(tbb_src source_dir)
# ExternalProject_Get_Property(tbb_src binary_dir)
ExternalProject_Get_Property(tbb_src install_dir)

set(TBB_INCLUDE_DIR ${source_dir}/include)
set(TBB_LIBRARY_PATH ${binary_dir}/libtbb.so)
set(TBB_INCLUDE_DIR ${install_dir}/include)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(TBB_LIBRARY_PATH ${install_dir}/lib/libtbb_debug.so)
else()
set(TBB_LIBRARY_PATH ${install_dir}/lib/libtbb.so)
endif()

file(MAKE_DIRECTORY ${TBB_INCLUDE_DIR})

Expand Down
12 changes: 6 additions & 6 deletions tools/conversion/btrtocsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "gflags/gflags.h"
#include "yaml-cpp/yaml.h"
#include "spdlog/spdlog.h"
#include "tbb/parallel_for.h"
#include "tbb/task_scheduler_init.h"
#include "oneapi/tbb/global_control.h"
#include "oneapi/tbb/parallel_for.h"
// ------------------------------------------------------------------------------
// Btrfiles library
#include "btrfiles.hpp"
Expand Down Expand Up @@ -105,9 +105,9 @@ int main(int argc, char **argv)
// This seems necessary to be
SchemePool::refresh();

// Init TBB TODO: is that actually still necessary ?
tbb::task_scheduler_init init(FLAGS_threads); // NOLINT(cppcoreguidelines-narrowing-conversions)

// Init TBB
oneapi::tbb::global_control global_limit(
oneapi::tbb::global_control::max_allowed_parallelism, FLAGS_threads);
// Open output file
auto csvstream = std::ofstream(FLAGS_csv);
csvstream << std::setprecision(32);
Expand All @@ -124,7 +124,7 @@ int main(int argc, char **argv)
// Prepare the readers
std::vector<std::vector<BtrReader>> readers(file_metadata->num_columns);
std::vector<std::vector<std::vector<char>>> compressed_data(file_metadata->num_columns);
tbb::parallel_for(u32(0), file_metadata->num_columns, [&](u32 column_i) {
oneapi::tbb::parallel_for(u32(0), file_metadata->num_columns, [&](u32 column_i) {
compressed_data[column_i].resize(file_metadata->parts[column_i].num_parts);
for (u32 part_i = 0; part_i < file_metadata->parts[column_i].num_parts; part_i++) {
auto path = btr_dir / ("column" + std::to_string(column_i) + "_part" + std::to_string(part_i));
Expand Down
9 changes: 5 additions & 4 deletions tools/conversion/csvtobtr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <gflags/gflags.h>
#include <yaml-cpp/yaml.h>
#include <spdlog/spdlog.h>
#include <tbb/parallel_for.h>
#include <tbb/task_scheduler_init.h>
#include <oneapi/tbb/global_control.h>
#include <oneapi/tbb/parallel_for.h>
// ------------------------------------------------------------------------------
// Btr internal includes
#include "common/Utils.hpp"
Expand Down Expand Up @@ -72,8 +72,9 @@ int main(int argc, char **argv)
// This seems necessary to be
SchemePool::refresh();

// Init TBB TODO: is that actually still necessary ?
tbb::task_scheduler_init init(FLAGS_threads);
// Init TBB
oneapi::tbb::global_control global_limit(
oneapi::tbb::global_control::max_allowed_parallelism, FLAGS_threads);

// Load schema
const auto schema = YAML::LoadFile(FLAGS_yaml);
Expand Down
9 changes: 5 additions & 4 deletions tools/conversion/decompression-speed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include <filesystem>
#include <fstream>
#include <random>
#include <tbb/parallel_for_each.h>
// -------------------------------------------------------------------------------------
#include "gflags/gflags.h"
#include "tbb/parallel_for.h"
#include "tbb/task_scheduler_init.h"
#include "oneapi/tbb/global_control.h"
#include "oneapi/tbb/parallel_for.h"
#include <oneapi/tbb/parallel_for_each.h>
// -------------------------------------------------------------------------------------
#include "common/PerfEvent.hpp"
#include "common/Utils.hpp"
Expand Down Expand Up @@ -108,7 +108,8 @@ int main(int argc, char **argv) {
} else {
threads = FLAGS_threads;
}
tbb::task_scheduler_init init(threads);
oneapi::tbb::global_control global_limit(
oneapi::tbb::global_control::max_allowed_parallelism, FLAGS_threads);

// Read the metadata
std::vector<char> raw_file_metadata;
Expand Down
6 changes: 3 additions & 3 deletions tools/playground/generate_s3_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <sstream>
#include <vector>
// -------------------------------------------------------------------------------------
#include <tbb/parallel_for.h>
#include <tbb/task_scheduler_init.h>
#include <oneapi/tbb/global_control.h>
#include <oneapi/tbb/parallel_for.h>
// -------------------------------------------------------------------------------------
#include <aws/core/Aws.h>
#include <aws/s3-crt/S3CrtClient.h>
Expand Down Expand Up @@ -101,7 +101,7 @@ static void generate_and_upload_multipart(const Aws::S3Crt::S3CrtClient& s3_clie
/* Upload parts */
size_t num_parts = (object_size + part_size - 1) / part_size;
std::vector<Aws::S3Crt::Model::CompletedPart> completed_parts(num_parts);
tbb::parallel_for(size_t(1), num_parts + 1, [&](size_t part_number) {
oneapi::tbb::parallel_for(size_t(1), num_parts + 1, [&](size_t part_number) {
auto sstream = std::make_shared<std::stringstream>();
generate_data(sstream, std::min(part_size, static_cast<std::size_t>(object_size)));
auto [success, etag] = upload_part(s3_client, bucket, key, upload_id, part_number, sstream);
Expand Down
4 changes: 4 additions & 0 deletions tools/playground/playground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include <ctime> /* time */
#include <fsst.h>
#include <gflags/gflags.h>
#include <headers/compositecodec.h>
#include <headers/simdfastpfor.h>
#include <headers/variablebyte.h>
#include <headers/blockpacking.h>
// -------------------------------------------------------------------------------------
#include "headers/codecfactory.h"
#include "headers/deltautil.h"
Expand Down
3 changes: 2 additions & 1 deletion tools/playground/rle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ int main() {
std::srand(std::time(nullptr));
// -------------------------------------------------------------------------------------
using namespace FastPForLib;
IntegerCODEC &codec = *CODECFactory::getFromName("simdfastpfor256");
CODECFactory factory;
IntegerCODEC &codec = *factory.getFromName("simdfastpfor256");
size_t N = 1000 * 1000;
std::vector<uint32_t> rle_input(N);
for ( uint32_t i = 0; i < N; i++ ) {
Expand Down