Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions external/umpire.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ else()
DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR}
GIT_REPOSITORY ${UMPIRE_URL}
GIT_TAG ${UMPIRE_TAG}
#--Patch step-----------------
PATCH_COMMAND patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/external/umpire.finalize_io.patch
#--Configure step-------------
SOURCE_DIR ${EXTERNAL_SOURCE_DIR}
LIST_SEPARATOR ::
Expand Down
47 changes: 47 additions & 0 deletions external/umpire.finalize_io.patch
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();
4 changes: 2 additions & 2 deletions src/TiledArray/dist_eval/array_eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class ArrayEvalImpl
Future<value_type> result;
bool task_created = false;
if (arg_tile_is_remote) {
TA_ASSERT(arg_tile_owner != this->world().rank());
TA_ASSERT(arg_tile_owner != array_.world().rank());
#ifdef TILEDARRAY_ENABLE_GLOBAL_COMM_STATS_TRACE
ntiles_pending_[arg_tile_owner]++;
#endif
Expand All @@ -355,7 +355,7 @@ class ArrayEvalImpl
#endif
);
} else {
TA_ASSERT(arg_tile_owner == this->world().rank());
TA_ASSERT(arg_tile_owner == array_.world().rank());
std::tie(result, task_created) = eval_tile(array_.find_local(array_index),
/* consumable_tile = */ false
#ifdef TILEDARRAY_ENABLE_GLOBAL_COMM_STATS_TRACE
Expand Down