NCBI C++ ToolKit
Classes | Typedefs | Functions
blast_traceback_mt_priv.h File Reference

Private interface to support the multi-threaded traceback. More...

#include <algo/blast/core/blast_gapalign.h>
#include <algo/blast/core/blast_hspstream.h>
#include <algo/blast/core/blast_parameters.h>
+ Include dependency graph for blast_traceback_mt_priv.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SThreadLocalData
 Data structure to support MT traceback: this encapsulates the data that each thread modifies. More...
 
struct  SThreadLocalDataArray
 

Typedefs

typedef struct SThreadLocalData SThreadLocalData
 Data structure to support MT traceback: this encapsulates the data that each thread modifies. More...
 
typedef struct SThreadLocalDataArray SThreadLocalDataArray
 

Functions

SThreadLocalDataSThreadLocalDataNew ()
 Allocate a new SThreadLocalData structure. More...
 
SThreadLocalDataSThreadLocalDataFree (SThreadLocalData *tld)
 Deallocate the SThreadLocalData structure passed in. More...
 
SThreadLocalDataArraySThreadLocalDataArrayNew (Uint4 num_threads)
 Allocate a new SThreadLocalDataArray structure. More...
 
SThreadLocalDataArraySThreadLocalDataArrayFree (SThreadLocalDataArray *array)
 Deallocate the SThreadLocalDataArray structure passed in. More...
 
void SThreadLocalDataArrayTrim (SThreadLocalDataArray *array, Uint4 actual_num_threads)
 Reduce the size of the array structure passed in to match the value of the actual_num_threads parameter. More...
 
Int2 SThreadLocalDataArraySetup (SThreadLocalDataArray *array, EBlastProgramType program, const BlastScoringOptions *score_options, const BlastEffectiveLengthsOptions *eff_len_options, const BlastExtensionOptions *ext_options, const BlastHitSavingOptions *hit_options, BlastQueryInfo *query_info, BlastScoreBlk *sbp, const BlastSeqSrc *seqsrc)
 Set up a newly allocated SThreadLocalDataArray object so it can be used by multiple threads. More...
 
BlastHSPResultsSThreadLocalDataArrayConsolidateResults (SThreadLocalDataArray *array)
 Extracts a single, consolidated BlastHSPResults structure from its input for single threaded processing. More...
 
Int2 BLAST_ComputeTraceback_MT (EBlastProgramType program_number, BlastHSPStream *hsp_stream, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, SThreadLocalDataArray *thread_data, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, TInterruptFnPtr interrupt_search, SBlastProgress *progress_info)
 Identical in function to BLAST_ComputeTraceback, but this performs its task in a multi-threaded manner if OpenMP is available. More...
 

Detailed Description

Private interface to support the multi-threaded traceback.

Definition in file blast_traceback_mt_priv.h.

Typedef Documentation

◆ SThreadLocalData

Data structure to support MT traceback: this encapsulates the data that each thread modifies.

◆ SThreadLocalDataArray

Function Documentation

◆ BLAST_ComputeTraceback_MT()

Int2 BLAST_ComputeTraceback_MT ( EBlastProgramType  program_number,
BlastHSPStream hsp_stream,
BLAST_SequenceBlk query,
BlastQueryInfo query_info,
SThreadLocalDataArray thread_data,
const BlastDatabaseOptions db_options,
const PSIBlastOptions psi_options,
const BlastRPSInfo rps_info,
SPHIPatternSearchBlk pattern_blk,
BlastHSPResults **  results,
TInterruptFnPtr  interrupt_search,
SBlastProgress progress_info 
)

Identical in function to BLAST_ComputeTraceback, but this performs its task in a multi-threaded manner if OpenMP is available.

Definition at line 1436 of file blast_traceback.c.

References BlastHSPStreamResultsBatchArray::array_of_batches, ASSERT, Blast_HSPListFree(), Blast_HSPListGetBitScores(), Blast_HSPResultsApplyMasklevel(), Blast_HSPResultsFree(), Blast_HSPResultsInsertHSPList(), Blast_HSPResultsNew(), Blast_HSPResultsSortByEvalue(), Blast_HSPStreamResultBatchReset(), BLAST_OneSubjectUpdateParameters(), Blast_ProgramIsPhiBlast(), Blast_ProgramIsRpsBlast(), Blast_RedoAlignmentCore_MT(), BLAST_SetupPartialFetching(), Blast_SubjectIsTranslated(), Blast_TracebackFromHSPList(), Blast_TracebackGetEncoding(), BLASTERR_INTERRUPTED, BlastHSPStreamResultsBatchArrayFree(), BlastHSPStreamTBackClose(), BlastHSPStreamToHSPStreamResultsBatch(), BlastSeqSrcGetSequence(), BlastSeqSrcGetSupportsPartialFetching(), BlastSeqSrcGetTotLen(), BlastSeqSrcReleaseSequence(), BlastSeqSrcSetRangesArgFree(), BlastSequenceBlkFree(), BlastSeqSrcGetSeqArg::check_oid_exclusion, BlastExtensionOptions::compositionBasedStats, SThreadLocalData::eff_len_params, BlastSeqSrcGetSeqArg::encoding, eSmithWatermanTbck, BlastExtensionOptions::eTbackExt, eTracebackSearch, SThreadLocalData::ext_params, FALSE, SThreadLocalData::gap_align, BlastScoringOptions::gapped_calculation, BLAST_SequenceBlk::gen_code_string, GenCodeSingletonFind(), BlastDatabaseOptions::genetic_code, SThreadLocalData::hit_params, BlastHSPResults::hitlist_array, BlastHitSavingOptions::hitlist_size, BlastHitSavingOptions::hsp_filt_opt, BlastHSPList::hspcnt, BlastHitList::hsplist_array, BlastHSPStreamResultBatch::hsplist_array, BlastHitList::hsplist_count, i, BLAST_SequenceBlk::length, BlastHitSavingParameters::mask_level, MAX, BlastHitSavingOptions::max_hsps_per_subject, MIN, NULL, BlastHSPStreamResultsBatchArray::num_batches, SThreadLocalDataArray::num_elems, BlastHSPStreamResultBatch::num_hsplists, BlastHSPResults::num_queries, BlastQueryInfo::num_queries, BlastHSPList::oid, BlastSeqSrcGetSeqArg::oid, BlastExtensionParameters::options, BlastHitSavingParameters::options, BlastScoringParameters::options, query, BlastHitSavingOptions::query_cov_hsp_perc, SThreadLocalData::query_info, BlastSeqSrcGetSeqArg::ranges, BlastSeqSrcGetSeqArg::reset_ranges, SThreadLocalData::results, s_BlastPruneExtraHits(), s_FilterBlastResults(), s_PHITracebackFromHSPList(), s_RPSComputeTraceback(), s_SThreadLocalDataArraySetGapXDropoffFinal(), BlastGapAlignStruct::sbp, SThreadLocalData::score_params, BlastSeqSrcGetSeqArg::seq, SThreadLocalData::seqsrc, SBlastProgress::stage, SThreadLocalDataArrayConsolidateResults(), SThreadLocalDataArrayTrim(), BlastHSPFilteringOptions::subject_besthit_opts, SThreadLocalDataArray::tld, and TRUE.

Referenced by BLAST_ComputeTraceback(), and Blast_RunTracebackSearchWithInterrupt().

◆ SThreadLocalDataArrayConsolidateResults()

BlastHSPResults* SThreadLocalDataArrayConsolidateResults ( SThreadLocalDataArray array)

Extracts a single, consolidated BlastHSPResults structure from its input for single threaded processing.

Parameters
arraystructure to inspect and modify [in|out]
Returns
Consolidated structure or NULL in case of memory allocation failure

Definition at line 139 of file blast_traceback_mt_priv.c.

References Blast_HitListNew(), Blast_HSPList_IsEmpty(), Blast_HSPResultsFree(), Blast_HSPResultsNew(), calloc(), BlastHSPResults::hitlist_array, BlastHitList::hsplist_array, BlastHitList::hsplist_count, i, BlastHitList::low_score, MAX, MIN, NULL, s_CountHspListsPerQuery(), sfree, and BlastHitList::worst_evalue.

Referenced by BLAST_ComputeTraceback_MT(), and Blast_RedoAlignmentCore_MT().

◆ SThreadLocalDataArrayFree()

SThreadLocalDataArray* SThreadLocalDataArrayFree ( SThreadLocalDataArray array)

Deallocate the SThreadLocalDataArray structure passed in.

Parameters
arraystructure to deallocate [in]
Returns
NULL

Definition at line 96 of file blast_traceback_mt_priv.c.

References i, NULL, sfree, and SThreadLocalDataFree().

Referenced by BLAST_ComputeTraceback(), Blast_RunTracebackSearchWithInterrupt(), and SThreadLocalDataArrayNew().

◆ SThreadLocalDataArrayNew()

SThreadLocalDataArray* SThreadLocalDataArrayNew ( Uint4  num_threads)

Allocate a new SThreadLocalDataArray structure.

Parameters
num_threadssize of the array structure to allocate [in]
Returns
NULL in case of memory allocation failure, otherwise a pointer to the new structure

Definition at line 76 of file blast_traceback_mt_priv.c.

References calloc(), i, malloc(), NULL, SThreadLocalDataArray::num_elems, SThreadLocalDataArrayFree(), SThreadLocalDataNew(), and SThreadLocalDataArray::tld.

Referenced by BLAST_ComputeTraceback(), Blast_RedoAlignmentCore_MT(), and Blast_RunTracebackSearchWithInterrupt().

◆ SThreadLocalDataArraySetup()

Int2 SThreadLocalDataArraySetup ( SThreadLocalDataArray array,
EBlastProgramType  program,
const BlastScoringOptions score_options,
const BlastEffectiveLengthsOptions eff_len_options,
const BlastExtensionOptions ext_options,
const BlastHitSavingOptions hit_options,
BlastQueryInfo query_info,
BlastScoreBlk sbp,
const BlastSeqSrc seqsrc 
)

Set up a newly allocated SThreadLocalDataArray object so it can be used by multiple threads.

Parameters
arraystructure to modify [in|out]
programBLAST program type [in]
score_optionsscoring options to clone [in]
eff_len_optionseffective length options to clone [in]
ext_optionsextension options to clone [in]
hit_optionshit options to clone [in]
query_infoquery_info structure to clone [in]
sbpBlastScoreBlk structure to refer to (not cloned) [in]
seqsrcsequence source structure to clone [in]
Returns
0 on success, otherwise an error code

Definition at line 202 of file blast_traceback_mt_priv.c.

References BLAST_GapAlignSetUp(), Blast_HSPResultsNew(), BLASTERR_INVALIDPARAM, BLASTERR_MEMORY, BlastQueryInfoDup(), BlastSeqSrcCopy(), i, and BlastQueryInfo::num_queries.

Referenced by BLAST_ComputeTraceback(), and Blast_RunTracebackSearchWithInterrupt().

◆ SThreadLocalDataArrayTrim()

void SThreadLocalDataArrayTrim ( SThreadLocalDataArray array,
Uint4  actual_num_threads 
)

Reduce the size of the array structure passed in to match the value of the actual_num_threads parameter.

Parameters
arraystructure to modify [in|out]
actual_num_threadsnumber of threads that will be used during the MT traceback [in]

Definition at line 62 of file blast_traceback_mt_priv.c.

References ASSERT, i, and SThreadLocalDataFree().

Referenced by BLAST_ComputeTraceback_MT().

◆ SThreadLocalDataFree()

SThreadLocalData* SThreadLocalDataFree ( SThreadLocalData tld)

◆ SThreadLocalDataNew()

SThreadLocalData* SThreadLocalDataNew ( )

Allocate a new SThreadLocalData structure.

Returns
NULL in case of memory allocation failure, otherwise a pointer to the new structure

Definition at line 37 of file blast_traceback_mt_priv.c.

References calloc().

Referenced by SThreadLocalDataArrayNew().

Modified on Tue Apr 16 20:11:58 2024 by modify_doxy.py rev. 669887