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

added check of available RAM on machine before running unit test for CMS.

parent 59f08677
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
using namespace std; using namespace std;
#include "CountMinSketch.hpp" #include "CountMinSketch.hpp"
#include "main_utils.h"
void test_CMS(int lambda,int kappa,int kappa_prime) { void test_CMS(int lambda,int kappa,int kappa_prime) {
...@@ -78,6 +79,16 @@ int main(int argc, char **argv) { ...@@ -78,6 +79,16 @@ int main(int argc, char **argv) {
cout<<"sizeof(int)="<<sizeof(int)<<endl; cout<<"sizeof(int)="<<sizeof(int)<<endl;
cout<<"sizeof(long)="<<sizeof(long)<<endl; cout<<"sizeof(long)="<<sizeof(long)<<endl;
cout<<"checking that your machine has enough RAM to run test"<<endl;
unsigned long ram=getNodePhysMemory();
if (ram<5) {
cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
cout<<" WARNING: skipping this test, it requires at least 4 gigabytes of RAM to run."<<endl;
cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
return 0;
}
cout<<"testing CMS with lambda="<<lambda<<endl; cout<<"testing CMS with lambda="<<lambda<<endl;
test_CMS(lambda,kappa,kappa_prime); // Finally using C arrays (maps implied storing hash keys : 4 Bytes per k_mer overhead) but each array is of size INT_MAX... test_CMS(lambda,kappa,kappa_prime); // Finally using C arrays (maps implied storing hash keys : 4 Bytes per k_mer overhead) but each array is of size INT_MAX...
......
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