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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/553dbdd9-d8ca-4ea4-8393-79a11302e053n%40googlegroups.com.

Reply via email to