Is it possible to create (from the shell/Bash or within a C++ program) an additional file descriptor like STDOUT/STDERR
? I.e. by default it should write all output to the terminal and mix both outputs, but if I wanted to I could redirect them selectively?
My use case is a MPI-parallel C++ program running in multiple-program-multiple-data (MPMD) mode, i.e. several unrelated functional entities are running simultaneously using different data sets. What I would like to achieve is that by default, all output gets send to the terminal, but that I would be able to redirect one or more of the output streams to e.g. a file.