Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
aml
Commits
084fb7e7
Commit
084fb7e7
authored
Oct 02, 2020
by
Nicolas Denoyelle
Browse files
clang format
parent
0fb45c0e
Pipeline
#11482
passed with stages
in 4 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/area/hwloc.c
View file @
084fb7e7
...
...
@@ -364,12 +364,14 @@ static int aml_hwloc_distances_alloc(const hwloc_obj_type_t t0,
}
*
out
=
AML_INNER_MALLOC_EXTRA
(
n
,
hwloc_obj_t
,
n
*
n
*
sizeof
(
*
((
*
out
)
->
values
)),
struct
hwloc_distances_s
);
n
*
n
*
sizeof
(
*
((
*
out
)
->
values
)),
struct
hwloc_distances_s
);
if
(
*
out
==
NULL
)
return
-
AML_ENOMEM
;
(
*
out
)
->
objs
=
AML_INNER_MALLOC_GET_ARRAY
(
*
out
,
hwloc_obj_t
,
struct
hwloc_distances_s
);
(
*
out
)
->
values
=
AML_INNER_MALLOC_GET_EXTRA
(
*
out
,
n
,
hwloc_obj_t
,
struct
hwloc_distances_s
);
(
*
out
)
->
objs
=
AML_INNER_MALLOC_GET_ARRAY
(
*
out
,
hwloc_obj_t
,
struct
hwloc_distances_s
);
(
*
out
)
->
values
=
AML_INNER_MALLOC_GET_EXTRA
(
*
out
,
n
,
hwloc_obj_t
,
struct
hwloc_distances_s
);
(
*
out
)
->
nbobjs
=
n
;
for
(
unsigned
it0
=
0
;
it0
<
*
nt0
;
it0
++
)
...
...
@@ -654,7 +656,7 @@ int aml_hwloc_get_NUMA_distance(const hwloc_obj_type_t type,
// We pick any distance
if
(
dist
==
NULL
)
dist
=
handle
[
i
];
// If we found a matrix with same type as initiator type
// then we pick this one.
else
if
(
handle
[
i
]
->
objs
[
0
]
->
type
==
type
)
{
...
...
@@ -670,11 +672,10 @@ int aml_hwloc_get_NUMA_distance(const hwloc_obj_type_t type,
// If we find a distance that is finer grain than default,
// then we chose this one.
else
if
(
dist
->
objs
[
0
]
->
type
!=
HWLOC_OBJ_NUMANODE
&&
dist
->
objs
[
0
]
->
depth
<
handle
[
i
]
->
objs
[
0
]
->
depth
)
dist
->
objs
[
0
]
->
depth
<
handle
[
i
]
->
objs
[
0
]
->
depth
)
dist
=
handle
[
i
];
}
// If we were not able to find any matrix, we craft one.
if
(
dist
==
NULL
)
{
if
(
aml_hwloc_distance_hop_matrix
(
type
,
HWLOC_OBJ_NUMANODE
,
...
...
@@ -689,9 +690,9 @@ int aml_hwloc_get_NUMA_distance(const hwloc_obj_type_t type,
AML_SUCCESS
)
err
=
-
AML_ENOMEM
;
out:
for
(
i
=
0
;
i
<
nr
;
i
++
)
hwloc_distances_release
(
aml_topology
,
handle
[
i
]);
out:
for
(
i
=
0
;
i
<
nr
;
i
++
)
hwloc_distances_release
(
aml_topology
,
handle
[
i
]);
return
err
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment