Skip to content

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

Merged
merged 1 commit into from
Aug 4, 2022
Merged

Conversation

hppritcha
Copy link
Member

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

@tschuett
Copy link

Do you need to duplicate the code or is there a place for shared OFI utilities?

@hppritcha
Copy link
Member Author

@tschuett good point. I'll refactor into ofi common.

@hppritcha hppritcha force-pushed the remove_fi_name_max branch 2 times, most recently from 8f95d28 to 53b6bd4 Compare August 1, 2022 21:16
@hppritcha
Copy link
Member Author

@wckzhang could you review this PR when you have a chance?

/**
* Obtain EP endpoint name
*
* This function obtained the EP endpoint name and length for the
Copy link

@tschuett tschuett Aug 2, 2022

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.

@hppritcha hppritcha force-pushed the remove_fi_name_max branch from 53b6bd4 to 664e015 Compare August 4, 2022 16:14
@@ -663,6 +663,10 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
}
free(module);

if (ep_name) {
Copy link
Contributor

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)

Copy link
Member Author

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>
@hppritcha hppritcha force-pushed the remove_fi_name_max branch from 664e015 to 1a00a89 Compare August 4, 2022 17:09
@wckzhang
Copy link
Contributor

wckzhang commented Aug 4, 2022

I'm going to pull down this patch and test it with EFA

@hppritcha
Copy link
Member Author

that would be great! thanks for testing.

@wckzhang
Copy link
Contributor

wckzhang commented Aug 4, 2022

Seems to work as expected, gets the length and successfully runs with EFA.

@hppritcha hppritcha merged commit de26485 into open-mpi:main Aug 4, 2022
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.

3 participants