NCBI C++ ToolKit
mm_aligner_threads.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: mm_aligner_threads.cpp 100300 2023-07-18 19:57:36Z mozese2 $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Yuri Kapustin
27  *
28  * File Description: CMMAligner thread classes implementation
29  *
30  * ===========================================================================
31  *
32  */
33 
34 #include <ncbi_pch.hpp>
35 #include "mm_aligner_threads.hpp"
36 
37 
39 
40 unsigned int g_nwmm_thread_count = 1;
41 
42 DEFINE_STATIC_FAST_MUTEX(thread_count_mutex);
43 
44 bool MM_RequestNewThread(const size_t max_threads)
45 {
46  CFastMutexGuard guard(thread_count_mutex);
47  if(g_nwmm_thread_count < max_threads) {
49  return true;
50  }
51  else
52  return false;
53 }
54 
55 
57  const CMMAligner* aligner, const SCoordRect* rect,
58  vector<CNWAligner::TScore>* e,
59  vector<CNWAligner::TScore>* f,
60  vector<CNWAligner::TScore>* g,
61  vector<unsigned char>* trace, bool free_corner_fgap ):
62 
63  m_aligner(aligner), m_rect(rect), m_E(e), m_F(f),
64  m_G(g), m_trace(trace), m_free_corner_fgap(free_corner_fgap)
65 {
66 }
67 
68 
70 {
73 
74  return 0;
75 }
76 
77 
79 {
80  CFastMutexGuard guard(thread_count_mutex);
82 }
83 
84 //////////////////
85 
87  list<CNWAligner::ETranscriptSymbol>::iterator translist_pos,
88  bool free_lt_fgap, bool free_rb_fgap ):
89 
90  m_aligner(aligner), m_rect(rect),
91  m_translist_pos(translist_pos),
92  m_free_lt_fgap (free_lt_fgap),
93  m_free_rb_fgap (free_rb_fgap)
94 {
95 }
96 
97 
99 {
102 
103  return 0;
104 }
105 
107 {
108  CFastMutexGuard guard(thread_count_mutex);
110 }
111 
112 
CMMAligner * m_aligner
list< CNWAligner::ETranscriptSymbol >::iterator m_translist_pos
CThreadDoSM(CMMAligner *aligner, const SCoordRect *rect, list< CNWAligner::ETranscriptSymbol >::iterator translist_pos, bool free_lt_fgap, bool free_rb_fgap)
const SCoordRect * m_rect
virtual void * Main()
Derived (user-created) class must provide a real thread function.
virtual void OnExit()
Override this to execute finalization code.
const CMMAligner * m_aligner
CThreadRunOnTop(const CMMAligner *aligner, const SCoordRect *rect, vector< CNWAligner::TScore > *e, vector< CNWAligner::TScore > *f, vector< CNWAligner::TScore > *g, vector< unsigned char > *trace, bool free_corner_fgap)
virtual void * Main()
Derived (user-created) class must provide a real thread function.
vector< unsigned char > * m_trace
vector< CNWAligner::TScore > * m_F
vector< CNWAligner::TScore > * m_G
const SCoordRect * m_rect
virtual void OnExit()
Override this to execute finalization code.
vector< CNWAligner::TScore > * m_E
static FILE * f
Definition: readconf.c:23
static bool trace
void x_DoSubmatrix(const SCoordRect &submatr, list< ETranscriptSymbol >::iterator translist_pos, bool left_top, bool right_bottom)
Definition: mm_aligner.cpp:113
void x_RunTop(const SCoordRect &rect, vector< TScore > &vE, vector< TScore > &vF, vector< TScore > &vG, vector< unsigned char > &trace, bool lt) const
Definition: mm_aligner.cpp:442
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
DEFINE_STATIC_FAST_MUTEX(thread_count_mutex)
unsigned int g_nwmm_thread_count
bool MM_RequestNewThread(const size_t max_threads)
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
Modified on Fri Sep 20 14:58:00 2024 by modify_doxy.py rev. 669887