Skip to content

Commit

Permalink
Merge pull request #59 from Intel-HLS/eba_report_omp_threads_phmm
Browse files Browse the repository at this point in the history
Report OMP threads in PairHMM (resolves #56)
  • Loading branch information
erniebrau authored May 23, 2017
2 parents 04890d3 + 0059358 commit 8a26e65
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/native/pairhmm/IntelPairHmm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ JNIEXPORT void JNICALL Java_com_intel_gkl_pairhmm_IntelPairHmm_initNative
g_use_double = use_double;

#ifdef _OPENMP
g_max_threads = std::min((int)max_threads, omp_get_max_threads());
int avail_threads = omp_get_max_threads();
int req_threads = max_threads;
g_max_threads = std::min(req_threads, avail_threads);

INFO("Available threads: %d", avail_threads);
INFO("Requested threads: %d", req_threads);
if (req_threads > avail_threads) {
WARN("Using %d available threads, but %d were requested", g_max_threads, req_threads);
}
else {
INFO("Using %d threads", g_max_threads);
}
#else
if (max_threads != 1) {
WARN("Ignoring request for %d threads; not using OpenMP implementation", max_threads);
}
#endif

g_use_fpga = use_fpga;
Expand Down

0 comments on commit 8a26e65

Please sign in to comment.