Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psmpi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEEP-SEA
WP5 - System-level programming
Software
psmpi
Commits
03dc1994
Commit
03dc1994
authored
Nov 7, 2023
by
Sonja Happ
Browse files
Options
Downloads
Patches
Plain Diff
vendor/mpir_pmi: Introduce util function pmix_build_nodelist.
parent
a79ba96b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpich2/src/util/mpir_pmi.c
+48
-27
48 additions, 27 deletions
mpich2/src/util/mpir_pmi.c
with
48 additions
and
27 deletions
mpich2/src/util/mpir_pmi.c
+
48
−
27
View file @
03dc1994
...
@@ -1646,46 +1646,67 @@ static int build_nodemap_pmi2(int *nodemap, int sz)
...
@@ -1646,46 +1646,67 @@ static int build_nodemap_pmi2(int *nodemap, int sz)
#elif defined USE_PMIX_API
#elif defined USE_PMIX_API
/* build nodemap using PMIx_Resolve_nodes */
static
int
build_node
map_pmix
(
int
*
nodemap
,
int
sz
)
int
pmix_
build_node
list
(
char
**
nspaces
,
int
nnspaces
,
UT_array
**
nodelist
)
{
{
int
mpi_errno
=
MPI_SUCCESS
;
int
mpi_errno
=
MPI_SUCCESS
;
int
pmi_errno
;
pmix_status_t
pmi_errno
=
PMIX_SUCCESS
;
char
*
nodelist
=
NULL
,
*
node
=
NULL
;
UT_array
*
list
=
NULL
;
pmix_proc_t
*
procs
=
NULL
;
char
*
node
=
NULL
;
size_t
nprocs
,
node_id
=
0
;
char
*
pmix_nodelist
=
NULL
;
#if PMIX_NUMERIC_VERSION >= 0x00040204
UT_array
*
pmix_nodelist
=
NULL
;
if
(
pmix_group_members
!=
NULL
)
{
utarray_new
(
list
,
&
ut_str_icd
,
MPL_MEM_OTHER
);
utarray_new
(
pmix_nodelist
,
&
ut_str_icd
,
MPL_MEM_OTHER
);
for
(
int
i
=
0
;
i
<
pmix_nname
spaces
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nn
spaces
;
i
++
)
{
/* Get nodes of this namespace */
/* Get nodes of this namespace */
pmi_errno
=
PMIx_Resolve_nodes
(
pmix_name
spaces
[
i
],
&
nodelist
);
pmi_errno
=
PMIx_Resolve_nodes
(
n
spaces
[
i
],
&
pmix_
nodelist
);
MPIR_ERR_CHKANDJUMP1
(
pmi_errno
!=
PMIX_SUCCESS
,
mpi_errno
,
MPI_ERR_OTHER
,
MPIR_ERR_CHKANDJUMP1
(
pmi_errno
!=
PMIX_SUCCESS
,
mpi_errno
,
MPI_ERR_OTHER
,
"**pmix_resolve_nodes"
,
"**pmix_resolve_nodes %d"
,
pmi_errno
);
"**pmix_resolve_nodes"
,
"**pmix_resolve_nodes %d"
,
pmi_errno
);
MPIR_Assert
(
nodelist
);
MPIR_Assert
(
pmix_
nodelist
);
/* Add non-duplicate nodes to
global pmix_node
list */
/* Add non-duplicate nodes to list */
node
=
strtok
(
nodelist
,
","
);
node
=
strtok
(
pmix_
nodelist
,
","
);
while
(
node
)
{
while
(
node
)
{
bool
is_duplicate
=
false
;
bool
is_duplicate
=
false
;
for
(
unsigned
u
=
0
;
u
<
utarray_len
(
pmix_node
list
);
u
++
)
{
for
(
unsigned
u
=
0
;
u
<
utarray_len
(
list
);
u
++
)
{
char
*
n
=
(
char
*
)
utarray_eltptr
(
pmix_node
list
,
u
);
char
*
n
=
*
(
char
*
*
)
utarray_eltptr
(
list
,
u
);
if
(
strncmp
(
node
,
n
,
M
AX
(
strlen
(
node
),
strlen
(
n
)))
==
0
)
{
if
(
strncmp
(
node
,
n
,
M
IN
(
strlen
(
node
),
strlen
(
n
)))
==
0
)
{
is_duplicate
=
true
;
is_duplicate
=
true
;
break
;
break
;
}
}
}
}
if
(
!
is_duplicate
)
{
if
(
!
is_duplicate
)
{
utarray_push_back
(
pmix_node
list
,
&
node
,
MPL_MEM_OTHER
);
utarray_push_back
(
list
,
&
node
,
MPL_MEM_OTHER
);
}
}
node
=
strtok
(
NULL
,
","
);
node
=
strtok
(
NULL
,
","
);
}
}
pmix_free
(
nodelist
);
pmix_free
(
pmix_
nodelist
);
}
}
*
nodelist
=
list
;
fn_exit:
return
mpi_errno
;
fn_fail:
goto
fn_exit
;
}
/* build nodemap using PMIx_Resolve_nodes */
int
build_nodemap_pmix
(
int
*
nodemap
,
int
sz
)
{
int
mpi_errno
=
MPI_SUCCESS
;
int
pmi_errno
;
char
*
nodelist
=
NULL
,
*
node
=
NULL
;
pmix_proc_t
*
procs
=
NULL
;
size_t
nprocs
,
node_id
=
0
;
#if PMIX_NUMERIC_VERSION >= 0x00040204
UT_array
*
pmix_nodelist
=
NULL
;
if
(
pmix_group_members
!=
NULL
)
{
mpi_errno
=
pmix_build_nodelist
(
pmix_namespaces
,
pmix_nnamespaces
,
&
pmix_nodelist
);
MPIR_ERR_CHECK
(
mpi_errno
);
/* Resolve nodes for each namespace */
/* Resolve nodes for each namespace */
for
(
int
i
=
0
;
i
<
pmix_nnamespaces
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pmix_nnamespaces
;
i
++
)
{
pmi_errno
=
PMIx_Resolve_nodes
(
pmix_namespaces
[
i
],
&
nodelist
);
pmi_errno
=
PMIx_Resolve_nodes
(
pmix_namespaces
[
i
],
&
nodelist
);
...
@@ -1708,7 +1729,7 @@ int build_nodemap_pmix(int *nodemap, int sz)
...
@@ -1708,7 +1729,7 @@ int build_nodemap_pmix(int *nodemap, int sz)
node_id
=
-
1
;
node_id
=
-
1
;
for
(
unsigned
k
=
0
;
k
<
utarray_len
(
pmix_nodelist
);
k
++
)
{
for
(
unsigned
k
=
0
;
k
<
utarray_len
(
pmix_nodelist
);
k
++
)
{
char
**
n
=
(
char
**
)
utarray_eltptr
(
pmix_nodelist
,
k
);
char
**
n
=
(
char
**
)
utarray_eltptr
(
pmix_nodelist
,
k
);
if
(
strncmp
(
node
,
*
n
,
M
AX
(
strlen
(
node
),
strlen
(
*
n
)))
==
0
)
{
if
(
strncmp
(
node
,
*
n
,
M
IN
(
strlen
(
node
),
strlen
(
*
n
)))
==
0
)
{
node_id
=
(
int
)
k
;
node_id
=
(
int
)
k
;
break
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment