Tpetra::CrsGraph: Fuse column Map and Import construction
Created by: mhoemmen
@trilinos/tpetra Tpetra::CrsGraph constructs its column Map, if it doesn't already have one, in makeColMap(). This method needs information that could be reused to build the Import more efficiently, but CrsGraph currently throws away this information. Here is a comment from the inside of makeColMap() that explains:
// FIXME (mfh 03 Apr 2013) Now would be a good time to use the
// information we collected above to construct the Import. In
// particular, building an Import requires:
//
// 1. numSameIDs (length of initial contiguous sequence of GIDs
// on this process that are the same in both Maps; this
// equals the number of domain Map elements on this process)
//
// 2. permuteToLIDs and permuteFromLIDs (both empty in this
// case, since there's no permutation going on; the column
// Map starts with the domain Map's GIDs, and immediately
// after them come the remote GIDs)
//
// 3. remoteGIDs (exactly those GIDs that we found out above
// were not in the domain Map) and remoteLIDs (which we could
// have gotten above by using the three-argument version of
// getRemoteIndexList() that computes local indices as well
// as process ranks, instead of the two-argument version that
// was used above)
//
// 4. remotePIDs (which we have from the getRemoteIndexList()
// call above)
//
// 5. Sorting remotePIDs, and applying that permutation to
// remoteGIDs and remoteLIDs (by calling sort3 above instead
// of sort2)
//
// 6. Everything after the sort3 call in Import::setupExport():
// a. Create the Distributor via createFromRecvs(), which
// computes exportGIDs and exportPIDs
// b. Compute exportLIDs from exportGIDs (by asking the
// source Map, in this case the domain Map, to convert
// global to local)
//
// Steps 1-5 come for free, since we must do that work anyway in
// order to compute the column Map. In particular, Step 3 is
// even more expensive than Step 6a, since it involves both
// creating and using a new Distributor object.