Fix inconsistency in matrixmarket file IO
Fixed an inconsistency in the non-MPI functions where the ".mm" file extension was not automatically added to the filename.
Merge request reports
Activity
- Resolved by Lukas Renelt
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.
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
Toggle commit list-
efbc5c0c...c6188e75 - 18 commits from branch
1302 1329 void loadMatrixMarket(M& matrix, 1303 1330 const std::string& filename) 1304 1331 { 1332 std::string rfilename = MatrixMarketImpl::sanitizeFilename(filename) + ".mm"; 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.
changed this line in version 7 of the diff
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.
mentioned in commit 6d7713fb
mentioned in merge request !477 (merged)