diff --git a/CMakeLists.txt b/CMakeLists.txt index 63ccf8f..ec3611f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -march=native") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(THREADS_PREFER_PTHREAD_FLAG ON) - -find_package(Threads REQUIRED) add_executable(sword src/chain.cpp @@ -35,6 +32,6 @@ if (NOT TARGET thread_pool) add_subdirectory(vendor/thread_pool EXCLUDE_FROM_ALL) endif() -target_link_libraries(sword thread_pool Threads::Threads) +target_link_libraries(sword thread_pool) install(TARGETS sword DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/database_alignment.cpp b/src/database_alignment.cpp index a01b301..4ab9d24 100644 --- a/src/database_alignment.cpp +++ b/src/database_alignment.cpp @@ -232,7 +232,7 @@ void alignDatabase(std::vector& dst, AlignmentType algorithm_, std::vector> thread_futures; for (uint32_t i = 0; i < queries.size(); ++i) { - thread_futures.emplace_back(thread_pool->submit_task(scoreChains, + thread_futures.emplace_back(thread_pool->submit(scoreChains, std::ref(dst[i]), std::ref(queries[i]), std::ref(indexes[i]), std::ref(database), database_start, algorithm, max_evalue, evalue_params, max_alignments, scorer)); @@ -269,7 +269,7 @@ void alignDatabase(std::vector& dst, AlignmentType algorithm_, std::vector> thread_futures; for (uint32_t i = 0; i < queries.size(); ++i) { - thread_futures.emplace_back(thread_pool->submit_task(alignChains, + thread_futures.emplace_back(thread_pool->submit(alignChains, std::ref(dst[i]), std::ref(queries[i]), std::ref(database), algorithm, scorer)); } diff --git a/src/database_search.cpp b/src/database_search.cpp index 18fa2f4..88ffda6 100644 --- a/src/database_search.cpp +++ b/src/database_search.cpp @@ -312,7 +312,7 @@ uint64_t searchDatabase(Indexes& dst, const std::string& database_path, std::vector> thread_futures; for (uint32_t i = 0; i < tasks.size() - 1; ++i) { - thread_futures.emplace_back(thread_pool->submit_task(scoreChains, + thread_futures.emplace_back(thread_pool->submit(scoreChains, std::ref(entries), std::ref(entry_mutexes), max_candidates, std::ref(queries), std::ref(database_part), tasks[i], tasks[i + 1], kmers)); diff --git a/src/main.cpp b/src/main.cpp index 2c3cb5d..e070319 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,7 +13,7 @@ #include "database_alignment.hpp" #include "utils.hpp" -static const char* version = "v1.0.2"; +static const char* version = "v1.0.3"; static struct option options[] = { {"query", required_argument, 0, 'i'}, diff --git a/vendor/thread_pool b/vendor/thread_pool index 8e52fdf..048da94 160000 --- a/vendor/thread_pool +++ b/vendor/thread_pool @@ -1 +1 @@ -Subproject commit 8e52fdffcae285d23fae89ff52eb6f1e4bd04c20 +Subproject commit 048da9485390ee8b8a7ecedccc598a06ca4429e2