Redirecting libmesh and PETSc stdout/stderr #3040
-
Hi, I am having trouble redirecting libmesh and PETSc stdout/stderr. I tried this kind of construction: But KSP messages from PETSc (from -ksp_monitor) are not forwarded. Any idea? Shouldn't petsc messages be forwarded to libMesh::out and ::err? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To redirect libmesh output, you should pass |
Beta Was this translation helpful? Give feedback.
-
As a solution, one may consider a mini-wrapper script where shell redirection " > " to a certain file is performed. If one wants this filename, or these filenames, to match with the libmesh ones, Basically, it is a bit of "externalization" from the program out to a script, but perhaps redirection in the end Giorgio |
Beta Was this translation helpful? Give feedback.
To redirect libmesh output, you should pass
--keep-cout --redirect-output
on the command line. This will write all output to files called "log.processor.N" by default, where N is the processor rank. Regarding PETSc output, I don't believe this will be affected by our redirecting ofstd::cout
because their print statements are (at some level) based around using Cprintf
statements.