Adds a way to control chunkspan print formating#1106
Adds a way to control chunkspan print formating#1106PaulGannay wants to merge 6 commits intoCExA-project:mainfrom
Conversation
|
CI reports:
|
| std::unique_ptr<char, decltype(std::free)*> const | ||
| demangled_name(abi::__cxa_demangle(mangled_name, nullptr, nullptr, &status), std::free); | ||
| if (status != 0) { | ||
| os << "Error demangling dimension name: " << status; | ||
| return; | ||
| } |
There was a problem hiding this comment.
This should maybe be changed to output th error to cerr?
And only print Unknown type to os?
There was a problem hiding this comment.
- I agree about outputing to cerr, I wonder how we can test that ? Should we pass a second
std::ostream? - What about printing the given mangled_name ?
There was a problem hiding this comment.
What about printing the given mangled_name ?
You are right, this is a better solution
I agree about outputing to cerr, I wonder how we can test that ? Should we pass a second std::ostream ?
I don't think we need to test the output to cerr, testing that we get the expected mangled type back should be enough?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1106 +/- ##
==========================================
- Coverage 94.90% 94.87% -0.03%
==========================================
Files 64 64
Lines 2844 2871 +27
Branches 893 909 +16
==========================================
+ Hits 2699 2724 +25
Misses 95 95
- Partials 50 52 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I agree, the grep applies to .cpp source files but I it seems too restrictive. Let me update that rule. |
tpadioleau
left a comment
There was a problem hiding this comment.
Overall good for me. What do you think of making getInstance a free function and making the constructor a public function ? That would allow to make ChunkPrinter independent of the singleton.
| std::unique_ptr<char, decltype(std::free)*> const | ||
| demangled_name(abi::__cxa_demangle(mangled_name, nullptr, nullptr, &status), std::free); | ||
| if (status != 0) { | ||
| os << "Error demangling dimension name: " << status; | ||
| return; | ||
| } |
There was a problem hiding this comment.
- I agree about outputing to cerr, I wonder how we can test that ? Should we pass a second
std::ostream? - What about printing the given mangled_name ?
src/ddc/print.cpp
Outdated
| { | ||
| // Ensure that m_edgeitems < (m_threshold / 2) stays true. | ||
| ddc::detail::ChunkPrinter& printer = ddc::detail::ChunkPrinter::getInstance(); | ||
| printer.m_global_lock.lock(); |
There was a problem hiding this comment.
If I remember correctly there is a RAII version of locking in the standard, could be useful in case an exception happens before unlock ?
src/ddc/print.hpp
Outdated
|
|
||
|
|
||
| ddc::detail::ChunkPrinter& printer = ddc::detail::ChunkPrinter::getInstance(); | ||
| printer.m_global_lock.lock(); |
There was a problem hiding this comment.
Should locking be hidden in the member functions ?
There was a problem hiding this comment.
It is better to lock in print_type_info to ensure that the metadata and the content of the chunkspan get printed together.
Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
Signed-off-by: Paul Gannay <paul.gannay@cea.fr>
Signed-off-by: Paul Gannay <paul.gannay@cea.fr>
1d7c026 to
1224d78
Compare
- full_print function to always print full array ignoring options - use struct to set the options in order to use designated initializers - use scoped_lock instead of lock_guard to follow linter recommendation Signed-off-by: Paul Gannay <paul.gannay@cea.fr>
Signed-off-by: Paul Gannay <paul.gannay@cea.fr>
Should solve: #1059