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

re-used what I had implemented for the -g option to warn the user that there...

re-used what I had implemented for the -g option to warn the user that there is not enough memory on the machine to process all reads with the given or default low filter.
parent b561a8ce
No related branches found
No related tags found
No related merge requests found
......@@ -61,15 +61,6 @@ void ROCKparams::optArgConsistency(const string& input_file,const string& output
cout<<"-l and -n options are mutually exclusive."<<endl;
usage(EXIT_FAILURE);
}
float avail_mem=getNodePhysMemory()-defaultGRPMAXSize;
// cout<<avail_mem;
/*if (g>avail_mem) {
std::cout<<"This machine only has "<<getNodePhysMemory()<<" Gigabytes of RAM. This is not enough to run ROCK with a CMS of size: "<<g<<endl;
exit(EXIT_FAILURE);
} else if (g!=0) {
parms.filter_size=g;
computeLambda();
}*/
if (nb_k_mers) { // user indicated number of k-mers; use it to minimize parms.lambda
//parms.lambda=getBestLambdaForN(nb_k_mers,parms.lambda);
int smallest_kappa;
......@@ -92,25 +83,18 @@ void ROCKparams::optArgConsistency(const string& input_file,const string& output
}
if (parms.lambda==0) {
// This happens when the user doesn't specify lambda nor nb_k_mers.
//computeLambda();
parms.lambda=k_proposed_lamda;
/* if (parms.lambda==0) {
cout<<"Not enough RAM on the machine. Total RAM in GB must be bigger than UINT_MAX to allow at least 1 array in the CMS."<<endl;
exit(EXIT_FAILURE);
}*/
}
#ifdef DEBUG
cout<<"parms.lambda="<<parms.lambda<<" UINT_MAX="<<UINT_MAX<<endl;
#endif
unsigned long cms_size=k_arr_cms_size;
cms_size*=parms.lambda;
//cout<<"minimum cms size:"<<cms_size<<endl;
if (parms.kappa>get_mask<unsigned char>::value) cms_size=cms_size*sizeof(unsigned short);
//cout<<"cms_size in B="<<cms_size<<endl;
cms_size=ceil(cms_size/1024.0/1024/1024); // convert to gigabytes.
//cout<<"cms_size in GB="<<cms_size<<endl;
if (cms_size>getNodePhysMemory()-defaultGRPMAXSize) {
cout<<"Not enough RAM on the machine to run rock with a CMS of size:"<<cms_size<<" GB."<<endl;
cout<<" Maybe you should think of increasing the value for the low filter (-c option)"<<endl;
exit(EXIT_FAILURE);
}
}
......
......@@ -61,7 +61,7 @@ echo "doing more checks on options and error messages"
../src/rock -C 500 -c 400 -k 10 -l 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for lambda" >/dev/null || exit 10
../src/rock -C 500 -c 400 -k 10 -l 500 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Not enough RAM on the machine" >/dev/null || exit 11
#../src/rock -C 500 -c 400 -k 10 -l 12 -g 25 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive" >/dev/null|| exit 12
#../src/rock -C 500 -c 400 -k 10 -g 10000 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "This machine only has" >/dev/null || exit 13
../src/rock -C 500 -c 400 -k 10 -n 50000000000 -c 1 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "think of increasing the value for the low filter" >/dev/null || exit 13
../src/rock -C 500 -c 400 -k 10 -l 12 -n 85000000 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive">/dev/null || exit 14
../src/rock -C 500 -c 400 -k 10 -q 3 -m 0 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "minimum number of valid k-mer for keeping a read must be an integer">/dev/null || exit 15
../src/rock -C 500 -c 400 -k 10 -q -1 -m 2 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "q must be">/dev/null || exit 16
......
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