Skip to content
Snippets Groups Projects
Commit bc45c643 authored by Tim Wickberg's avatar Tim Wickberg
Browse files

macOS - bypass functions involving cpuset_t.

These should ideally be split off from the task plugin interface since
they're tied to a specific implementations.

And the core_spec code itself does not really belong directly in
slurmd.c.
parent f259c893
No related branches found
No related tags found
No related merge requests found
...@@ -510,6 +510,9 @@ extern int task_g_add_pid(pid_t pid) ...@@ -510,6 +510,9 @@ extern int task_g_add_pid(pid_t pid)
extern void task_slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job, extern void task_slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job,
int statval) int statval)
{ {
#if defined(__APPLE__)
fatal("%s: not supported on macOS", __func__);
#else
char *bind_type, *action, *status, *units; char *bind_type, *action, *status, *units;
char mstr[1 + CPU_SETSIZE / 4]; char mstr[1 + CPU_SETSIZE / 4];
int task_gid = job->envtp->procid; int task_gid = job->envtp->procid;
...@@ -570,10 +573,14 @@ extern void task_slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job, ...@@ -570,10 +573,14 @@ extern void task_slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job,
task_cpuset_to_str(mask, mstr), task_cpuset_to_str(mask, mstr),
action, action,
status); status);
#endif
} }
extern char *task_cpuset_to_str(const cpu_set_t *mask, char *str) extern char *task_cpuset_to_str(const cpu_set_t *mask, char *str)
{ {
#if defined(__APPLE__)
fatal("%s: not supported on macOS", __func__);
#else
int base; int base;
char *ptr = str; char *ptr = str;
char *ret = NULL; char *ret = NULL;
...@@ -594,10 +601,14 @@ extern char *task_cpuset_to_str(const cpu_set_t *mask, char *str) ...@@ -594,10 +601,14 @@ extern char *task_cpuset_to_str(const cpu_set_t *mask, char *str)
} }
*ptr = '\0'; *ptr = '\0';
return ret ? ret : ptr - 1; return ret ? ret : ptr - 1;
#endif
} }
extern int task_str_to_cpuset(cpu_set_t *mask, const char* str) extern int task_str_to_cpuset(cpu_set_t *mask, const char* str)
{ {
#if defined(__APPLE__)
fatal("%s: not supported on macOS", __func__);
#else
int len = strlen(str); int len = strlen(str);
const char *ptr = str + len - 1; const char *ptr = str + len - 1;
int base = 0; int base = 0;
...@@ -625,4 +636,5 @@ extern int task_str_to_cpuset(cpu_set_t *mask, const char* str) ...@@ -625,4 +636,5 @@ extern int task_str_to_cpuset(cpu_set_t *mask, const char* str)
} }
return 0; return 0;
#endif
} }
...@@ -2250,6 +2250,9 @@ static bool _is_core_spec_cray(void) ...@@ -2250,6 +2250,9 @@ static bool _is_core_spec_cray(void)
*/ */
static int _core_spec_init(void) static int _core_spec_init(void)
{ {
#if defined(__APPLE__)
fatal("%s: not supported on macOS", __func__);
#else
int i, rval; int i, rval;
pid_t pid; pid_t pid;
uint32_t task_params; uint32_t task_params;
...@@ -2369,6 +2372,7 @@ static int _core_spec_init(void) ...@@ -2369,6 +2372,7 @@ static int _core_spec_init(void)
_resource_spec_fini(); _resource_spec_fini();
return SLURM_SUCCESS; return SLURM_SUCCESS;
#endif
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment