Skip to content

Conversation

@OMGtechy
Copy link
Contributor

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:

  • Fixes -Werror=unused-result warnings in comm_cid.c
  • Adds error checking for when asprintf fails

@hppritcha
Copy link
Member

@hjelmn please review

Copy link
Member

@jsquyres jsquyres left a 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).

opal_pmix_pdata_t pdat;
opal_buffer_t sbuf;
int rc;
int bytesWritten;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 7fda6fe

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;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in df356ad

cid_context->iter);

if (bytesWritten == -1) {
fprintf (stderr, "writing info.key failed\n");
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8c7da1a

@jjhursey
Copy link
Member

bot:ibm:retest
(I'm trying to bring the IBM CI back online)

Copy link
Contributor Author

@OMGtechy OMGtechy left a 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 :)

@hjelmn
Copy link
Member

hjelmn commented Nov 29, 2016

Please squish.

@jsquyres
Copy link
Member

Sweet; thanks!

One last request: can you squash down to just two commits?

  • replace fprintf calls with opal_output_verbose
  • everything else

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>
@OMGtechy
Copy link
Contributor Author

OMGtechy commented Nov 29, 2016

@jsquyres I have squashed it all into one commit as it was easier, and semantically speaking these are all one change. Let me know if that's a problem :)

@hjelmn Done!

@jsquyres
Copy link
Member

Works for me; thanks. Will merge when CI finishes.

@jsquyres jsquyres merged commit 756d09f into open-mpi:master Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants