-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into gaudel/feature/tot_…
…inner_tensor_ops
- Loading branch information
Showing
14 changed files
with
673 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
diff --git a/src/umpire/util/io.cpp b/src/umpire/util/io.cpp | ||
index 806fb9e3..551c5e82 100644 | ||
--- a/src/umpire/util/io.cpp | ||
+++ b/src/umpire/util/io.cpp | ||
@@ -52,10 +52,23 @@ std::ostream& error() | ||
|
||
namespace util { | ||
|
||
+namespace detail { | ||
+OutputBuffer& s_log_buffer_accessor() | ||
+{ | ||
+ static OutputBuffer buffer; | ||
+ return buffer; | ||
+} | ||
+OutputBuffer& s_error_buffer_accessor() | ||
+{ | ||
+ static OutputBuffer buffer; | ||
+ return buffer; | ||
+} | ||
+} | ||
+ | ||
void initialize_io(const bool enable_log) | ||
{ | ||
- static util::OutputBuffer s_log_buffer; | ||
- static util::OutputBuffer s_error_buffer; | ||
+ OutputBuffer& s_log_buffer = detail::s_log_buffer_accessor(); | ||
+ OutputBuffer& s_error_buffer = detail::s_error_buffer_accessor(); | ||
|
||
s_log_buffer.setConsoleStream(nullptr); | ||
s_error_buffer.setConsoleStream(&std::cerr); | ||
@@ -121,6 +134,16 @@ void initialize_io(const bool enable_log) | ||
MPI::logMpiInfo(); | ||
} | ||
|
||
+void finalize_io() | ||
+{ | ||
+ detail::s_log_buffer_accessor().sync(); | ||
+ detail::s_log_buffer_accessor().setConsoleStream(nullptr); | ||
+ detail::s_log_buffer_accessor().setFileStream(nullptr); | ||
+ detail::s_error_buffer_accessor().sync(); | ||
+ detail::s_error_buffer_accessor().setConsoleStream(nullptr); | ||
+ detail::s_error_buffer_accessor().setFileStream(nullptr); | ||
+} | ||
+ | ||
void flush_files() | ||
{ | ||
log().flush(); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.