[Trilinos-Users] Trilinos-Users Digest, Vol 96, Issue 1

Hoemmen, Mark mhoemme at sandia.gov
Fri Aug 2 12:25:29 MDT 2013


On Aug 2, 2013, at 12:00 PM, <trilinos-users-request at software.sandia.gov>
 wrote:
> Message: 1
> Date: Fri, 2 Aug 2013 17:20:20 +0200
> From: "Fan YE" <yefanhust at gmail.com>
> Subject: [Trilinos-Users] Teuchos FancyOStream
> To: "trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>
> Message-ID:
> 	<CANvyi3ERrGK4Teo1URY5AAPVPcq+p5nnjMTmjkgvX4cTH9iQ4A at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hello everyone,
> 
> I have a question about Tpetra::Map::describe and Teuchos::FancyOStream.
> 
> My intention is to recognize the details of distributed map of a
> Tpetra::CrsMatrix A.
> 
> I use this to get the information:
> 
> A->getRowMap()->describe(*out, Teuchos::VERB_EXTREME);
> 
> here out correspond to:
> 
> RCP<FancyOStream> out = VerboseObjectBase::getDefaultOStream();
> 
> In this way, I could only get access to the part of map owned by the
> process whose rank is 0.
> 
> What I really want is the whole map.
> 
> I'm not familiar with the Teuchos::FancyOStream. However, the first
> argument of describe() method is required to be "Teuchos::FancyOStream&
> out".
> 
> Thank you for your comments.
> 
> Best regards,
> Fan

It could be possible that when you first created the FancyOStream, the object was set to the "null" output stream on all processes other than Proc 0.  Thus, the Map would be writing to the output stream on all processes, but the output stream itself would be ignoring it.  Some of the Teuchos classes that create a FancyOStream for you like to set it to a "null" output stream on all processes other than Proc 0.

To test whether this is the case, you could try creating the FancyOStream yourself, using std::cout or std::cerr:

using Teuchos::getFancyOStream;
using Teuchos::FancyOStream;
using Teuchos::RCP;
using Teuchos::rcpFromRef;

RCP<FancyOStream> out = getFancyOStream (rcpFromRef (std::cout));
A->getRowMap ()->describe (*out, Teuchos::VERB_EXTREME);

If this doesn't work, please let me know and I will work with you to see what is going on. 

Thanks!
mfh


More information about the Trilinos-Users mailing list