|
Lines 41-46
Link Here
|
| 41 |
#include <pwd.h> |
41 |
#include <pwd.h> |
| 42 |
#include <stdlib.h> |
42 |
#include <stdlib.h> |
| 43 |
#include <string.h> |
43 |
#include <string.h> |
|
|
44 |
#include <strings.h> |
| 44 |
#include <time.h> |
45 |
#include <time.h> |
| 45 |
#include <sys/stat.h> |
46 |
#include <sys/stat.h> |
| 46 |
#include <sys/types.h> |
47 |
#include <sys/types.h> |
|
Lines 139-145
extern int read_slurm_cgroup_conf(slurm_cgroup_conf_t *slurm_cgroup_conf)
Link Here
|
| 139 |
{"CgroupSubsystems", S_P_STRING}, |
140 |
{"CgroupSubsystems", S_P_STRING}, |
| 140 |
{"CgroupReleaseAgentDir", S_P_STRING}, |
141 |
{"CgroupReleaseAgentDir", S_P_STRING}, |
| 141 |
{"ConstrainCores", S_P_BOOLEAN}, |
142 |
{"ConstrainCores", S_P_BOOLEAN}, |
| 142 |
{"TaskAffinity", S_P_BOOLEAN}, |
143 |
{"TaskAffinity", S_P_STRING}, |
| 143 |
{"ConstrainRAMSpace", S_P_BOOLEAN}, |
144 |
{"ConstrainRAMSpace", S_P_BOOLEAN}, |
| 144 |
{"AllowedRAMSpace", S_P_STRING}, |
145 |
{"AllowedRAMSpace", S_P_STRING}, |
| 145 |
{"MaxRAMPercent", S_P_STRING}, |
146 |
{"MaxRAMPercent", S_P_STRING}, |
|
Lines 154-160
extern int read_slurm_cgroup_conf(slurm_cgroup_conf_t *slurm_cgroup_conf)
Link Here
|
| 154 |
{"AllowedDevicesFile", S_P_STRING}, |
155 |
{"AllowedDevicesFile", S_P_STRING}, |
| 155 |
{NULL} }; |
156 |
{NULL} }; |
| 156 |
s_p_hashtbl_t *tbl = NULL; |
157 |
s_p_hashtbl_t *tbl = NULL; |
| 157 |
char *conf_path = NULL; |
158 |
char *conf_path = NULL, *tmp_str = NULL; |
| 158 |
struct stat buf; |
159 |
struct stat buf; |
| 159 |
|
160 |
|
| 160 |
/* Set initial values */ |
161 |
/* Set initial values */ |
|
Lines 206-214
extern int read_slurm_cgroup_conf(slurm_cgroup_conf_t *slurm_cgroup_conf)
Link Here
|
| 206 |
if (!s_p_get_boolean(&slurm_cgroup_conf->constrain_cores, |
207 |
if (!s_p_get_boolean(&slurm_cgroup_conf->constrain_cores, |
| 207 |
"ConstrainCores", tbl)) |
208 |
"ConstrainCores", tbl)) |
| 208 |
slurm_cgroup_conf->constrain_cores = false; |
209 |
slurm_cgroup_conf->constrain_cores = false; |
| 209 |
if (!s_p_get_boolean(&slurm_cgroup_conf->task_affinity, |
210 |
|
| 210 |
"TaskAffinity", tbl)) |
211 |
slurm_cgroup_conf->task_affinity = 0; |
| 211 |
slurm_cgroup_conf->task_affinity = false; |
212 |
if (s_p_get_string(&tmp_str, "TaskAffinity", tbl)) { |
|
|
213 |
if (!strcasecmp(tmp_str, "yes")) |
| 214 |
slurm_cgroup_conf->task_affinity = 1; |
| 215 |
else if (!strcasecmp(tmp_str, "hard")) |
| 216 |
slurm_cgroup_conf->task_affinity = 2; |
| 217 |
} |
| 212 |
|
218 |
|
| 213 |
/* RAM and Swap constraints related conf items */ |
219 |
/* RAM and Swap constraints related conf items */ |
| 214 |
if (!s_p_get_boolean(&slurm_cgroup_conf->constrain_ram_space, |
220 |
if (!s_p_get_boolean(&slurm_cgroup_conf->constrain_ram_space, |