Skip to content

Commit

Permalink
mpi/pmix - defer setting PMIX_USERID
Browse files Browse the repository at this point in the history
Set PMIX_USERID in pmixp_libpmix_job_set() to notify PMIx to set the
communications socket's owner to the job's user instead of root at this
point in execution.

This patch will only work after pmix commit cbc6d60a00 which it in v5.0.

openpmix/openpmix@cbc6d60a00

Bug 16306
  • Loading branch information
samuelkgutierrez authored and dannyauble committed Mar 29, 2023
1 parent ebce407 commit d23cad6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ documents those changes that are of interest to users and administrators.
specification.
-- scrontab - don't update the cron job tasks if the whole crontab file is
left untouched after opening it with "scrontab -e".
-- mpi/pmix - avoid crashing when running PMIx v5.0 branch with shmem support.

* Changes in Slurm 23.02.1
==========================
Expand Down
12 changes: 12 additions & 0 deletions src/plugins/mpi/pmix/pmixp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ static void _set_tmpdirs(List lresp)
list_append(lresp, kvp);
}

static void _set_euid(list_t *lresp)
{
pmix_info_t *kvp;

uid_t uid = pmixp_info_jobuid();

PMIXP_KVP_CREATE(kvp, PMIX_USERID, &uid, PMIX_UINT32);
list_append(lresp, kvp);
}

/*
* information about relative ranks as assigned by the RM
*/
Expand Down Expand Up @@ -641,6 +651,8 @@ extern int pmixp_libpmix_job_set(void)

_set_topology(lresp);

_set_euid(lresp);

if (SLURM_SUCCESS != _set_mapsinfo(lresp)) {
FREE_NULL_LIST(lresp);
PMIXP_ERROR("Can't build nodemap");
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/mpi/pmix/pmixp_client_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ int pmixp_lib_init(void)
{
pmix_info_t *kvp = NULL;
pmix_status_t rc;
uint32_t jobuid = pmixp_info_jobuid();

PMIXP_KVP_ADD(kvp, PMIX_USERID, &jobuid, PMIX_UINT32);

#ifdef PMIX_SERVER_TMPDIR
PMIXP_KVP_ADD(kvp, PMIX_SERVER_TMPDIR,
Expand Down

0 comments on commit d23cad6

Please sign in to comment.