Skip to content

Commit 7a0e878

Browse files
Update begrun.cpp
1 parent 25cb9fe commit 7a0e878

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/begrun.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ int main(int argc, char **argv) {
4545
MPI_Init(&argc, &argv);
4646
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
4747
MPI_Comm_size(MPI_COMM_WORLD, &size);
48+
49+
// Silence stdout/stderr for all ranks except 0
50+
if (rank != 0) {
51+
fclose(stdout);
52+
}
53+
4854
#endif
4955

5056
H5Eset_auto(H5E_DEFAULT, nullptr, nullptr);

0 commit comments

Comments
 (0)