From 525acc1c31ced5a6b2334bfff16717b5e5475749 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Wed, 14 Aug 2024 10:03:20 -0400 Subject: [PATCH] #8: add 'suffix' option to configuration --- src/vt-tv/utility/parse_render.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vt-tv/utility/parse_render.cc b/src/vt-tv/utility/parse_render.cc index 0fa6a40aa..b839fe66f 100644 --- a/src/vt-tv/utility/parse_render.cc +++ b/src/vt-tv/utility/parse_render.cc @@ -61,6 +61,9 @@ void ParseRender::parseAndRender(PhaseType phase_id, std::unique_ptr info) std::string input_dir = config["input"]["directory"].as(); std::filesystem::path input_path(input_dir); + // Allow user to point to specific files (e.g. json.br) + std::string file_suffix = config["input"]["suffix"].as("json"); + // If it's a relative path, prepend the SRC_DIR if (input_path.is_relative()) { input_path = std::filesystem::path(SRC_DIR) / input_path; @@ -95,7 +98,7 @@ void ParseRender::parseAndRender(PhaseType phase_id, std::unique_ptr info) for (int64_t rank = 0; rank < n_ranks; rank++) { fmt::print("Reading file for rank {}\n", rank); utility::JSONReader reader{static_cast(rank)}; - reader.readFile(input_dir + "data." + std::to_string(rank) + ".json"); + reader.readFile(input_dir + "data." + std::to_string(rank) + "." + file_suffix); auto tmpInfo = reader.parse(); #ifdef VT_TV_OPENMP_ENABLED #if VT_TV_OPENMP_ENABLED