bkochuna / ners570f24-SpMV

3 stars 0 forks source link

Add construction/destrucoin tests for the JDS matrix class #11

Open KyleVaughn opened 1 month ago

KyleVaughn commented 1 month ago

Description:

Develop unit tests to validate the construction and destruction processes of the Jagged Diagonal Storage (JDS) matrix class. The JDS format is an efficient method for representing sparse matrices that allows easy access to rows with different lengths. Ensuring the robustness of the JDS matrix class’s lifecycle is crucial for reliable library performance.

Tasks:

• Investigate the current implementation of the JDS matrix class. • Define the edge cases and common scenarios to be tested during construction and destruction. • Determine the resources and dependencies required for testing. • Write unit tests for various construction scenarios (empty matrix, typical sparse matrix, very large matrices). • Write unit tests to verify the proper destruction and memory cleanup. • Document the test cases and include them in the project’s testing guidelines.

Definition of done:

In order to consider this issue as completed, the following points should be successfully checked in addition to completeness of all tasks. 1- Unit tests for the construction and destruction of the JDS matrix class are written and integrated. 2- All tests pass successfully, ensuring correct lifecycle management. 3- Documentation is updated, detailing the tests, their purpose, and the results. 4- Peer code review completed with all raised issues addressed.

jsayut1 commented 1 month ago

I am reviewing this

amirnzm commented 1 month ago

@jsayut1 Ready to review!

jsayut1 commented 1 month ago

Thanks @amirnzm ! I have lots of research meetings tomorrow, so I plan to review this tomorrow afternoon. What branch should I look in for your code? Have you tried running the test? I'll check it out soon!

jsayut1 commented 1 month ago

Looks like it's coming together @amirnzm ! I examined the commit to branch JDS-constructor-tests with the message "Resolving issues with Constructor tests". I see the test you have written in jds_constructor_test.cpp.

I think there's one thing to note - you will need to add a line to CMakeLists.txt to actually make the test executable at build time. You can see the example in the current CMakeLists within the tests directory, or you can also check out the example in the main branch. Once you do that, and the executable runs (not passes), you're good to go!

xianyu2023umich commented 1 month ago

@amirnzm Hey I'm testing the JDS matvec and it uses the constructor. It seems to be lots of inputs for the constructor -- do I have to provide perm jds_col_ptr jds_values jd_ptr by myself? I believe these are done by the assemblestorage and I only know nrows and ncols at the beginning.

amirnzm commented 1 month ago

Looks like it's coming together @amirnzm ! I examined the commit to branch JDS-constructor-tests with the message "Resolving issues with Constructor tests". I see the test you have written in jds_constructor_test.cpp.

I think there's one thing to note - you will need to add a line to CMakeLists.txt to actually make the test executable at build time. You can see the example in the current CMakeLists within the tests directory, or you can also check out the example in the main branch. Once you do that, and the executable runs (not passes), you're good to go!

Resolved the issue.