-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actually tell why file read fails #51
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it I suppose also the other MPI_* calls like closing could be improved?
vlsv_reader_parallel.cpp
Outdated
parallelFileOpen = true; | ||
} else { | ||
success = false; | ||
cerr << "Failed to open parallel file with MPI error " << error << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now a number, or some string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an int. I suppose the proper way would be to have a function mapping error codes to descriptions of MPI errors but now it at least doesn't just gobble up the error code and spit out the non-answer of "there was an error".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that tracks, just needs a whopper to convert that from C-string to something sensible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't that be plonked to cerr? Or to a stringstreamstream and then that gets cerr'ed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the function signature, the actual string "returned" is an argument. So the conversion is sth like:
char c[MPI_MAX_ERROR_STRING];
int len;
MPI_Error_string(err, c, &len);
std::string s (s, len);
else parallelFileOpen = true; | ||
|
||
if (success == false) cerr << "Failed to open parallel file" << endl; | ||
int err {MPI_File_open(comm,const_cast<char*>(fileName.c_str()),accessMode,mpiInfo,&filePtr)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"While valid, this is stupid." :) Initializers do have their uses but let's be realistic, here it's just odd. (TBH is odd also on line 420 since it's just a single variable)
No description provided.