diff --git a/.gitmodules b/.gitmodules index 2f7456e04..b05a61024 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,9 +18,6 @@ [submodule "3rdparty/googletest"] path = 3rdparty/googletest url = https://github.com/google/googletest.git -[submodule "3rdparty/spdlog"] - path = 3rdparty/spdlog - url = https://github.com/gabime/spdlog.git [submodule "3rdparty/benchmark"] path = 3rdparty/benchmark url = https://github.com/google/benchmark.git diff --git a/3rdparty/spdlog b/3rdparty/spdlog deleted file mode 160000 index 366935142..000000000 --- a/3rdparty/spdlog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 366935142780e3754b358542f0fd5ed83793b263 diff --git a/cmake/3rdparty.cmake b/cmake/3rdparty.cmake index f26ce2af5..99a42e0ef 100644 --- a/cmake/3rdparty.cmake +++ b/cmake/3rdparty.cmake @@ -29,12 +29,6 @@ if (enable_benchmarks AND NOT TARGET benchmark) add_subdirectory(3rdparty/benchmark EXCLUDE_FROM_ALL) endif() -if (NOT TARGET spdlog) -# FORCE spdlog to put out an install target, which we need - set(SPDLOG_INSTALL ON CACHE BOOL "Generate the install target." FORCE) - add_subdirectory(3rdparty/spdlog EXCLUDE_FROM_ALL) -endif() - if (NOT TARGET spoa) add_subdirectory(3rdparty/spoa EXCLUDE_FROM_ALL) # Don't show warnings when compiling the 3rd party library diff --git a/common/base/CMakeLists.txt b/common/base/CMakeLists.txt index f0e6ac51c..677a0d144 100644 --- a/common/base/CMakeLists.txt +++ b/common/base/CMakeLists.txt @@ -18,8 +18,6 @@ set(MODULE_NAME gwbase) -find_package(CUDA 9.0 QUIET REQUIRED) - set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14") message(STATUS "nvcc flags for ${MODULE_NAME}: ${CUDA_NVCC_FLAGS}") @@ -29,7 +27,7 @@ add_library(${MODULE_NAME} ${gw_library_type} src/logging.cpp src/graph.cpp ) -target_link_libraries(${MODULE_NAME} PUBLIC spdlog ${CUDA_LIBRARIES}) +target_link_libraries(${MODULE_NAME} PUBLIC ${CUDA_LIBRARIES}) if (gw_profiling) find_library(NVTX_LIBRARY nvToolsExt HINTS ${CUDA_TOOLKIT_ROOT_DIR}/lib64) diff --git a/common/base/include/claraparabricks/genomeworks/logging/logging.hpp b/common/base/include/claraparabricks/genomeworks/logging/logging.hpp index b0e1f12d3..1015bfa07 100644 --- a/common/base/include/claraparabricks/genomeworks/logging/logging.hpp +++ b/common/base/include/claraparabricks/genomeworks/logging/logging.hpp @@ -42,63 +42,9 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. -#include - /// \ingroup logging /// \{ -/// \brief DEBUG log level -#define gw_log_level_debug 0 -/// \brief INFO log level -#define gw_log_level_info 1 -/// \brief WARN log level -#define gw_log_level_warn 2 -/// \brief ERROR log level -#define gw_log_level_error 3 -/// \brief CRITICAL log level -#define gw_log_level_critical 4 -/// \brief No logging -#define gw_log_level_off 5 - -#ifndef GW_LOG_LEVEL -#ifndef NDEBUG -/// \brief Defines the logging level used in the current module -#define GW_LOG_LEVEL gw_log_level_debug -#else // NDEBUG -/// \brief Defines the logging level used in the current module -#define GW_LOG_LEVEL gw_log_level_error -#endif // NDEBUG -#endif // GW_LOG_LEVEL - -#if GW_LOG_LEVEL == gw_log_level_info -/// \brief Set log level to INFO -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO -#elif GW_LOG_LEVEL == gw_log_level_debug -/// \brief Set log level to DEBUG -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG -#elif GW_LOG_LEVEL == gw_log_level_warn -/// \brief Set log level to WARN -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_WARN -#elif GW_LOG_LEVEL == gw_log_level_error -/// \brief Set log level to ERROR -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_ERROR -#elif GW_LOG_LEVEL == gw_log_level_critical -/// \brief Set log level to CRITICAL -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_CRITICAL -#else -/// \brief Set log level to OFF -#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_OFF -#endif - -// MUST come after the defines of the logging level! -#if __GNUC__ >= 9 -// Due to a ISO C++ standard incompatibility the spdlog fails to pass -// pedantic requirements. -#pragma message("Logging disabled for GCC >= 9") -#else -#include -#endif - namespace claraparabricks { @@ -107,88 +53,56 @@ namespace genomeworks namespace logging { -/// \ingroup logging -/// Logging status type -enum class LoggingStatus + +/// GenomeWorks Logging levels. +enum LogLevel { - success = 0, ///< Success - cannot_open_file, ///< Initialization could not open the output file requested - cannot_open_stdout ///< Stdout could not be opened for logging + critical = 0, + error, + warn, + info, + debug }; -/// \ingroup logging -/// Init Initialize the logging -/// \param filename if specified, the path/name of the file into which logging should be placed. -/// The default is stdout -/// \return success or error status -LoggingStatus Init(const char* filename = nullptr); +/// Initialize logger across GenomeWorks. +/// \param [in] level LogLevel for logger. +/// \param [in] filename File to redirect log messages to. +void initialize_logger(LogLevel level, const char* filename = nullptr); + +/// Log messages to logger. +/// \param [in] level LogLevel for message. +/// \param [in] file Filename for originating message. +/// \param [in] line Line number for originating message. +/// \param [in] msg Content of log message. +void log(LogLevel level, const char* file, int line, const char* msg); +} // namespace logging -/// \ingroup logging -/// SetHeader Adjust the header/preface for each log message -/// \param logTime if true, the detailed time will be prepended to each message. -/// \param logLocation if true, the file and line location logging will be prepended to each message. -/// \return success or error status -LoggingStatus SetHeader(bool logTime, bool logLocation); +} // namespace genomeworks + +} // namespace claraparabricks /// \ingroup logging /// \def GW_LOG_DEBUG /// \brief Log at debug level -/// -/// parameters as per https://github.com/gabime/spdlog/blob/v1.x/README.md -#if __GNUC__ >= 9 -#define GW_LOG_DEBUG(...) -#else -#define GW_LOG_DEBUG(...) SPDLOG_DEBUG(__VA_ARGS__) -#endif +#define GW_LOG_DEBUG(msg) claraparabricks::genomeworks::logging::log(claraparabricks::genomeworks::logging::LogLevel::debug, __FILE__, __LINE__, msg) /// \ingroup logging /// \def GW_LOG_INFO /// \brief Log at info level -/// -/// parameters as per https://github.com/gabime/spdlog/blob/v1.x/README.md -#if __GNUC__ >= 9 -#define GW_LOG_INFO(...) -#else -#define GW_LOG_INFO(...) SPDLOG_INFO(__VA_ARGS__) -#endif +#define GW_LOG_INFO(msg) claraparabricks::genomeworks::logging::log(claraparabricks::genomeworks::logging::LogLevel::info, __FILE__, __LINE__, msg) /// \ingroup logging /// \def GW_LOG_WARN /// \brief Log at warning level -/// -/// parameters as per https://github.com/gabime/spdlog/blob/v1.x/README.md -#if __GNUC__ >= 9 -#define GW_LOG_WARN(...) -#else -#define GW_LOG_WARN(...) SPDLOG_WARN(__VA_ARGS__) -#endif +#define GW_LOG_WARN(msg) claraparabricks::genomeworks::logging::log(claraparabricks::genomeworks::logging::LogLevel::warn, __FILE__, __LINE__, msg) /// \ingroup logging /// \def GW_LOG_ERROR /// \brief Log at error level -/// -/// parameters as per https://github.com/gabime/spdlog/blob/v1.x/README.md -#if __GNUC__ >= 9 -#define GW_LOG_ERROR(...) -#else -#define GW_LOG_ERROR(...) SPDLOG_ERROR(__VA_ARGS__) -#endif +#define GW_LOG_ERROR(msg) claraparabricks::genomeworks::logging::log(claraparabricks::genomeworks::logging::LogLevel::error, __FILE__, __LINE__, msg) /// \ingroup logging /// \def GW_LOG_CRITICAL -/// \brief Log at fatal/critical error level (does NOT exit) -/// -/// parameters as per https://github.com/gabime/spdlog/blob/v1.x/README.md -#if __GNUC__ >= 9 -#define GW_LOG_CRITICAL(...) -#else -#define GW_LOG_CRITICAL(...) SPDLOG_CRITICAL(__VA_ARGS__) -#endif - -} // namespace logging - -} // namespace genomeworks - -} // namespace claraparabricks - +/// \brief Log at fatal/critical error level +#define GW_LOG_CRITICAL(msg) claraparabricks::genomeworks::logging::log(claraparabricks::genomeworks::logging::LogLevel::critical, __FILE__, __LINE__, msg) /// \} diff --git a/common/base/include/claraparabricks/genomeworks/utils/allocator.hpp b/common/base/include/claraparabricks/genomeworks/utils/allocator.hpp index a448f9022..62dde51a9 100644 --- a/common/base/include/claraparabricks/genomeworks/utils/allocator.hpp +++ b/common/base/include/claraparabricks/genomeworks/utils/allocator.hpp @@ -266,7 +266,7 @@ class CachingDeviceAllocator { if (!memory_resource_) { - GW_LOG_ERROR("{}\n", "ERROR:: Trying to allocate memory from an default-constructed CachingDeviceAllocator. Please assign a non-default-constructed CachingDeviceAllocator before performing any memory operations."); + GW_LOG_ERROR("Trying to allocate memory from an default-constructed CachingDeviceAllocator. Please assign a non-default-constructed CachingDeviceAllocator before performing any memory operations."); assert(false); std::abort(); } @@ -291,7 +291,7 @@ class CachingDeviceAllocator static_cast(n); if (!memory_resource_) { - GW_LOG_ERROR("{}\n", "ERROR:: Trying to deallocate memory from an default-constructed CachingDeviceAllocator. Please assign a non-default-constructed CachingDeviceAllocator before performing any memory operations."); + GW_LOG_ERROR("Trying to deallocate memory from an default-constructed CachingDeviceAllocator. Please assign a non-default-constructed CachingDeviceAllocator before performing any memory operations."); assert(false); std::abort(); } diff --git a/common/base/include/claraparabricks/genomeworks/utils/cudautils.hpp b/common/base/include/claraparabricks/genomeworks/utils/cudautils.hpp index 9da319a98..e826bcb0d 100644 --- a/common/base/include/claraparabricks/genomeworks/utils/cudautils.hpp +++ b/common/base/include/claraparabricks/genomeworks/utils/cudautils.hpp @@ -87,7 +87,7 @@ inline void gpu_assert(cudaError_t code, const char* file, int line) std::string(cudaGetErrorString(code)) + " " + std::string(file) + " " + std::to_string(line); - GW_LOG_ERROR("{}\n", err); + GW_LOG_ERROR(err.c_str()); // In Debug mode, this assert will cause a debugger trap // which is beneficial when debugging errors. assert(false); diff --git a/common/base/src/logging.cpp b/common/base/src/logging.cpp index 5bedecdfe..edc172566 100644 --- a/common/base/src/logging.cpp +++ b/common/base/src/logging.cpp @@ -16,8 +16,10 @@ #include -#include -#include +#include +#include +#include +#include namespace claraparabricks { @@ -27,66 +29,70 @@ namespace genomeworks namespace logging { -static std::shared_ptr logger = nullptr; +static std::unique_ptr out_stream_ = nullptr; -LoggingStatus Init(const char* filename) +static LogLevel level_ = LogLevel::error; + +void check_logger() { - // for now, first call wins: - if (logger != nullptr) - return LoggingStatus::success; + if (out_stream_ == nullptr) + { + std::cerr << "GenomeWorks logger not initialized yet. Initializing default logger now." << std::endl; + initialize_logger(LogLevel::error); + } +} - if (filename != nullptr) +std::string log_level_str(LogLevel level) +{ + std::string prefix; + switch (level) { - try + case critical: prefix = "CRITICAL"; break; + case error: prefix = "ERROR"; break; + case warn: prefix = "WARN"; break; + case info: prefix = "INFO"; break; + case debug: prefix = "DEBUG"; break; + default: + assert(false); // Unknown log level + prefix = "INFO"; + break; + } + return prefix; +} + +void initialize_logger(LogLevel level, const char* filename) +{ + if (out_stream_ == nullptr) + { + level_ = level; + if (filename != nullptr) + { + out_stream_ = std::make_unique(filename); + } + else { - logger = spdlog::basic_logger_mt("GWLogger", filename); + out_stream_ = std::make_unique(std::cerr.rdbuf()); } - catch (const spdlog::spdlog_ex& ex) + if (!out_stream_->good()) { - return LoggingStatus::cannot_open_file; + throw std::runtime_error("Could not initialize logger. Please check call to initialize_logger."); } + *out_stream_ << "Initialized GenomeWorks logger with log level " << log_level_str(level_) << std::endl; } else { - try - { - logger = spdlog::stderr_logger_mt("GWLogger"); - } - catch (const spdlog::spdlog_ex& ex) - { - return LoggingStatus::cannot_open_stdout; - } + *out_stream_ << "Logger already initialized with log level " << log_level_str(level_) << std::endl; } - - spdlog::set_default_logger(logger); - -#ifdef _DEBUG - SetHeader(true, true); -#else - SetHeader(false, false); -#endif - - spdlog::flush_every(std::chrono::seconds(1)); - - return LoggingStatus::success; } - -LoggingStatus SetHeader(bool logTime, bool logLocation) +void log(LogLevel level, const char* file, int32_t line, const char* msg) { - std::string pattern = ""; - - if (logTime) - pattern = pattern + "[%H:%M:%S %z]"; - - if (logLocation) - pattern = pattern + "[%@]"; - - pattern = pattern + "%v"; - - spdlog::set_pattern(pattern); - - return LoggingStatus::success; + check_logger(); + if (level <= level_) + { + *out_stream_ << "[" << log_level_str(level) << " " << file << ":" << line << "] " << msg << std::endl; + } } + } // namespace logging } // namespace genomeworks diff --git a/cudaaligner/src/aligner_global.cpp b/cudaaligner/src/aligner_global.cpp index 7b8c45931..59892929a 100644 --- a/cudaaligner/src/aligner_global.cpp +++ b/cudaaligner/src/aligner_global.cpp @@ -79,7 +79,7 @@ StatusType AlignerGlobal::add_alignment(const char* query, int32_t query_length, { if (query_length < 0 || target_length < 0) { - GW_LOG_DEBUG("{} {}", "Negative target or query length is not allowed."); + GW_LOG_DEBUG("Negative target or query length is not allowed."); return StatusType::generic_error; } @@ -87,19 +87,22 @@ StatusType AlignerGlobal::add_alignment(const char* query, int32_t query_length, int32_t const num_alignments = get_size(alignments_); if (num_alignments >= max_alignments_) { - GW_LOG_DEBUG("{} {}", "Exceeded maximum number of alignments allowed : ", max_alignments_); + std::string msg = "Exceeded maximum number of alignments allowed : " + std::to_string(max_alignments_); + GW_LOG_DEBUG(msg.c_str()); return StatusType::exceeded_max_alignments; } if (query_length > max_query_length_) { - GW_LOG_DEBUG("{} {}", "Exceeded maximum length of query allowed : ", max_query_length_); + std::string msg = "Exceeded maximum length of query allowed : " + std::to_string(max_query_length_); + GW_LOG_DEBUG(msg.c_str()); return StatusType::exceeded_max_length; } if (target_length > max_target_length_) { - GW_LOG_DEBUG("{} {}", "Exceeded maximum length of target allowed : ", max_target_length_); + std::string msg = "Exceeded maximum length of target allowed : " + std::to_string(max_target_length_); + GW_LOG_DEBUG(msg.c_str()); return StatusType::exceeded_max_length; } diff --git a/cudaaligner/src/aligner_global_ukkonen.cpp b/cudaaligner/src/aligner_global_ukkonen.cpp index d9d90299f..67df1bd4d 100644 --- a/cudaaligner/src/aligner_global_ukkonen.cpp +++ b/cudaaligner/src/aligner_global_ukkonen.cpp @@ -53,7 +53,8 @@ StatusType AlignerGlobalUkkonen::add_alignment(const char* query, int32_t query_ int32_t const allocated_max_length_difference = this->get_max_target_length() * max_target_query_length_difference; if (std::abs(query_length - target_length) > allocated_max_length_difference) { - GW_LOG_DEBUG("{} {}", "Exceeded maximum length difference b/w target and query allowed : ", allocated_max_length_difference); + std::string msg = "Exceeded maximum length difference b/w target and query allowed : " + std::to_string(allocated_max_length_difference); + GW_LOG_DEBUG(msg.c_str()); return StatusType::exceeded_max_alignment_difference; } diff --git a/cudaaligner/src/cudaaligner.cpp b/cudaaligner/src/cudaaligner.cpp index 261d68f05..4cd1bf212 100644 --- a/cudaaligner/src/cudaaligner.cpp +++ b/cudaaligner/src/cudaaligner.cpp @@ -28,9 +28,7 @@ namespace cudaaligner StatusType Init() { - if (logging::LoggingStatus::success != logging::Init()) - return StatusType::generic_error; - + initialize_logger(claraparabricks::genomeworks::logging::LogLevel::warn); return StatusType::success; } } // namespace cudaaligner diff --git a/cudaextender/src/cudaextender.cpp b/cudaextender/src/cudaextender.cpp index c345a4007..ec4d8e29b 100644 --- a/cudaextender/src/cudaextender.cpp +++ b/cudaextender/src/cudaextender.cpp @@ -27,9 +27,7 @@ namespace cudaextender StatusType Init() { - if (logging::LoggingStatus::success != logging::Init()) - return StatusType::generic_error; - + initialize_logger(claraparabricks::genomeworks::logging::LogLevel::warn); return StatusType::success; } } // namespace cudaextender diff --git a/cudamapper/CMakeLists.txt b/cudamapper/CMakeLists.txt index 22868ecd3..1ec17f891 100644 --- a/cudamapper/CMakeLists.txt +++ b/cudamapper/CMakeLists.txt @@ -26,8 +26,6 @@ GitVersion() configure_file(${PROJECT_SOURCE_DIR}/common/base/src/version.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/version.cpp) -find_package(CUDA 9.0 QUIET REQUIRED) - if(NOT ${CUDA_FOUND}) message(FATAL_ERROR "CUDA not detected on system. Please install") else() diff --git a/cudamapper/src/cudamapper.cpp b/cudamapper/src/cudamapper.cpp index fd499865f..39472af3b 100644 --- a/cudamapper/src/cudamapper.cpp +++ b/cudamapper/src/cudamapper.cpp @@ -31,9 +31,7 @@ namespace cudamapper StatusType Init() { - if (logging::LoggingStatus::success != logging::Init()) - return StatusType::generic_error; - + initialize_logger(claraparabricks::genomeworks::logging::LogLevel::warn); return StatusType::success; } diff --git a/cudamapper/src/index_gpu.cuh b/cudamapper/src/index_gpu.cuh index 37e2ac487..6e17a1927 100644 --- a/cudamapper/src/index_gpu.cuh +++ b/cudamapper/src/index_gpu.cuh @@ -838,19 +838,19 @@ void IndexGPU::generate_index(const io::FastaParser& parser, else { // TODO: Implement this skipping in a correct manner - GW_LOG_INFO("Skipping read {}. It has {} basepairs, one window covers {} basepairs", - sequence.name, - read_basepairs.length(), - window_size_ + kmer_size_ - 1); + std::string msg = "Skipping read " + sequence.name + ". It has " + + std::to_string(read_basepairs.length()) + " basepairs, one window covers " + + std::to_string(window_size_ + kmer_size_ - 1) + " basepairs"; + GW_LOG_INFO(msg.c_str()); } } } if (0 == total_basepairs) { - GW_LOG_INFO("Index for reads {} to past {} is empty", - first_read_id, - past_the_last_read_id); + std::string msg = "Index for reads " + std::to_string(first_read_id) + + " to past " + std::to_string(past_the_last_read_id) + " is empty"; + GW_LOG_INFO(msg.c_str()); number_of_reads_ = 0; number_of_basepairs_in_longest_read_ = 0; return; diff --git a/cudamapper/src/main.cu b/cudamapper/src/main.cu index f01449ac4..40da6ac4a 100644 --- a/cudamapper/src/main.cu +++ b/cudamapper/src/main.cu @@ -535,7 +535,7 @@ void worker_thread_function(const int32_t device_id, int main(int argc, char* argv[]) { - logging::Init(); + logging::initialize_logger(logging::LogLevel::error); const ApplicationParameters parameters(argc, argv); diff --git a/cudamapper/src/minimizer.cu b/cudamapper/src/minimizer.cu index 2badfc62e..6ee7286be 100644 --- a/cudamapper/src/minimizer.cu +++ b/cudamapper/src/minimizer.cu @@ -936,7 +936,8 @@ Minimizer::GeneratedSketchElements Minimizer::generate_sketch_elements(DefaultDe shared_memory_for_kernel *= 8; // before it the number of 8-byte values, now get the number of bytes - GW_LOG_INFO("Launching find_front_end_minimizers with {} bytes of shared memory", shared_memory_for_kernel); + std::string msg = "Launching find_front_end_minimizers with " + std::to_string(shared_memory_for_kernel) + " bytes of shared memory"; + GW_LOG_INFO(msg.c_str()); find_front_end_minimizers<<>>(minimizer_size, window_size, merged_basepairs_d.data(), @@ -968,7 +969,8 @@ Minimizer::GeneratedSketchElements Minimizer::generate_sketch_elements(DefaultDe shared_memory_for_kernel *= 8; // before it the number of 8-byte values, now get the number of bytes - GW_LOG_INFO("Launching find_central_minimizers with {} bytes of shared memory", shared_memory_for_kernel); + msg = "Launching find_central_minimizers with " + std::to_string(shared_memory_for_kernel) + " bytes of shared memory"; + GW_LOG_INFO(msg.c_str()); find_central_minimizers<<>>(minimizer_size, window_size, basepairs_per_thread, @@ -995,7 +997,8 @@ Minimizer::GeneratedSketchElements Minimizer::generate_sketch_elements(DefaultDe shared_memory_for_kernel *= 8; // before it the number of 8-byte values, now get the number of bytes - GW_LOG_INFO("Launching find_back_end_minimizers with {} bytes of shared memory", shared_memory_for_kernel); + msg = "Launching find_back_end_minimizers with " + std::to_string(shared_memory_for_kernel) + " bytes of shared memory"; + GW_LOG_INFO(msg.c_str()); find_back_end_minimizers<<>>(minimizer_size, window_size, merged_basepairs_d.data(), @@ -1026,7 +1029,8 @@ Minimizer::GeneratedSketchElements Minimizer::generate_sketch_elements(DefaultDe // rest = position_in_read, direction and read_id device_buffer rest_compressed_d(total_minimizers, allocator, cuda_stream); - GW_LOG_INFO("Launching compress_minimizers with {} bytes of shared memory", 0); + msg = "Launching compress_minimizers with " + std::to_string(0) + " bytes of shared memory"; + GW_LOG_INFO(msg.c_str()); compress_minimizers<<>>(window_minimizers_representation_d.data(), window_minimizers_position_in_read_d.data(), window_minimizers_direction_d.data(), diff --git a/cudapoa/src/allocate_block.hpp b/cudapoa/src/allocate_block.hpp index 2b5771021..b2290074f 100644 --- a/cudapoa/src/allocate_block.hpp +++ b/cudapoa/src/allocate_block.hpp @@ -32,16 +32,6 @@ #include #include -#ifndef GW_LOG_LEVEL -#ifndef NDEBUG -/// \brief Defines the logging level used in the current module -#define GW_LOG_LEVEL gw_log_level_debug -#else // NDEBUG -/// \brief Defines the logging level used in the current module -#define GW_LOG_LEVEL gw_log_level_error -#endif // NDEBUG -#endif // GW_LOG_LEVEL - namespace claraparabricks { diff --git a/cudapoa/src/cudapoa.cpp b/cudapoa/src/cudapoa.cpp index fbeefb042..72c678c2a 100644 --- a/cudapoa/src/cudapoa.cpp +++ b/cudapoa/src/cudapoa.cpp @@ -30,9 +30,7 @@ namespace cudapoa StatusType Init() { - if (logging::LoggingStatus::success != logging::Init()) - return StatusType::generic_error; - + initialize_logger(claraparabricks::genomeworks::logging::LogLevel::warn); return StatusType::success; } diff --git a/cudapoa/src/cudapoa_batch.cuh b/cudapoa/src/cudapoa_batch.cuh index 8d2794590..9f90b43d2 100644 --- a/cudapoa/src/cudapoa_batch.cuh +++ b/cudapoa/src/cudapoa_batch.cuh @@ -32,10 +32,6 @@ #include #include -#ifndef TABS -#define TABS printTabs(bid_) -#endif - inline std::string printTabs(int32_t tab_count) { std::string s; @@ -416,8 +412,8 @@ protected: // Print debug message with batch specific formatting. void print_batch_debug_message(const std::string& message) { - (void)message; - GW_LOG_DEBUG("{}{}{}{}", TABS, bid_, message, device_id_); + std::string msg = printTabs(bid_) + " " + std::to_string(bid_) + " " + message + " " + std::to_string(device_id_); + GW_LOG_DEBUG(msg.c_str()); } // Allocate buffers for output details @@ -451,8 +447,8 @@ protected: std::string error_message; std::string error_hint; decode_error(error_type, error_message, error_hint); - error_message = error_message + " in batch {}\n" + error_hint; - GW_LOG_WARN(error_message.c_str(), bid_); + error_message += " in batch " + std::to_string(bid_) + "\n" + error_hint; + GW_LOG_WARN(error_message.c_str()); output_status.emplace_back(error_type); } diff --git a/pygenomeworks/setup.py b/pygenomeworks/setup.py index 931b06385..d94afca14 100755 --- a/pygenomeworks/setup.py +++ b/pygenomeworks/setup.py @@ -143,7 +143,6 @@ def copy_all_files_in_directory(src, dest, file_ext="*.so"): include_dirs=[ cuda_include_path, get_verified_absolute_path(os.path.join(gw_install_dir, "include")), - get_verified_absolute_path(os.path.join(gw_root_dir, "3rdparty", "spdlog", "include")), ], library_dirs=[cuda_library_path, get_verified_absolute_path(os.path.join(gw_install_dir, "lib"))], runtime_library_dirs=[cuda_library_path, os.path.join('$ORIGIN', os.pardir, 'shared_libs')], @@ -158,7 +157,6 @@ def copy_all_files_in_directory(src, dest, file_ext="*.so"): cuda_include_path, get_verified_absolute_path(os.path.join(gw_install_dir, "include")), get_verified_absolute_path(os.path.join(gw_root_dir, "3rdparty", "cub")), - get_verified_absolute_path(os.path.join(gw_root_dir, "3rdparty", "spdlog", "include")), ], library_dirs=[cuda_library_path, get_verified_absolute_path(os.path.join(gw_install_dir, "lib"))], runtime_library_dirs=[cuda_library_path, os.path.join('$ORIGIN', os.pardir, 'shared_libs')],