hiop icon indicating copy to clipboard operation
hiop copied to clipboard

Sparse Matrix Tests Refactoring

Open cameronrutherford opened this issue 4 years ago • 3 comments

In this PR:

  • Deleted any commented out/unused methods that I noticed in the sparse matrix tests. Includes tests moved to sym sparse matrix tests
  • Moved some methods to implementation-specific tests where appropriate
  • Refactored sparse test matrix test driver
  • Cleaned up exception handling in implementation-specific tests (including in vectorTests that were missed in #170)

Once #103 is resolved, this implementation-specific section in testMatrixSparse.cpp should probably be removed, along with a RAJA specific test implemented. A new issue can be created to track this if need be, or implementing this test can be part of closing out #103:

//
// Perform hipoMatrixSparseTriplet specific tests
//
//auto * test_triplet = dynamic_cast<tests::MatrixTestsSparseTriplet *>(&test);
if (dynamic_cast<tests::MatrixTestsSparseTriplet *>(&test))
{
  fail += test.copyRowsBlockFrom(*mxn_sparse, *m2xn_sparse,0, 1, M_global-1, mxn_sparse->numberOfNonzeros()-entries_per_row);
}

I will note that this dynamic cast in the template function will always throw a warning: warning: dynamic_cast of ‘hiop::tests::MatrixTestsRajaSparseTriplet test’ to ‘class hiop::tests::MatrixTestsSparseTriplet*’ can never succeed. It seems like an appropriate solution for the moment.

cameronrutherford avatar Dec 29 '20 22:12 cameronrutherford

@CameronRutherford Thanks! This looks much better and clearer.

nychiang avatar Dec 30 '20 05:12 nychiang

@pelesh : is this PR still under development or it only waits for you review?

cnpetra avatar Jan 30 '21 00:01 cnpetra

@pelesh : is this PR still under development or it only waits for you review?

Not quite ready to be merged yet.

pelesh avatar Jan 30 '21 00:01 pelesh