From f4cfac0bb21f1b254fad6a161403ee63c54cc3ad Mon Sep 17 00:00:00 2001 From: Paul Nathan Stickney Date: Tue, 14 Jul 2020 04:45:19 -0700 Subject: [PATCH] #900 pmpi- add vt_trace_pmpi flag to enable tracing - If nothing else, this allows tests to easily pass. --- src/vt/configs/arguments/args.cc | 9 +++++++-- src/vt/configs/arguments/args.h | 1 + src/vt/pmpi/pmpi_component.h | 5 ++++- src/vt/runtime/runtime_banner.cc | 7 ++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/vt/configs/arguments/args.cc b/src/vt/configs/arguments/args.cc index 75492e86f5..f2b227c182 100644 --- a/src/vt/configs/arguments/args.cc +++ b/src/vt/configs/arguments/args.cc @@ -88,6 +88,7 @@ namespace vt { namespace arguments { /*static*/ bool ArgConfig::vt_trace = false; /*static*/ bool ArgConfig::vt_trace_mpi = false; +/*static*/ bool ArgConfig::vt_trace_pmpi = false; /*static*/ std::string ArgConfig::vt_trace_file = ""; /*static*/ std::string ArgConfig::vt_trace_dir = ""; /*static*/ int32_t ArgConfig::vt_trace_mod = 0; @@ -276,8 +277,10 @@ void addTraceArgs(CLI::App& app) { * Flags to control tracing output */ auto trace = "Enable tracing (must be compiled with trace_enabled)"; - auto trace_mpi = "Enable tracing of MPI calls (must be compiled with " - "trace_enabled)"; + auto trace_mpi = "Enable tracing of select internal MPI calls" + " (must be compiled with trace_enabled)"; + auto trace_pmpi = "Enable tracing of external PMPI calls" + " (must be compiled with trace_enabled)"; auto tfile = "Name of trace files"; auto tdir = "Name of directory for trace files"; auto tmod = "Output trace file if (node % vt_stack_mod) == 0"; @@ -294,6 +297,7 @@ void addTraceArgs(CLI::App& app) { auto tirecv = "Trace MPI_Irecv request polling"; auto n = app.add_flag("--vt_trace", ArgConfig::vt_trace, trace); auto nm = app.add_flag("--vt_trace_mpi", ArgConfig::vt_trace_mpi, trace_mpi); + auto no = app.add_flag("--vt_trace_pmpi", ArgConfig::vt_trace_pmpi, trace_pmpi); auto o = app.add_option("--vt_trace_file", ArgConfig::vt_trace_file, tfile, ""); auto p = app.add_option("--vt_trace_dir", ArgConfig::vt_trace_dir, tdir, ""); auto q = app.add_option("--vt_trace_mod", ArgConfig::vt_trace_mod, tmod, 1); @@ -312,6 +316,7 @@ void addTraceArgs(CLI::App& app) { auto traceGroup = "Tracing Configuration"; n->group(traceGroup); nm->group(traceGroup); + no->group(traceGroup); o->group(traceGroup); p->group(traceGroup); q->group(traceGroup); diff --git a/src/vt/configs/arguments/args.h b/src/vt/configs/arguments/args.h index 7f41182ec4..48ca90abc4 100644 --- a/src/vt/configs/arguments/args.h +++ b/src/vt/configs/arguments/args.h @@ -95,6 +95,7 @@ struct ArgConfig { static bool vt_trace; static bool vt_trace_mpi; + static bool vt_trace_pmpi; static bool vt_trace_sys_all; static bool vt_trace_sys_term; static bool vt_trace_sys_location; diff --git a/src/vt/pmpi/pmpi_component.h b/src/vt/pmpi/pmpi_component.h index 01e83aaec9..34d233f6b5 100644 --- a/src/vt/pmpi/pmpi_component.h +++ b/src/vt/pmpi/pmpi_component.h @@ -64,6 +64,8 @@ namespace vt { namespace pmpi { */ struct PMPIComponent : runtime::component::Component { + using ArgType = vt::arguments::ArgConfig; + PMPIComponent() { } @@ -78,7 +80,8 @@ struct PMPIComponent : runtime::component::Component { * \brief Return true iff a PMPI call should be logged in the current context. */ static bool shouldLogCall() { - return runtime::ScopedMPIAccess::mpiCallsTraced(); + return ArgType::vt_trace_pmpi + and runtime::ScopedMPIAccess::mpiCallsTraced(); } private: diff --git a/src/vt/runtime/runtime_banner.cc b/src/vt/runtime/runtime_banner.cc index 87b41a7265..f783300f5c 100644 --- a/src/vt/runtime/runtime_banner.cc +++ b/src/vt/runtime/runtime_banner.cc @@ -454,7 +454,12 @@ void Runtime::printStartupBanner() { fmt::print("{}\t{}{}", vt_pre, f12, reset); } if (ArgType::vt_trace_mpi) { - auto f11 = fmt::format("Tracing MPI invocations"); + auto f11 = fmt::format("Tracing MPI invocations (select internal calls)"); + auto f12 = opt_on("--vt_trace_mpi", f11); + fmt::print("{}\t{}{}", vt_pre, f12, reset); + } + if (ArgType::vt_trace_pmpi) { + auto f11 = fmt::format("Tracing PMPI invocations (external calls)"); auto f12 = opt_on("--vt_trace_mpi", f11); fmt::print("{}\t{}{}", vt_pre, f12, reset); }