25#ifndef __PSTDOUT_HPP__
26#define __PSTDOUT_HPP__
52 std::string flush(
int root__)
56 std::vector<int> counts(comm_.
size());
57 int count = this->str().length();
61 for (
int i = 0; i < comm_.
rank(); i++) {
70 std::vector<char> outb(sz);
71 comm_.
allgather(this->str().c_str(), &outb[0], count, offset);
72 s.write(outb.data(), sz);
76 if (comm_.
rank() == root__) {
79 return std::string(
"");
MPI communicator wrapper.
void allgather(T *buffer__, int const *recvcounts__, int const *displs__) const
In-place MPI_Allgatherv.
int size() const
Size of the communicator (number of ranks).
void allreduce(T *buffer__, int count__) const
Perform the in-place (the output buffer is used as the input buffer) all-to-all reduction.
int rank() const
Rank of MPI process inside communicator.
Parallel standard output.
Contains declaration and implementation of mpi::Communicator class.
Namespace of the SIRIUS library.