Skip to content

Commit

Permalink
No need to copy info array for tool_connected upcall
Browse files Browse the repository at this point in the history
Release of prte_server_req_t does not free the info
array unless the "copy" flag has been set to true.

Signed-off-by: Ralph Castain <[email protected]>
  • Loading branch information
rhc54 committed Feb 13, 2024
1 parent b1b2cc5 commit 35f3d56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/prted/pmix/pmix_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static pmix_server_module_t pmix_server = {
.push_stdin = pmix_server_stdin_fn,
.group = pmix_server_group_fn,
.allocate = pmix_server_alloc_fn,
#if PMIX_NUMERIC_VERSION >= 0x00050000
#ifdef PMIX_SESSION_INSTANTIATE
.session_control = pmix_server_session_ctrl_fn
#endif
};
Expand Down
10 changes: 2 additions & 8 deletions src/prted/pmix/pmix_server_gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2020 IBM Corporation. All rights reserved.
* Copyright (c) 2021-2023 Nanook Consulting All rights reserved.
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -686,7 +686,6 @@ void pmix_tool_connected_fn(pmix_info_t *info, size_t ninfo,
void *cbdata)
{
pmix_server_req_t *cd;
size_t n;

pmix_output_verbose(2, prte_pmix_server_globals.output,
"%s TOOL CONNECTION REQUEST RECVD",
Expand All @@ -697,13 +696,8 @@ void pmix_tool_connected_fn(pmix_info_t *info, size_t ninfo,
cd->toolcbfunc = cbfunc;
cd->cbdata = cbdata;
cd->target.rank = 0; // set default for tool

/* protect the provided info */
cd->info = info;
cd->ninfo = ninfo;
PMIX_INFO_CREATE(cd->info, cd->ninfo);
for(n = 0; n < ninfo; n++){
PMIX_INFO_XFER(&cd->info[n], &info[n]);
}

prte_event_set(prte_event_base, &(cd->ev), -1, PRTE_EV_WRITE, _toolconn, cd);
PMIX_POST_OBJECT(cd);
Expand Down
4 changes: 3 additions & 1 deletion src/prted/pmix/pmix_server_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,14 @@ PRTE_EXPORT extern pmix_status_t prte_server_send_request(uint8_t cmd, pmix_serv
#define PRTE_PMIX_SESSION_CTRL 1


#if PMIX_NUMERIC_VERSION >= 0x00050000
#ifdef PMIX_SESSION_INSTANTIATE

PRTE_EXPORT extern pmix_status_t
pmix_server_session_ctrl_fn(const pmix_proc_t *requestor,
uint32_t sessionID,
const pmix_info_t directives[], size_t ndirs,
pmix_info_cbfunc_t cbfunc, void *cbdata);

#endif

/* exposed shared variables */
Expand Down

0 comments on commit 35f3d56

Please sign in to comment.