Hi everyone,
I am looking to replicate the functionality of a ConditionalOstream in one of my subroutines. In my main file, I use the stream "pcout" based on Step-17. However, pcout is not passed in to my subroutine.
I have tried to guard my code using something like:
if (dealii::Utilities::MPI::this_mpi_process == 0)
std::cout << "Text" << std::endl;
This is the approach that is used in the ConditionalOstream pcout. However, the text never actually prints, and instead I'm given a warning when I compile:
warning: the address of ‘unsigned int dealii::Utilities::MPI::this_mpi_process(MPI_Comm)’ will never be NULL [-Waddress]
I'm unclear why the mpi_process will never be NULL; it works fine in the rest of my code, just not in an external file.
Can you think of an effective way to print for only one process that won't cause this warning?
Best regards,
Alex