Skip to content

Zoltan2: Xpetra CrsMatrix Adapter: reduce memory footprint

Created by: krcb

@kddevin @trilinos/zoltan2 The proposed changes in this PR use the Xpetra CRS matrix getAllValues method to obtain pointers to row, columns and values. This removes the need to perform a deep copy of the values from the matrix and reduces the memory footprint of the adapter. In addition, the column id's and offsets are obtained directly from this call; reducing some computation (but see below). Tests run locally with clang pass.

There are a couple of considerations that could further reduce the footprint beyond what is done here:

  1. Offsets can be obtained directly from the row pointer; however the offset in the Zoltan2 adapter is type def'd to lno_t, rather than size_t (provided by the getAllValues method). We would need to refactor the adapter to use the different type in order to avoid a copy of the data in the row pointer.

  2. Local column id's are provided by getAllValues; the adapter utilizes global column ids'. Again, we would need to refactor the adapter to use the pointer provided by the Xpetra Crs matrix.

Merge request reports