Skip to content
Snippets Groups Projects

Fix inconsistency in matrixmarket file IO

2 unresolved threads

Fixed an inconsistency in the non-MPI functions where the ".mm" file extension was not automatically added to the filename.

Edited by Lukas Renelt

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Lukas Renelt added 1 commit

    added 1 commit

    • 804c8c3d - Add missing matrixmarket IO error messages

    Compare with previous version

  • Lukas Renelt added 1 commit

    added 1 commit

    • efbc5c0c - Change ostringstream to simple string

    Compare with previous version

  • Lukas Renelt resolved all threads

    resolved all threads

    • Mmh, aren't you now assuming that users always pass the filename without the extensions (passing file.mm will yield file.mm.mm)? Shouldn't we allow passing files with extension, too?

    • Author Contributor

      Originally, I only wanted to make the behavior in the MPI and non-MPI case consistent, the MPI-variant always made that assumption. I changed this so that passing the filename with or without extension is now both allowed. Using ".mtx" is still not possible but I guess that is not too much of an issue.

    • Please register or sign in to reply
  • Lukas Renelt added 22 commits

    added 22 commits

    • efbc5c0c...c6188e75 - 18 commits from branch core:master
    • 6cf58fed - Add missing matrixmarket file extension
    • cdf42f77 - Change file extension for paamgtest
    • 209ec643 - Add missing matrixmarket IO error messages
    • 7a3c3f35 - Change ostringstream to simple string

    Compare with previous version

  • Lukas Renelt added 1 commit

    added 1 commit

    • fcf8a062 - Add .mm file extension only when necessary

    Compare with previous version

  • 1302 1329 void loadMatrixMarket(M& matrix,
    1303 1330 const std::string& filename)
    1304 1331 {
    1332 std::string rfilename = MatrixMarketImpl::sanitizeFilename(filename) + ".mm";
    • If I pass file.mtx we will try to load file.mm. Why do we need to do sanitize here? Shouldn't the user know better than us what the file is called?

    • void loadMatrixMarket(M& matrix, const std::string& filename) {

      • std::string rfilename = MatrixMarketImpl::sanitizeFilename(filename) + ".mm";

      If I pass file.mtx we will try to load file.mm. Why do we need to do sanitize here? Shouldn't the user know better than us what the file is called?

      If we want to support filenames with and without extension, I'd simply try to open the file for read and if it is not present, try with the extension added.

    • Lukas Renelt changed this line in version 7 of the diff

      changed this line in version 7 of the diff

    • Author Contributor

      I pushed a solution which allows both possibilities. If the user enters a filename ending in ".mm" or ".mtx", we use that (possibly with added rank identifier in the MPI functions), otherwise we try adding those two extensions. In the store function we only test ".mm", since there is no reason to store in "filename.mtx" when "filename.mm" fails - here we rather want to get the error directly.

    • Please register or sign in to reply
  • Lukas Renelt added 1 commit

    added 1 commit

    • 3c91a199 - Allow both .mm and .mtx file extensions

    Compare with previous version

  • Markus Blatt mentioned in commit 6d7713fb

    mentioned in commit 6d7713fb

  • merged

  • Thanks a lot for the change and your persistence. Highly appreciated.

  • Simon Praetorius mentioned in merge request !477 (merged)

    mentioned in merge request !477 (merged)

  • Please register or sign in to reply
    Loading