Skip to content

Conversation

@rbourgeois33
Copy link

@rbourgeois33 rbourgeois33 commented Oct 21, 2025

This PR implements the same new example as this closed one, but is aligned with the new contribution policy, namely commits are signed, and the target branch is main.

Note 1: I set the C++ standard to 17 in the CMakeLists.txt for this example

Note 2: I have not followed the update of cuDSS since the time I first wrote the example. Some hard coded rules I implemented such as "algorithms 1 and 2 are only for non sym / non hermitian matrices" may no longer apply. I have not double checked yet

Summary of features, taken from the previous PR :

  • Added timers to the different parts of the resolution
  • Compute the final error (on host), taking into account the view type
  • implemented a easy to use command line input
Usage: ./binary <alg: 0|1|2|3> <mtype: general|symmetric|hermitian|spd|hpd> <mview: full|lower|upper> <matrix_filename> [vector_filename (optional)] 
For instance, to reproduce the simple example:
./binary 0 symmetric upper matrix.mtx rhs.mtx 
  • Use a vector filled with 1 if no rhs is given
  • Display a warnings if algs 1 or 2 are used with a mtype that is not general
  • Display a warning if the mview is not 'full' while mtype is 'general'
  • Throw a runtime error if the reader finds elements in the upper / lower part of the matrix and the mtype is lower / upper
  • Throw a runtime error if the reader does not find elements in both upper / lower parts of the matrix and the mview is full.
  • We accept unsorted entries, and will sort them with std::sort, as well as empty rows.
  • The reader does a small mock allocation if no file is found so that subsequent free operations don't fail.
  • Throws an error if nnz in the header is != to the # of elements in the mtx file
  • Throws an error is read i,j are out of bound i.e <0, or >= n
  • Display a warning for empty rows (maybe its a bit too much)
  • add a verbose mode for infos and errors

The whole thing can be unit tested as I did locally here, but I dont wan't to add tests to this Sample set repo.

Thanks again @kvoronin for figuring out the legal details. Let me know if I can do anything else from here. Happy to help.

Cheers

Signed-off-by: Remi Bourgeois <Remi.Bourgeois@cea.fr>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants