feat: print MPI - wrapper fmt and explicit control of redirection#388
Open
sbstndb wants to merge 40 commits intohpc-maths:mainfrom
Open
feat: print MPI - wrapper fmt and explicit control of redirection#388sbstndb wants to merge 40 commits intohpc-maths:mainfrom
sbstndb wants to merge 40 commits intohpc-maths:mainfrom
Conversation
- Now all print use fmt instead of std::cout.
…tended eprint changes and stray includes in FV headers (part 1)
…xplicit flux-based schemes
…des in explicit flux-based schemes" This reverts commit c5e8ef4.
…ert unintended eprint changes and stray includes in FV headers (part 1)" This reverts commit 4fbdc57.
… keep std::cerr and timers.hpp unchanged
…nclude/ (excluding timers.hpp); add includes and fmt::streamed where needed
…> includes where print.hpp is already included
…M tests, highorder, set_operator, p4est simple_2d, WENO examples, bubble_2d; add includes
…rint.hpp>; fix prediction_map to_stream; run clang-format
…::print; include <samurai/print.hpp>
…here xtensor objects are printed
…or paths to prevent unformattable type errors in fmt; print placeholder instead
…d; include <xtensor/xio.hpp>; wrap xtensor prints in burgers_os.cpp
…hpp to fix compile error
…:print across repo (excluding timers.hpp)
…i::io::print/eprint (excluding timers.hpp)
…rint for root/rank by MPI
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ranks != 0, no morerdbuf(/dev/null). Ref:include/samurai/samurai.hpp:70samurai::io::{print,eprint}with scopesroot,all,rank(n)to control where to print. Ref:include/samurai/print.hpp:1--print-root-onlyflag to restore historical behavior (default printing only on rank 0). Ref:include/samurai/arguments.hpp:28--dont-redirect-outputflag (removed) and flips the default semantics.std::cout/std::cerrwithsamurai::io::{print,eprint}, or run with--print-root-onlyto get “root-only” mode. Ref:include/samurai/samurai.hpp:100Printing examples:
--print-root-only):samurai::io::print("Hi {}\n", name);stderr:samurai::io::eprint(samurai::io::root, "Error: {}\n", msg);stderr:samurai::io::eprint(samurai::io::rank(1), "Only rank 1\n");samurai::io::print(samurai::io::all, "{}\n", fmt::streamed(obj));Note: I am proposing this PR because it seems useful for users, but I am open to discussion (use of
fmtvsstd, defaults, naming, etc.).Available tags: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'
Related issue
Global output redirection was unsafe: it overrode all
std::coutwithout user control.Code of Conduct
By submitting this PR, you agree to follow our Code of Conduct