-
Notifications
You must be signed in to change notification settings - Fork 30
/
pyxis_dispatch.c
63 lines (56 loc) · 1.32 KB
/
pyxis_dispatch.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
*/
#include <slurm/spank.h>
#include "pyxis_slurmd.h"
#include "pyxis_srun.h"
#include "pyxis_alloc.h"
#include "pyxis_slurmstepd.h"
SPANK_PLUGIN(pyxis, 1)
int slurm_spank_init(spank_t sp, int ac, char **av)
{
switch (spank_context()) {
case S_CTX_SLURMD:
return pyxis_slurmd_init(sp, ac, av);
case S_CTX_LOCAL:
return pyxis_srun_init(sp, ac, av);
case S_CTX_ALLOCATOR:
return pyxis_alloc_init(sp, ac, av);
case S_CTX_REMOTE:
return pyxis_slurmstepd_init(sp, ac, av);
default:
return (0);
}
}
int slurm_spank_init_post_opt(spank_t sp, int ac, char **av)
{
switch (spank_context()) {
case S_CTX_LOCAL:
return pyxis_srun_post_opt(sp, ac, av);
case S_CTX_ALLOCATOR:
return pyxis_alloc_post_opt(sp, ac, av);
case S_CTX_REMOTE:
return pyxis_slurmstepd_post_opt(sp, ac, av);
default:
return (0);
}
}
int slurm_spank_exit(spank_t sp, int ac, char **av)
{
switch (spank_context()) {
case S_CTX_SLURMD:
return pyxis_slurmd_exit(sp, ac, av);
case S_CTX_LOCAL:
return pyxis_srun_exit(sp, ac, av);
case S_CTX_ALLOCATOR:
return pyxis_alloc_exit(sp, ac, av);
case S_CTX_REMOTE:
return pyxis_slurmstepd_exit(sp, ac, av);
default:
return (0);
}
}
int slurm_spank_slurmd_exit(spank_t sp, int ac, char **av)
{
return pyxis_slurmd_exit(sp, ac, av);
}