Skip to content

Commit 1cee0d6

Browse files
authored
Merge pull request #2490 from DARMA-tasking/2489-missing-c20-compatibility-issue
2489 missing cxx20 compatibility issue
2 parents 26ac1bc + 77fd4ba commit 1cee0d6

File tree

4 files changed

+52
-27
lines changed

4 files changed

+52
-27
lines changed

docker-bake.hcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ target "vt-build-all" {
340340
image = "amd64-ubuntu-22.04-clang-15-cpp"
341341
variant = "cxx20"
342342
vt_cmake_cxx_standard = 20
343+
vt_debug_verbose = 1
344+
vt_production_build = 0
343345
},
344346
{
345347
image = "amd64-ubuntu-22.04-gcc-11-cpp"

src/vt/configs/debug/debug_print.h

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,14 @@ namespace vt { namespace config {
283283
template <CatEnum cat, CtxEnum ctx, ModeEnum mod>
284284
struct DebugPrintOp;
285285

286-
template <CatEnum cat, ModeEnum mod, typename Arg, typename... Args>
287-
static inline void debugPrintImpl(NodeType node, Arg&& arg, Args&&... args) {
286+
template <CatEnum cat, ModeEnum mod, typename... Args>
287+
static inline void debugPrintImpl(
288+
NodeType node, fmt::format_string<Args...> arg, Args&&... args
289+
) {
288290
constexpr auto mask = ModeEnum::terse | ModeEnum::normal | ModeEnum::verbose;
289291
constexpr auto level = mod & mask;
290292
if (level <= vt::debug::preConfig()->vt_debug_level_val) {
291-
auto user = fmt::format(std::forward<Arg>(arg),std::forward<Args>(args)...);
293+
auto user = fmt::format(arg, std::forward<Args>(args)...);
292294
std::string debug_level = "";
293295
if (level == ModeEnum::terse) {
294296
debug_level = "(t)";
@@ -316,23 +318,26 @@ static inline void debugPrintImpl(NodeType node, Arg&& arg, Args&&... args) {
316318

317319
template <CatEnum cat, ModeEnum mod>
318320
struct DebugPrintOp<cat, CtxEnum::node, mod> {
319-
template <typename Arg, typename... Args>
320-
void operator()(bool const rt_option, Arg&& arg, Args&&... args) {
321+
template <typename... Args>
322+
void operator()(
323+
bool const rt_option, fmt::format_string<Args...> arg, Args&&... args
324+
) {
321325
if (rt_option or vt::debug::preConfig()->vt_debug_all) {
322326
debugPrintImpl<cat, mod>(
323-
vt::debug::preNode(), std::forward<Arg>(arg),
324-
std::forward<Args>(args)...
327+
vt::debug::preNode(), arg, std::forward<Args>(args)...
325328
);
326329
}
327330
}
328331
};
329332

330333
template <CatEnum cat, ModeEnum mod>
331334
struct DebugPrintOp<cat, CtxEnum::unknown, mod> {
332-
template <typename Arg, typename... Args>
333-
void operator()(bool const rt_option, Arg&& arg, Args&&... args) {
335+
template <typename... Args>
336+
void operator()(
337+
bool const rt_option, fmt::format_string<Args...> arg, Args&&... args
338+
) {
334339
if (rt_option or vt::debug::preConfig()->vt_debug_all) {
335-
debugPrintImpl<cat,mod>(-1,std::forward<Arg>(arg),std::forward<Args>(args)...);
340+
debugPrintImpl<cat,mod>(-1, arg, std::forward<Args>(args)...);
336341
}
337342
}
338343
};
@@ -347,8 +352,10 @@ template <
347352
>
348353
struct DispatchOp {
349354
template <typename... Args>
350-
static void apply(bool const op, Args&&... args) {
351-
return Op<cat,ctx,mode>()(op,std::forward<Args>(args)...);
355+
static void apply(
356+
bool const op, fmt::format_string<Args...> arg, Args&&... args
357+
) {
358+
return Op<cat,ctx,mode>()(op,arg,std::forward<Args>(args)...);
352359
}
353360
};
354361

@@ -364,8 +371,10 @@ template <
364371
>
365372
struct CheckEnabled {
366373
template <typename... Args>
367-
static void apply(bool const, Args&&... args) {
368-
return vt::debug::useVars(std::forward<Args>(args)...);
374+
static void apply(
375+
bool const, fmt::format_string<Args...> arg, Args&&... args
376+
) {
377+
return vt::debug::useVars(arg,std::forward<Args>(args)...);
369378
}
370379
};
371380

@@ -384,8 +393,12 @@ struct CheckEnabled<
384393
>
385394
> {
386395
template <typename... Args>
387-
static void apply(bool const op, Args&&... args) {
388-
return DispatchOp<Op,C,cat,ctx,mod>::apply(op,std::forward<Args>(args)...);
396+
static void apply(
397+
bool const op, fmt::format_string<Args...> arg, Args&&... args
398+
) {
399+
return DispatchOp<Op,C,cat,ctx,mod>::apply(
400+
op, arg, std::forward<Args>(args)...
401+
);
389402
}
390403
};
391404

@@ -399,8 +412,12 @@ template <
399412
>
400413
struct ApplyOp {
401414
template <typename... Args>
402-
static void apply(bool const op, Args&&... args) {
403-
return CheckEnabled<Op,C,cat,ctx,mod>::apply(op,std::forward<Args>(args)...);
415+
static void apply(
416+
bool const op, fmt::format_string<Args...> arg, Args&&... args
417+
) {
418+
return CheckEnabled<Op,C,cat,ctx,mod>::apply(
419+
op, arg, std::forward<Args>(args)...
420+
);
404421
}
405422
};
406423

src/vt/messaging/active.impl.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,19 @@ ActiveMessenger::PendingSendType ActiveMessenger::sendMsgCopyableImpl(
165165
const bool is_bcast = dest == broadcast_dest;
166166

167167
if (!is_term || vt_check_enabled(print_term_msgs)) {
168-
vt_debug_print(
169-
verbose, active,
170-
is_bcast
171-
? "broadcastMsg of ptr={}, type={}\n"
172-
: "sendMsg of ptr={}, type={}\n",
173-
print_ptr(rawMsg), typeid(MsgT).name()
174-
);
168+
if (is_bcast) {
169+
vt_debug_print(
170+
verbose, active,
171+
"broadcastMsg of ptr={}, type={}\n",
172+
print_ptr(rawMsg), typeid(MsgT).name()
173+
);
174+
} else {
175+
vt_debug_print(
176+
verbose, active,
177+
"sendMsg of ptr={}, type={}\n",
178+
print_ptr(rawMsg), typeid(MsgT).name()
179+
);
180+
}
175181
}
176182

177183
if (is_bcast) {

src/vt/utils/memory/memory_usage.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ void MemoryUsage::initialize() {
371371
thePhase()->registerHookUnsynchronized(
372372
phase::PhaseHook::EndPostMigration, []{
373373
auto cur_phase = thePhase()->getCurrentPhase();
374-
auto memory_usage_str = fmt::format(
374+
vt_print(
375+
gen,
375376
"Memory Usage: phase={}: {}\n", cur_phase,
376377
theMemUsage()->getUsageAll()
377378
);
378-
vt_print(gen, memory_usage_str);
379379
}
380380
);
381381
}

0 commit comments

Comments
 (0)