Fix the frequently-failing trilinos/solver_control_06 test.
The main problem here is
// Trilinos dumps the output into std::cout
// We catch this output and it is written to the stdout logfile
// Since we're interested in this output we read it back in and
// write parts of it to the logstream
// We can only do this reliably if we are not running in parallel (sometimes
// stdout is not written yet otherwise)
if (Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1)
{
std::ifstream inputfile;
inputfile.open("stdout");
Assert(inputfile.good() && inputfile.is_open(), ExcIO());
std::string line;
const std::string key = "*****";
while (std::getline(inputfile, line))
{
if (line.find(key) != std::string::npos)
deallog << line << std::endl;
}
inputfile.close();
}
deallog << "OK" << std::endl;
which falsely assumes that, at the point we hit that check, all buffered
output has been written. In general we cannot guarantee this until the
end of the program since we are actively, during program execution,
piping stdout and sterr to output files.
We don't really need to check this output (Trilinos' residuals) anyway -
we already know, if the solver converges, that we got close enough.
Hence, this patch replaces all of this with our standard
check_solver_within_range() macro which is vastly more robust.
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams