QUDA
1.0.0
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
Enumerations
+
Enumerator
a
b
c
d
e
h
i
k
m
n
p
q
r
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
f
g
i
n
r
s
t
v
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
d
m
q
t
+
Enumerations
i
q
+
Enumerator
e
q
t
x
y
z
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
lib
numa_affinity.cpp
Go to the documentation of this file.
1
2
/* Originally from Galen Arnold, NCSA arnoldg@ncsa.illinois.edu
3
* modified by Guochun Shi
4
*
5
*/
6
7
#include <
numa_affinity.h
>
8
#include <
quda_internal.h
>
9
10
#if ((CUDA_VERSION >= 6000) && defined NUMA_NVML)
11
#include <nvml.h>
12
#endif
13
14
15
int
setNumaAffinityNVML
(
int
devid)
16
{
17
#if ((CUDA_VERSION >= 6000) && defined NUMA_NVML)
18
nvmlReturn_t result;
19
20
result = nvmlInit();
21
if
(NVML_SUCCESS != result)
22
{
23
warningQuda
(
"Failed to determine NUMA affinity for device %d (NVML Init failed)"
, devid);
24
return
-1;
25
}
26
nvmlDevice_t
device
;
27
result = nvmlDeviceGetHandleByIndex(devid, &device);
28
if
(NVML_SUCCESS != result)
29
{
30
warningQuda
(
"Failed to determine NUMA affinity for device %d (NVML DeviceGetHandle failed)"
, devid);
31
return
-1;
32
}
33
result = nvmlDeviceSetCpuAffinity(device);
34
if
(NVML_SUCCESS != result)
35
{
36
warningQuda
(
"Failed to determine NUMA affinity for device %d (NVML DeviceSetCpuAffinity failed)"
, devid);
37
return
-1;
38
}
39
else
{
40
printfQuda
(
"Set NUMA affinity for device %d (NVML DeviceSetCpuAffinity)\n"
, devid);
41
}
42
result = nvmlShutdown();
43
if
(NVML_SUCCESS != result)
44
{
45
warningQuda
(
"Failed to determine NUMA affinity for device %d (NVML Shutdown failed)"
, devid);
46
return
-1;
47
}
48
return
0;
49
#else
50
warningQuda
(
"Failed to determine NUMA affinity for device %d (NVML not supported in quda build)"
, devid);
51
return
-1;
52
#endif
53
}
setNumaAffinityNVML
int setNumaAffinityNVML(int devid)
Definition:
numa_affinity.cpp:15
warningQuda
#define warningQuda(...)
Definition:
util_quda.h:133
printfQuda
#define printfQuda(...)
Definition:
util_quda.h:115
device
int device
Definition:
test_util.cpp:1602
numa_affinity.h
quda_internal.h
Generated by
1.8.13