Skip to content

Commit

Permalink
Use mpi::gather for strings in mc_generic::collect_results
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoemi09 committed Oct 2, 2024
1 parent 6e0566a commit 1dad5c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions c++/triqs/mc_tools/mc_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ namespace triqs::mc_tools {
info += fmt::format("[Rank {}] Move statistics:\n{}", c.rank(), moves_.get_statistics(fmt::format("[Rank {}] ", c.rank())));

// gather all output string on rank 0 to print in order
auto all_infos_vec = mpi::gather(std::vector<char>{info.begin(), info.end()}, c);
auto all_infos = mpi::gather(info, c);
if (c.rank() == 0) {
std::string all_infos{all_infos_vec.begin(), all_infos_vec.end()};
report_(3) << all_infos;
std::string more_info{"\n"};
more_info += fmt::format("Total number of measures: {}\n", tot_nmeasures);
Expand Down

0 comments on commit 1dad5c5

Please sign in to comment.