Tpetra: Make it possible to Import/Export a RowGraph into a CrsGraph
Created by: mhoemmen
@kddevin writes:
I would like to redistribute a Tpetra::RowGraph into a new Tpetra::CrsGraph.
To distribute a Tpetra::RowMatrix into a new Tpetra::CrsMatrix, we can use CrsMatrix::doImport, as both CrsMatrix and RowMatrix are SrcDistObject and, thus, the RowMatrix source can be the first argument of CrsMatrix::doImport.
But for RowGraph, we cannot use CrsGraph::doImport, as RowGraph is not a SrcDistObject, even though CrsGraph, RowMatrix, and CrsMatrix are all SrcDistObject.
Why isn't RowGraph a SrcDistObject? Is there a better way to do the redistribution?
CrsGraph's implementation of DistObject methods (in particular, checkSizes, copyAndPermute, and packAndPrepare) all use the RowGraph interface. Furthermore, RowGraph implements Packable. Thus, all we need to do is make RowGraph inherit from SrcDistObject.
This is TRIVIAL since SrcDistObject implements no methods other than a virtual destructor. Would you like to do it?