-
Notifications
You must be signed in to change notification settings - Fork 933
Fixed -Werror=unused-result warnings in comm_cid.c by adding error checking #2457
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
Conversation
|
@hjelmn please review |
jsquyres
left a comment
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.
@OMGtechy Thank you for the submission!
I have a few minor comments on the code. Also, if you don't want to put your email address on your signed off line, you can probably just use (@OMGtechy) (the @ should indicate that it's a Github ID).
ompi/communicator/comm_cid.c
Outdated
| opal_pmix_pdata_t pdat; | ||
| opal_buffer_t sbuf; | ||
| int rc; | ||
| int bytesWritten; |
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.
Minor nit: we don't typically use camelCase in Open MPI; we typically use multiple_words. This is pretty trivial -- we would not reject a patch just for this reason, though -- I mention it just for "style fit" reasons.
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.
Fixed in 7fda6fe
ompi/communicator/comm_cid.c
Outdated
| fprintf (stderr, "port string: %s\n", cid_context->port_string); | ||
| fprintf (stderr, "pmix tag: %s\n", cid_context->pmix_tag); | ||
| fprintf (stderr, "iter: %d\n", cid_context->iter); | ||
| return OMPI_ERR_FATAL; |
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.
You can probably return OMPI_ERR_OUT_OF_RESOURCE here; it should be treated as a fatal error by the caller.
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.
Fixed in df356ad
ompi/communicator/comm_cid.c
Outdated
| cid_context->iter); | ||
|
|
||
| if (bytesWritten == -1) { | ||
| fprintf (stderr, "writing info.key failed\n"); |
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.
We don't typically fprintf() from deep within the library. Instead, we typically use opal_output() if something needs to unconditionally be written to stderr (because it will prefix the output with a label indicating the process it came from). For errors like this, however, we typically will use opal_output_verbose(), which lets the error only be displayed conditionally (i.e., if the user has selected a high enough verbose value at run time), or just let the caller decide whether to display the error or not.
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.
Thank you! I used fprintf because other bits of code around here used it (fprintf (stderr, "pack failed. rc %d\n", rc); for example). Would it be worth me fixing that in another pull request, or is there a specific reason in that case?
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.
We used fprintf elsewhere in here? Oh, how embarrassing... 😳
Yes, if you could have a 2nd commit on this PR that fixes all the other fprintfs, that would be great. Thanks!
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.
Fixed in 8c7da1a
|
bot:ibm:retest |
OMGtechy
left a comment
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.
I believe I've fixed all review comments now :)
|
Please squish. |
|
Sweet; thanks! One last request: can you squash down to just two commits?
That way, we don't have a commit followed by multiple followup commits to fix the elements identified in the review. |
…ecking Signed-off-by: Joshua Gerrard <enquiries@joshuagerrard.com>
|
Works for me; thanks. Will merge when CI finishes. |
This is my first commit (and therefore pull request), so please let me know if I've not followed any of your conventions.
This pull request does the following: