From: Wolfgang Bangerth Date: Thu, 8 Mar 2018 14:41:43 +0000 (-0700) Subject: Better document a piece of code. X-Git-Tag: v9.0.0-rc1~354^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6689af7c9a65cdfcd6b7d41fefccba5293aafb0c;p=dealii.git Better document a piece of code. --- diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 08c2c8e89b..859a952b9a 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -378,13 +378,18 @@ namespace PETScWrappers else out.setf (std::ios::fixed, std::ios::floatfield); + // let each processor produce its output in turn. this requires + // synchronizing output between processors using a barrier -- + // which is clearly slow, but nobody is going to print a whole + // matrix this way on a regular basis for production runs, so + // the slowness of the barrier doesn't matter for ( unsigned int i = 0; i < Utilities::MPI::n_mpi_processes(communicator); i++) { - // This is slow, but most likely only used to debug. const int mpi_ierr = MPI_Barrier(communicator); AssertThrowMPI(mpi_ierr); + if (i == Utilities::MPI::this_mpi_process(communicator)) { if (across)