Skip to content
Snippets Groups Projects
Commit d08a1daf authored by Veronique Legrand's avatar Veronique Legrand
Browse files

fixed getting CMS size

parent 3e977336
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ class Filter {
FasqQualThreshold qual_thres;
// long nb_bytes_before_fill_CMS,nb_bytes_after_fill_CMS;
long nb_bytes_CMS; //! Number of bytes taken by the underlying CMS.
//long nb_bytes_CMS; //! Number of bytes taken by the underlying CMS.
void getRSS();
......@@ -48,7 +48,7 @@ public:
if (parms.kappa<ubytemask) pByteCMS=new ByteCountMinSketch(parms);
else pShortCMS=new ShortCountMinSketch(parms);
qual_thres=the_qual_thres;
getRSS();
//getRSS();
//nb_bytes_CMS=0;
//nb_bytes_after_fill_CMS=0;
}
......@@ -143,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();
//getRSS();
}
void Filter::lowFilterCMS(FqBaseBackend* map_id_backend[],int nb_be,int k, srp* io_sr) {
......@@ -161,6 +161,7 @@ std::vector<unsigned long> Filter::getUnsetBuckets() const {
else return pShortCMS->getUnsetBuckets();
}
/*
void Filter::getRSS() {
struct rusage usage;
int res2=getrusage(RUSAGE_SELF,&usage);
......@@ -172,7 +173,7 @@ unsigned long Filter::getSize() {
unsigned long cms_size=nb_bytes_CMS;
// cms_size/=8; ru_maxrss seems to be already in Bytes.
return cms_size;
}
}*/
unsigned int Filter::getNbBitsForCounters() const {
if (pByteCMS!=NULL) return sizeof(unsigned char)*8;
......
......@@ -144,7 +144,7 @@ void ROCKparams::optArgConsistency(const string& input_file,const string& output
#ifdef DEBUG
cout<<"parms.lambda="<<parms.lambda<<" UINT_MAX="<<UINT_MAX<<endl;
#endif
unsigned long cms_size=k_arr_cms_size;
cms_size=k_arr_cms_size;
cms_size*=parms.lambda;
if (parms.kappa>get_mask<unsigned char>::value) cms_size=cms_size*sizeof(unsigned short);
cms_size=ceil(cms_size/1024.0/1024/1024); // convert to gigabytes.
......
......@@ -146,15 +146,17 @@ public:
return k;
}
void setFilterSize(unsigned long fsize) {
// cms_size is computed when ROCK starts.
/*void setFilterSize(unsigned long fsize) {
cms_size=fsize;
}
}*/
unsigned long getFilterSize() const {
unsigned long cms_size_in_GB=cms_size/1024;
/*unsigned long cms_size_in_GB=cms_size/1024;
cms_size_in_GB/=1024;
cms_size_in_GB/=1024;
return cms_size_in_GB;
return cms_size_in_GB;*/
return cms_size;
}
......
......@@ -167,7 +167,7 @@ int main(int argc,char * argv[]) {
cout<<"Now going to remove read with cov<kappa_prime"<<endl;
#endif
main_parms.setFilterSize(the_filter.getSize());
// main_parms.setFilterSize(the_filter.getSize()); // no more used max_rss is not precise enough
// Now, remove reads that are beneath kappa_prime
if (parms.kappa_prime) the_filter.lowFilterCMS(map_id_backend,f_id,k,&sr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment