Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

869 make command-line arguments in VT non-static #898

Merged
merged 33 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a76d2e1
#869 add vs code directory to .gitignore
cz4rs Jun 25, 2020
630139f
#869 move default ArgConfig values into class definition
cz4rs Jun 26, 2020
39fcbfd
#869 use theArgConfig() instead of static variables
cz4rs Jun 26, 2020
d28b569
#869 promote ArgConfig to a component
cz4rs Jun 28, 2020
37dc935
#869 access member variables directly instead of going through theArC…
cz4rs Jul 14, 2020
7ee07a9
#869 store configuration separately before theArgConfig is constructed
cz4rs Jul 26, 2020
1574367
#869 use theArgConfig in LB extended test
cz4rs Jul 28, 2020
51d97f1
#869 use initialize and finalize from main ::vt namespace
cz4rs Aug 3, 2020
a03cf7f
#869 use theArgConfig in pmpi component
cz4rs Aug 5, 2020
bebf3bd
#869 call needStatsRestartReader() early when ArgConfig is available
cz4rs Aug 5, 2020
b63d62e
#869 print shutdown banner before the configuration is destroyed
cz4rs Aug 6, 2020
3b775e6
#869 fix heap-use-after-free ASAN error
cz4rs Aug 6, 2020
d76bb04
#869 cleanup: fix formatting, remove unnecessary includes
cz4rs Aug 6, 2020
a85ee83
#869 use fmt::print when we cannot use vt_debug_print macro
cz4rs Aug 6, 2020
87869f0
#869 rename configuration component
cz4rs Aug 7, 2020
ca7797c
#869 separate storage from parsing in theConfig
cz4rs Aug 7, 2020
5876649
#869 use forward declarations when possible
cz4rs Aug 7, 2020
b5aaa96
#869 remove debug printing when we cannot read configuration
cz4rs Aug 10, 2020
54343de
#869 restore header inclusion order in component.h
cz4rs Aug 10, 2020
88f9e6a
#869 remove unnecessary forward declaration
cz4rs Aug 10, 2020
f2dfaf3
#869 mark add***Args methods as private
cz4rs Aug 10, 2020
c4f065b
#869: docs: add some doxygen; fix spacing
lifflander Aug 10, 2020
e08fe5c
#869: args: add namespace comment to follow style
lifflander Aug 10, 2020
07c2e3d
#869: args: fix some style issues
lifflander Aug 10, 2020
e0c8b1b
#869: runtime: use snake case for var names in class (style)
lifflander Aug 10, 2020
b92d560
#869: args: fix const correctness
lifflander Aug 10, 2020
0d13e85
#869: args: allow access to config when VT is not fully running
lifflander Aug 10, 2020
54ee821
#869: runtime: add debug prints back in
lifflander Aug 10, 2020
113fa0f
#869: runtime: fix dangerous uninitialized component pointers
lifflander Aug 10, 2020
07daf68
#869: runtime: write detailed notes on lifecycle of arg_config_
lifflander Aug 10, 2020
7c4584e
#869: runtime: add missing const referring to app config
lifflander Aug 10, 2020
6879ea5
#869: runtime: add arg extraction, put shutdown back, refer to app co…
lifflander Aug 10, 2020
929c5ca
#869: test: fix broken test not actually destroying runtime
lifflander Aug 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ lib/*-build
lib/checkpoint
lib/detector
.emacs.desktop
.vscode/
project/*
balance.in
CMakeSettings.json
Expand Down Expand Up @@ -36,4 +37,4 @@ CMakeSettings.json
# Executables
*.exe
*.out
*.app
*.app
223 changes: 223 additions & 0 deletions src/vt/configs/arguments/app_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
/*
//@HEADER
// *****************************************************************************
//
// app_config.h
// DARMA Toolkit v. 1.0.0
// DARMA/vt => Virtual Transport
//
// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact [email protected]
//
// *****************************************************************************
//@HEADER
*/

#if !defined INCLUDED_VT_CONFIGS_ARGUMENTS_APP_CONFIG_H
#define INCLUDED_VT_CONFIGS_ARGUMENTS_APP_CONFIG_H

// do not pull in any VT dependencies here
#include <string>
#include <vector>

namespace vt { namespace arguments {

struct AppConfig {
inline bool user1() { return vt_user_1; }
inline bool user2() { return vt_user_2; }
inline bool user3() { return vt_user_3; }

inline bool traceTerm() {
return vt_trace_sys_term or vt_trace_sys_all;
}
inline bool traceLocation() {
return vt_trace_sys_location or vt_trace_sys_all;
}
inline bool traceCollection() {
return vt_trace_sys_collection or vt_trace_sys_all;
}
inline bool traceSerialMsg() {
return vt_trace_sys_serial_msg or vt_trace_sys_all;
}

inline bool alwaysFlush() {
return vt_debug_print_flush;
}

bool vt_color = true;
bool vt_no_color = false;
bool vt_auto_color = false;
bool vt_quiet = false;
// Derived from vt_*_color arguments after parsing.
bool colorize_output;

int32_t vt_sched_num_progress = 2;
int32_t vt_sched_progress_han = 0;
double vt_sched_progress_sec = 0.0;
bool vt_no_sigint = false;
bool vt_no_sigsegv = false;
bool vt_no_terminate = false;
std::string vt_memory_reporters =
# if vt_check_enabled(mimalloc)
"mimalloc,"
# endif
"mstats,machinfo,selfstat,selfstatm,sbrk,mallinfo,getrusage,ps";
bool vt_print_memory_each_phase = false;
std::string vt_print_memory_node = "0";
bool vt_allow_memory_report_with_ps = false;
bool vt_print_memory_at_threshold = false;
std::string vt_print_memory_threshold = "1 GiB";
int32_t vt_print_memory_sched_poll = 100;

bool vt_no_warn_stack = false;
bool vt_no_assert_stack = false;
bool vt_no_abort_stack = false;
bool vt_no_stack = false;
std::string vt_stack_file = "";
std::string vt_stack_dir = "";
int32_t vt_stack_mod = 0;

bool vt_trace = false;
bool vt_trace_mpi = false;
bool vt_trace_pmpi = false;
bool vt_trace_sys_all = false;
bool vt_trace_sys_term = false;
bool vt_trace_sys_location = false;
bool vt_trace_sys_collection = false;
bool vt_trace_sys_serial_msg = false;
std::string vt_trace_file = "";
std::string vt_trace_dir = "";
int32_t vt_trace_mod = 0;
int32_t vt_trace_flush_size = 0;
bool vt_trace_spec = false;
std::string vt_trace_spec_file = "";
bool vt_trace_memory_usage = false;
bool vt_trace_event_polling = false;
bool vt_trace_irecv_polling = false;

bool vt_lb = false;
bool vt_lb_file = false;
bool vt_lb_quiet = false;
std::string vt_lb_file_name = "";
std::string vt_lb_name = "NoLB";
std::string vt_lb_args = "";
int32_t vt_lb_interval = 1;
bool vt_lb_stats = false;
std::string vt_lb_stats_dir = "vt_lb_stats";
std::string vt_lb_stats_file = "stats";
std::string vt_lb_stats_dir_in = "vt_lb_stats_in";
std::string vt_lb_stats_file_in = "stats_in";

bool vt_no_detect_hang = false;
bool vt_print_no_progress = true;
bool vt_epoch_graph_on_hang = true;
bool vt_epoch_graph_terse = false;
bool vt_term_rooted_use_ds = false;
bool vt_term_rooted_use_wave = false;
int64_t vt_hang_freq = 1024;

bool vt_pause = false;

bool vt_debug_all = false;
bool vt_debug_verbose = false;
bool vt_debug_none = false;
bool vt_debug_gen = false;
bool vt_debug_runtime = false;
bool vt_debug_active = false;
bool vt_debug_term = false;
bool vt_debug_termds = false;
bool vt_debug_barrier = false;
bool vt_debug_event = false;
bool vt_debug_pipe = false;
bool vt_debug_pool = false;
bool vt_debug_reduce = false;
bool vt_debug_rdma = false;
bool vt_debug_rdma_channel = false;
bool vt_debug_rdma_state = false;
bool vt_debug_param = false;
bool vt_debug_handler = false;
bool vt_debug_hierlb = false;
bool vt_debug_gossiplb = false;
bool vt_debug_scatter = false;
bool vt_debug_sequence = false;
bool vt_debug_sequence_vrt = false;
bool vt_debug_serial_msg = false;
bool vt_debug_trace = false;
bool vt_debug_location = false;
bool vt_debug_lb = false;
bool vt_debug_vrt = false;
bool vt_debug_vrt_coll = false;
bool vt_debug_worker = false;
bool vt_debug_group = false;
bool vt_debug_broadcast = false;
bool vt_debug_objgroup = false;

bool vt_debug_print_flush = false;

bool vt_user_1 = false;
bool vt_user_2 = false;
bool vt_user_3 = false;
int32_t vt_user_int_1 = 0;
int32_t vt_user_int_2 = 0;
int32_t vt_user_int_3 = 0;
std::string vt_user_str_1 = "";
std::string vt_user_str_2 = "";
std::string vt_user_str_3 = "";

bool vt_output_config = false;
std::string vt_output_config_file = "vt_config.ini";
std::string vt_output_config_str = "";

/// Name of the program launched (excluding any path!)
std::string prog_name {"vt_unknown"};

/// Name of the program launched, aka argv[0].
/// Original char* object.
char* argv_prog_name {const_cast<char*>("vt_unknown")};

/// Arguments to pass to MPI Init.
/// Does not include argv[0]. Original char* objects.
std::vector<char*> mpi_init_args;
/// Arguments are being ref-returend as the result of parse(..).
/// Does not include argv[0]. Original char* objects.
std::vector<char*> passthru_args;
};

}} /* end namespace vt::arguments */

namespace vt {

extern arguments::AppConfig* theConfig();

} /* end namespace vt */

#endif /*INCLUDED_VT_CONFIGS_ARGUMENTS_APP_CONFIG_H*/
68 changes: 0 additions & 68 deletions src/vt/configs/arguments/argparse.h

This file was deleted.

Loading