Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ROCK
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Véronique LEGRAND
ROCK
Commits
fa36ac1f
You need to sign in or sign up before continuing.
Commit
fa36ac1f
authored
4 years ago
by
Veronique Legrand
Browse files
Options
Downloads
Patches
Plain Diff
fixed calculation of the size of the CMS
parent
eec34fa0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Filter.hpp
+10
-10
10 additions, 10 deletions
src/Filter.hpp
with
10 additions
and
10 deletions
src/Filter.hpp
+
10
−
10
View file @
fa36ac1f
...
...
@@ -31,9 +31,10 @@ class Filter {
ShortCountMinSketch
*
pShortCMS
;
FasqQualThreshold
qual_thres
;
long
nb_bytes_before_fill_CMS
,
nb_bytes_after_fill_CMS
;
// long nb_bytes_before_fill_CMS,nb_bytes_after_fill_CMS;
long
nb_bytes_CMS
;
//! Number of bytes taken by the underlying CMS.
void
getRSS
(
int
before_fill
=
0
);
void
getRSS
();
template
<
typename
T
>
void
underlyingfillCMS
(
FqBaseBackend
*
map_id_backend
[],
int
nb_be
,
int
k
,
srp
*
io_sr
,
CountMinSketch
<
T
>*
cms
);
...
...
@@ -44,12 +45,12 @@ public:
Filter
(
const
CMSparams
&
parms
,
const
FasqQualThreshold
&
the_qual_thres
)
{
pByteCMS
=
NULL
;
pShortCMS
=
NULL
;
getRSS
();
if
(
parms
.
kappa
<
ubytemask
)
pByteCMS
=
new
ByteCountMinSketch
(
parms
);
else
pShortCMS
=
new
ShortCountMinSketch
(
parms
);
qual_thres
=
the_qual_thres
;
nb_bytes_after_fill_CMS
=
0
;
getRSS
();
//nb_bytes_CMS=0;
//nb_bytes_after_fill_CMS=0;
}
void
fillCMS
(
FqBaseBackend
*
map_id_backend
[],
int
nb_be
,
int
k
,
srp
*
io_sr
);
...
...
@@ -142,7 +143,7 @@ template <typename T> void Filter::underlyinglowFilterCMS(FqBaseBackend* map_id_
void
Filter
::
fillCMS
(
FqBaseBackend
*
map_id_backend
[],
int
nb_be
,
int
k
,
srp
*
io_sr
)
{
if
(
pByteCMS
!=
NULL
)
underlyingfillCMS
<
unsigned
char
>
(
map_id_backend
,
nb_be
,
k
,
io_sr
,
pByteCMS
);
else
underlyingfillCMS
<
unsigned
short
>
(
map_id_backend
,
nb_be
,
k
,
io_sr
,
pShortCMS
);
getRSS
(
1
);
getRSS
();
}
void
Filter
::
lowFilterCMS
(
FqBaseBackend
*
map_id_backend
[],
int
nb_be
,
int
k
,
srp
*
io_sr
)
{
...
...
@@ -160,16 +161,15 @@ std::vector<unsigned long> Filter::getUnsetBuckets() const {
else
return
pShortCMS
->
getUnsetBuckets
();
}
void
Filter
::
getRSS
(
int
before_fill
)
{
void
Filter
::
getRSS
()
{
struct
rusage
usage
;
int
res2
=
getrusage
(
RUSAGE_SELF
,
&
usage
);
if
(
res2
==-
1
)
err
(
errno
,
"cannot get resource usage."
);
if
(
before_fill
==
0
)
nb_bytes_before_fill_CMS
=
usage
.
ru_maxrss
;
else
nb_bytes_after_fill_CMS
=
usage
.
ru_maxrss
;
nb_bytes_CMS
=
usage
.
ru_maxrss
;
}
unsigned
long
Filter
::
getSize
()
{
unsigned
long
cms_size
=
nb_bytes_
after_fill_CMS
-
nb_bytes_before_fill_
CMS
;
unsigned
long
cms_size
=
nb_bytes_CMS
;
// cms_size/=8; ru_maxrss seems to be already in Bytes.
return
cms_size
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment