diff --git a/public/c++/VectorPairHMM/LoadTimeInitializer.cc b/public/c++/VectorPairHMM/LoadTimeInitializer.cc index 9b56fa9ad..7a4e46161 100644 --- a/public/c++/VectorPairHMM/LoadTimeInitializer.cc +++ b/public/c++/VectorPairHMM/LoadTimeInitializer.cc @@ -10,6 +10,9 @@ LoadTimeInitializer::LoadTimeInitializer() //will be called when library is loa #ifndef DISABLE_FTZ //Very important to get good performance - enable FTZ, converts denormals to 0 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); + cout << "FTZ enabled - may decrease accuracy if denormal numbers encountered\n"; +#else + cout << "FTZ is not set - may slow down performance if denormal numbers encountered\n"; #endif m_sumNumReads = 0; m_sumSquareNumReads = 0; diff --git a/public/c++/VectorPairHMM/Sandbox.java b/public/c++/VectorPairHMM/Sandbox.java index c41a276c2..81a57c0a0 100644 --- a/public/c++/VectorPairHMM/Sandbox.java +++ b/public/c++/VectorPairHMM/Sandbox.java @@ -272,7 +272,7 @@ public class Sandbox { //System.err.println(e); //} Sandbox t = new Sandbox(); - t.doEverythingNative(args[0]); - //t.parseSandboxFile(args[0]); + //t.doEverythingNative(args[0]); + t.parseSandboxFile(args[0]); } } diff --git a/public/c++/VectorPairHMM/pairhmm-1-base.cc b/public/c++/VectorPairHMM/pairhmm-1-base.cc index c7a85e647..2c80f2a2e 100644 --- a/public/c++/VectorPairHMM/pairhmm-1-base.cc +++ b/public/c++/VectorPairHMM/pairhmm-1-base.cc @@ -9,14 +9,14 @@ using namespace std; int main(int argc, char** argv) { -#define BATCH_SIZE 5 +#define BATCH_SIZE 10000 if(argc < 2) { cerr << "Needs path to input file as argument\n"; exit(0); } do_compute(argv[1]); -#if 0 + return 0; bool use_old_read_testcase = false; if(argc >= 3 && string(argv[2]) == "1") use_old_read_testcase = true; @@ -56,7 +56,6 @@ int main(int argc, char** argv) testcase tc_in; int break_value = 0; tc_vector.clear(); - g_load_time_initializer.open_sandbox(); while(1) { break_value = use_old_read_testcase ? read_testcase(&tc_in, fptr) : @@ -144,8 +143,6 @@ int main(int argc, char** argv) fclose(fptr); else ifptr.close(); - g_load_time_initializer.close_sandbox(); -#endif return 0; } diff --git a/public/c++/VectorPairHMM/utils.cc b/public/c++/VectorPairHMM/utils.cc index 419b2d4ce..3d3a17042 100644 --- a/public/c++/VectorPairHMM/utils.cc +++ b/public/c++/VectorPairHMM/utils.cc @@ -79,9 +79,13 @@ int read_testcase(testcase *tc, FILE* ifp) int x, size = 0; ssize_t read; - read = getline(&line, (size_t *) &size, ifp == 0 ? stdin : ifp); + + read = getline(&line, (size_t *) &size, ifp == 0 ? stdin : ifp); if (read == -1) - return -1; + { + free(line); + return -1; + } tc->hap = (char *) malloc(size); @@ -326,7 +330,7 @@ void do_compute(char* filename) long long accum_values[NUM_PAPI_COUNTERS] = { 0, 0, 0, 0 }; #endif -#define BATCH_SIZE 100000 +#define BATCH_SIZE 10000 bool use_old_read_testcase = true; unsigned chunk_size = 100; std::ifstream ifptr; @@ -396,25 +400,25 @@ void do_compute(char* filename) #ifdef CHECK_UNDERFLOW if (result_avxf < MIN_ACCEPTED) #else - if(false) + if(false) #endif - { + { #ifdef COUNT_EXCEPTIONS - if(fp_exception) - ++fp_single_exceptions_reexecute; + if(fp_exception) + ++fp_single_exceptions_reexecute; #endif - double result_avxd = g_compute_full_prob_double(&(tc_vector[i]), 0); - result = log10(result_avxd) - log10(ldexp(1.0, 1020.0)); - ++num_double_executions; - } - else - { + double result_avxd = g_compute_full_prob_double(&(tc_vector[i]), 0); + result = log10(result_avxd) - log10(ldexp(1.0, 1020.0)); + ++num_double_executions; + } + else + { #ifdef COUNT_EXCEPTIONS - if(fp_exception) - ++fp_single_exceptions_continue; + if(fp_exception) + ++fp_single_exceptions_continue; #endif - result = (double)(log10f(result_avxf) - log10f(ldexpf(1.f, 120.f))); - } + result = (double)(log10f(result_avxf) - log10f(ldexpf(1.f, 120.f))); + } results_vec[i] = result; } #ifdef USE_PAPI @@ -459,12 +463,12 @@ void do_compute(char* filename) #endif for(unsigned i=0;i