Skip to content

Commit

Permalink
#2174: add vt-tv params to yaml options
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly authored and cz4rs committed Sep 20, 2024
1 parent f3375fa commit 92c26b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/vt/configs/arguments/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ static const std::string vt_max_mpi_send_size_label = "Max MPI Send Size";
static const std::string vt_no_assert_fail_label = "Disable Assert Failure";
static const std::string vt_throw_on_abort_label = "Throw on Abort";

// Visualization
static const std::string vt_tv_label = "Enabled";
static const std::string vt_tv_config_file_label = "Configuration File";

std::unordered_map<std::string, std::string> user_args_labels = {
{"vt_user_1", "unused_user_param"},
{"vt_user_2", "unused_user_param"},
Expand Down Expand Up @@ -615,6 +619,11 @@ void parseYaml(AppConfig& appConfig, std::string const& inputFile) {
update_config(appConfig.vt_max_mpi_send_size, vt_max_mpi_send_size_label, runtime);
update_config(appConfig.vt_no_assert_fail, vt_no_assert_fail_label, runtime);
update_config(appConfig.vt_throw_on_abort, vt_throw_on_abort_label, runtime);

// Visualization
YAML::Node viz = yaml_input["Visualization"];
update_config(appConfig.vt_tv, vt_tv_label, viz);
update_config(appConfig.vt_tv_config_file, vt_tv_config_file_label, viz);
}

void addColorArgs(CLI::App& app, AppConfig& appConfig) {
Expand Down Expand Up @@ -1320,7 +1329,11 @@ std::string convertConfigToYamlString(AppConfig& appConfig) {
// Runtime
{"Runtime", vt_max_mpi_send_size_label, static_cast<variantArg_t>(appConfig.vt_max_mpi_send_size)},
{"Runtime", vt_no_assert_fail_label, static_cast<variantArg_t>(appConfig.vt_no_assert_fail)},
{"Runtime", vt_throw_on_abort_label, static_cast<variantArg_t>(appConfig.vt_throw_on_abort)}
{"Runtime", vt_throw_on_abort_label, static_cast<variantArg_t>(appConfig.vt_throw_on_abort)},

// Visualization
{"Visualization", vt_tv_label, static_cast<variantArg_t>(appConfig.vt_tv)},
{"Visualization", vt_tv_config_file_label, static_cast<variantArg_t>(appConfig.vt_tv_config_file)}
};

// Create an empty node that we will populate
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/runtime/test_initialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ TEST_F(TestInitialization, test_initialize_with_yaml) {
Configuration File:
Enable Output Config: True
File: test_config.yaml
Visualization:
Enabled: False
)";
cfg_file_.close();
}
Expand Down Expand Up @@ -499,6 +501,10 @@ TEST_F(TestInitialization, test_initialize_with_yaml) {
EXPECT_EQ(theConfig()->vt_no_assert_fail, false);
EXPECT_EQ(theConfig()->vt_throw_on_abort, true);

// Visualization
EXPECT_EQ(theConfig()->vt_tv, false);
EXPECT_EQ(theConfig()->vt_tv_config_file, "");

// TEST THAT THE CONFIGURATION FILE WAS WRITTEN OUT CORRECTLY
YAML::Node input_config = YAML::LoadFile(config_file);
YAML::Node output_config = YAML::Load(theConfig()->vt_output_config_str);
Expand Down

0 comments on commit 92c26b9

Please sign in to comment.