diff --git a/src/vt/runtime/runtime.cc b/src/vt/runtime/runtime.cc index 260df07f6f..efec9f3c64 100644 --- a/src/vt/runtime/runtime.cc +++ b/src/vt/runtime/runtime.cc @@ -413,6 +413,7 @@ void Runtime::printStartupBanner() { if (ArgType::vt_lb) { auto f9 = warn_cr("--vt_lb", "lblite"); fmt::print("{}\t{}{}", vt_pre, f9, reset); + vtAbort("Load balancing enabled with --vt_lb, but disabled at compile time"); } if (ArgType::vt_lb_stats) { auto f9 = warn_cr("--vt_lb_stats", "lblite"); @@ -710,6 +711,12 @@ void Runtime::printStartupBanner() { //fmt::print("{}\n", reset); fmt::print(reset); + + // Enqueue a check for later in case arguments are modified before work + // actually executes + theSched->enqueue([this]{ + this->checkForArgumentErrors(); + }); } void Runtime::printShutdownBanner(term::TermCounterType const& num_units) { @@ -730,6 +737,14 @@ void Runtime::printShutdownBanner(term::TermCounterType const& num_units) { fmt::print("{}{}{}\n", vt_pre, f1, reset); } +void Runtime::checkForArgumentErrors() { + #if !backend_check_enabled(lblite) + if (ArgType::vt_lb) { + vtAbort("Load balancing enabled with --vt_lb, but disabled at compile time"); + } + #endif +} + bool Runtime::initialize(bool const force_now) { if (force_now) { initializeContext(user_argc_, user_argv_, communicator_); diff --git a/src/vt/runtime/runtime.h b/src/vt/runtime/runtime.h index c2690ae1b7..22e2ad92de 100644 --- a/src/vt/runtime/runtime.h +++ b/src/vt/runtime/runtime.h @@ -98,6 +98,9 @@ struct Runtime { void systemSync() { sync(); } +public: + void checkForArgumentErrors(); + private: RuntimeInstType const instance_;