Add option to switch text output modes#101
Merged
Merged
Conversation
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.
Text Reduction Output Mode
Summary
Add a new
combinedoutput mode that deduplicates common lines across MPI ranks, reducing verbosity when debugging multi-rank programs where output is identical or largely overlapping.Example:
Before (separate mode):
After (combined mode):
Changes
Features
set output combined/separate— new command to switch between output modes:separate(default): each rank's output shown independently, separated by****dividerscombined: identical lines across ranks are merged and prefixed with collapsed rank ranges (e.g.0-3:)collapse_ranges()utility to convert lists of rank IDs into compact range notation (e.g.[0, 1, 2, 5, 6]→"0-2,5-6")reduce_response()function that groups identical lines across ranks and prints each unique line once with the contributing ranksDocumentation
docs/source/changing-output.rstcovering the output mode feature with side-by-side examplesdocs/source/index.rstTesting
test_collapse_ranges()with coverage for consecutive ranges, disjoint ranges, unsorted input, duplicates, gaps, and edge casestest_pretty_print_response()to verify default output formatanswer-gdb.stdout,answer-lldb.stdout) to reflect formatting changesOther
prepend_ranks()now uses" "instead of"\t"for rank prefix padding