[Trilinos-Users] Epetra_Map

Heroux, Mike MHeroux at csbsju.edu
Fri Dec 6 23:25:03 MST 2013


As you pointed out, Epetra_Map "isa" Epetra_BlockMap, with a block size of 1.  If you are only using a block size of 1, then you should just use Epetra_Map.  Doing this should make your code much simpler.  So when you are working with Epetra_CrsGraph, just use an Epetra_Map.

In general Epetra_Map (and Epetra_BlockMap, and similar classes in Tpetra and soon Kokkos) encodes a description of the dimensions and distribution of data objects.  By encoding this information into a separate class, we can create many data objects using the same map and know that they are compatible by construction.  We can also use maps to create redistributions of data objects, and a few other things.

In straightforward use cases, the map may seem like unnecessary overhead, but even in these cases, the maps are being used by underlying functionality to improve correct and efficient behavior.

Epetra_CrsGraph uses Epetra_BlockMap because it serves as the graph class for both Epetra_Map and Epetra_BlockMap based object.  For example, Epetra_CrsMatrix and Epetra_VbrMatrix both use Epetra_CrsGraph.

I hope this helps.


On Dec 7, 2013, at 1:20 AM, "Bertagna, Luca" <lbertag at emory.edu<mailto:lbertag at emory.edu>> wrote:


I've been using the epetra package for a while, but I still don't understand what's the point of Epetra_Map. I understand it's a map where the element size is equal to 1, but I don't get why Epetra_CrsMatrix uses it when Epetra_CrsGraph does not. Calling the method FillComplete in CrsMatrix is always a pain, cause I need to cast the BlockMap of the graph into a Map. I guess my question is, if the underlying graph does not use Epetra_Map but uses Epetra_BlockMap instead, why can't Epetra_CrsMatrix just use Epetra_BlockMap as well?


Luca Bertagna
Math&CS, Emory University, Atlanta
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.gov>

More information about the Trilinos-Users mailing list