Optimized phase runtime and ensured multithread safety.
Changes
Makefile Adjustments
Added -fopenmp flag in CPPFLAGS to enable OpenMP support, which allows for efficient multi-threading in the C++ components.
Modifications in ParsingBam.cpp, ParsingBam.h
Introduced an additional parameter int &numThreads in the function direct_detect_alleles. This change allows for dynamic allocation of threads based on the processing requirements, improving the handling of multi-threaded operations.
Updates in Phasing.cpp
Modified the default value of --threads argument to 0. This change signifies that, by default, the program will utilize all available threads, optimizing resource usage.
Major Refactoring in PhasingProcess.cpp
Implemented a new function setNumThreads for intelligent distribution of threads between chromosome processing and BAM parsing, enhancing parallel processing efficiency.
Established a ChrPhasingResult map to handle phasing results in a thread-safe manner.
Merged individual chromosome phasing results into a single mergedPhasingResult, streamlining the result aggregation process.
Testing
This test compares the run times with the develop branch (commit 4d3b42bc5d29cb8e7ae6fa259eca82f92b6bcf9b), performing phasing at 10x to 60x scale. The time format is mm:ss.
Summary
Optimized phase runtime and ensured multithread safety.
Changes
Testing
This test compares the run times with the develop branch (commit 4d3b42bc5d29cb8e7ae6fa259eca82f92b6bcf9b), performing phasing at 10x to 60x scale. The time format is
mm:ss
.