NCBI C++ ToolKit
Functions
blast_traceback_mt_priv.c File Reference

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

#include <algo/blast/core/blast_setup.h>
#include "blast_traceback_mt_priv.h"
#include "blast_hspstream_mt_utils.h"
+ Include dependency graph for blast_traceback_mt_priv.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

SThreadLocalDataSThreadLocalDataNew ()
 Allocate a new SThreadLocalData structure. More...
 
SThreadLocalDataSThreadLocalDataFree (SThreadLocalData *tld)
 Deallocate the SThreadLocalData 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...
 
SThreadLocalDataArraySThreadLocalDataArrayNew (Uint4 num_threads)
 Allocate a new SThreadLocalDataArray structure. More...
 
SThreadLocalDataArraySThreadLocalDataArrayFree (SThreadLocalDataArray *array)
 Deallocate the SThreadLocalDataArray structure passed in. More...
 
static Uint4s_CountHspListsPerQuery (const SThreadLocalDataArray *data, Int4 *num_queries)
 
BlastHSPResultsSThreadLocalDataArrayConsolidateResults (SThreadLocalDataArray *array)
 Extracts a single, consolidated BlastHSPResults structure from its input for single threaded processing. 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...
 

Detailed Description

Private interface to support the multi-threaded traceback.

Definition in file blast_traceback_mt_priv.c.

Function Documentation

◆ s_CountHspListsPerQuery()

static Uint4* s_CountHspListsPerQuery ( const SThreadLocalDataArray data,
Int4 num_queries 
)
static

◆ 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 Fri Sep 20 14:57:45 2024 by modify_doxy.py rev. 669887