[Trilinos-Users] viewing a range of rows and cols of a Tpetra_MultiVector

Hoemmen, Mark mhoemme at sandia.gov
Tue Oct 22 19:24:15 MDT 2013

On Oct 22, 2013, at 12:00 PM, <trilinos-users-request at software.sandia.gov>
 <trilinos-users-request at software.sandia.gov> wrote:
> Date: Tue, 22 Oct 2013 07:57:59 +0000
> From: Jonas.Thies at dlr.de
> Subject: [Trilinos-Users] viewing a range of rows and cols of a
> 	Tpetra_MultiVector
> To: trilinos-users at software.sandia.gov
> Message-ID:
> 	<DC79F9D2C597AF428838F0B5DE2957CF0A31795C at dlrexmbx02.intra.dlr.de>
> Content-Type: text/plain; charset="iso-8859-1"
> what would be the correct way of viewing a "subblock" of a Tpetra_MultiVector,
> for instance V(2:8,3:5)? I can use the subView and offsetView consecutively, but
> I believe that it means I have to store the intermediate object (the subView) explicitly.
> Is there an easier way? I did a quick and dirty test of the above and got segfaults when
> trying to access the object later on, but that may be a bug on my behalf.

Hi Jonas,

The subView, offsetView sequence is the recommended way to accomplish your goal.  Both subView and offsetView should return a persisting view of the Tpetra::MultiVector.  "View" means "not a copy," and "persisting" means that if the original MultiVector goes away, the view will remind valid.  

The challenge might be how to call offsetView.  This method might not do what you think.  It really just reassigns global indices.  You might need to use the second argument to get a subset of _local_ rows.  When you write 2:8 as the rows in the subblock, are those local or global row indices?

Would you mind sharing how you called offsetView, in particular how you constructed the Map?  


More information about the Trilinos-Users mailing list