[Trilinos-Users] Question on Epetra_Vector::Export()

Heroux, Michael A maherou at sandia.gov
Wed Jun 9 21:47:38 MDT 2010


Dave,

The CombineMode parameter, which you set to Add in your code, specifies how multiple contributions in the [a|b]Overlap vector will be handled when merged into solverXDot.  For example if secondaryEntryOverlapMap had a GID of 0 on both PE 0 and PE 1, and GID 0 were presented on PE 2 in threeDimensionalTwoEntryMap, the Export operation would add the contributions of PE 0 and PE 1 when sending them to PE 2.

By definition, the Export method will replace the contents of solverXDot with values from the [a|b]Overlap vector.  The only way to get the results summed as you want them is to add aOverlap and bOverlap, then do a single Export (which would be cheaper), or do your second Export into a second solverXDot vector and add the results.

BTW, although it is fine for aOverlap, bOverlap and solverXDot to be MultiVectors, it is generally more efficient to declare them as Vectors.  No big deal, but I thought I would mention it.  For example:

Teuchos::RCP<const Epetra_Vector> aOverlap = Teuchos::rcp(new Epetra_Vector(*secondaryEntryOverlapMap));

I hope this is helpful.

Mike

On 6/9/10 6:14 PM, "Littlewood, David John" <djlittl at sandia.gov> wrote:

Greetings,

I want to do two consecutive export operations like so:

[omitting the code where I construct the maps for brevity]

Teuchos::RCP<const Epetra_MultiVector> aOverlap = Teuchos::rcp(new Epetra_Vector(*secondaryEntryOverlapMap));
Teuchos::RCP<const Epetra_MultiVector> bOverlap = Teuchos::rcp(new Epetra_Vector(*secondaryEntryOverlapMap));
Teuchos::RCP<const Epetra_MultiVector> solverXDot = Teuchos::rcp(new Epetra_Vector(*threeDimensionalTwoEntryMap));
Teuchos::RCP<Epetra_Import> secondEntryImporter = Teuchos::rcp(new Epetra_Import(*secondaryEntryOverlapMap, *threeDimensionalTwoEntryMap));
solverXDot.Export(aOverlap, secondEntryImporter, Add);
solverXDot.Export(bOverlap, secondEntryImporter, Add);

And what I’d like is for the result in solverXDot to be the sum of the contributions from aOverlap and bOverlap.  But it appears that the Export operation is first zeroing out the destination vector, such that the second Export overwrites what was put in solverXDot by the first Export.

Am I right on this, and is there anyway to avoid this behavior?

Thanks,
Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20100609/fa5770fc/attachment.html 


More information about the Trilinos-Users mailing list