-
Notifications
You must be signed in to change notification settings - Fork 911
OFI: call fi_getname twice #10620
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
OFI: call fi_getname twice #10620
Conversation
Do you need to duplicate the code or is there a place for shared OFI utilities? |
@tschuett good point. I'll refactor into ofi common. |
8f95d28
to
53b6bd4
Compare
@wckzhang could you review this PR when you have a chance? |
opal/mca/common/ofi/common_ofi.c
Outdated
/** | ||
* Obtain EP endpoint name | ||
* | ||
* This function obtained the EP endpoint name and length for the |
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.
It is not good style to start comments with the function name or this function. The obtained makes me wonder whether I should call the function all. It seems to be finished already. I would prefer obtains.
53b6bd4
to
664e015
Compare
opal/mca/btl/ofi/btl_ofi_component.c
Outdated
@@ -663,6 +663,10 @@ static int mca_btl_ofi_init_device(struct fi_info *info) | |||
} | |||
free(module); | |||
|
|||
if (ep_name) { |
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 you make the format consistent ie.
if (NULL != ep_name)
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.
done
first to get the length of the buffer needed for the endpoint name, then a second time with the properly sized buffer to receive the endpoint name. The FI_NAME_MAX enum was not supposed to have been exposed to libfabric consumers. See ofiwg/libfabric#7898. Related to open-mpi#10617 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
664e015
to
1a00a89
Compare
I'm going to pull down this patch and test it with EFA |
that would be great! thanks for testing. |
Seems to work as expected, gets the length and successfully runs with EFA. |
first to get the length of the buffer needed for the endpoint name,
then a second time with the properly sized buffer to receive the
endpoint name.
The FI_NAME_MAX enum was not supposed to have been exposed to libfabric consumers.
See ofiwg/libfabric#7898.
Related to #10617
Signed-off-by: Howard Pritchard howardp@lanl.gov