pmix / pmix-standard

PMIx Standard Document
https://pmix.org
Other
22 stars 22 forks source link

Add value and info APIs #492

Closed raffenet closed 3 months ago

raffenet commented 10 months ago

Add two APIs for estimating the size of value and info objects.

Add two info list APIs.

See openpmix/openpmix#2896. Fixes #455.

raffenet commented 9 months ago

Please use emoji reactions ON THIS COMMENT to indicate your position on this proposal.

You do not need to vote on every proposal
If you have no opinion, don't vote - that is also useful data
If you've already commented on this issue, please still vote so
we know your current thoughts
Not all proposals solve exactly the same problem, so we may end
up accepting proposals that appear to have some overlap
This is not a binding majority-rule vote, but it will be a very
significant input into the corresponding ASC decision.

Here are the meanings for the emojis:

Hooray or Rocket: I support this so strongly that I
want to be an advocate for it
Heart: I think this is an ideal solution
Thumbs up: I'd be happy with this solution
Confused: I'd rather we not do this, but I can tolerate it
Thumbs down: I'd be actively unhappy, and may even consider
other technologies instead
If you want to explain in more detail, feel free to add another
comment, but please also vote on this comment.
rhc54 commented 8 months ago

I believe you asked me to provide a code example for the info list - here is a typical usage:

void *head;
pmix_status_t rc;
pmix_data_array_t darray;
pmix_info_t *info;
size_t ninfo;

// initialize the list
head = PMIx_Info_list_start();

// add something to the end of the list
rc = PMIx_Info_list_add(head, PMIX_CONNECT_TO_SYSTEM, NULL, PMIX_BOOL);
if (PMIX_SUCCESS != rc) {
    PMIx_Info_list_release(head);
    return rc;
}

// prepend something to the list
rc = PMIx_Info_list_prepend(head, PMIX_TCP_REPORT_URI, "filename", PMIX_STRING);
if (PMIX_SUCCESS != rc) {
    PMIx_Info_list_release(head);
    return rc;
}

// convert the list to an array of info
rc = PMIx_Info_list_convert(head, &darray);
if (PMIX_SUCCESS != rc) {
    PMIx_Info_list_release(head);
    return rc;
}

// cleanup the list
PMIx_Info_list_release(head);

// define pointer to the array of info for use
info = (pmix_info_t*)darray.array;
ninfo = darray.size;

Doesn't cover all the APIs - but is this sufficient? I could expand to cover more APIs, but this really is the most common usage.

jjhursey commented 8 months ago

PMIx ASC 4Q 2023 Meeting

abouteiller commented 4 months ago

PMIx ASC 2024Q1 Meeting

Passed first vote: 9 yes / 0 no / 0 abstain Accepted as provisional.

abouteiller commented 4 months ago

@dsolt @raffenet ready to merge at your leisure