diff --git a/bindings/python/tv.cc b/bindings/python/tv.cc index 39d9041b52..119a4f5aa9 100644 --- a/bindings/python/tv.cc +++ b/bindings/python/tv.cc @@ -91,21 +91,27 @@ void tvFromJson(const std::vector& input_json_per_rank_list, const #else const int threads = 2; #endif - omp_set_num_threads(threads); - // print number of threads - fmt::print("vt-tv: Using {} threads\n", threads); + #ifdef VT_TV_OPENMP_ENABLED + omp_set_num_threads(threads); + // print number of threads + fmt::print("vt-tv: Using {} threads\n", threads); + #endif // Initialize the info object, that will hold data for all ranks for all phases std::unique_ptr info = std::make_unique(); - # pragma omp parallel for + #ifdef VT_TV_OPENMP_ENABLED + # pragma omp parallel for + #endif for (int64_t rank_id = 0; rank_id < num_ranks; rank_id++) { fmt::print("Reading file for rank {}\n", rank_id); std::string rank_json_str = input_json_per_rank_list[rank_id]; utility::JSONReader reader{static_cast(rank_id)}; reader.readString(rank_json_str); auto tmpInfo = reader.parse(); - #pragma omp critical + #ifdef VT_TV_OPENMP_ENABLED + #pragma omp critical + #endif { info->addInfo(tmpInfo->getObjectInfo(), tmpInfo->getRank(rank_id)); } diff --git a/src/vt-tv/utility/parse_render.cc b/src/vt-tv/utility/parse_render.cc index 450e7dedde..349392a458 100644 --- a/src/vt-tv/utility/parse_render.cc +++ b/src/vt-tv/utility/parse_render.cc @@ -86,7 +86,6 @@ void ParseRender::parseAndRender(PhaseType phase_id, std::unique_ptr info) const int threads = 2; #endif #ifdef VT_TV_OPENMP_ENABLED - fmt::print("openmp enabled\n"); omp_set_num_threads(threads); # pragma omp parallel for #endif // VT_TV_OPENMP_ENABLED