2
2
* slurm.h - Definitions for all of the SLURM RPCs
3
3
*****************************************************************************
4
4
* Copyright (C) 2002-2007 The Regents of the University of California.
5
* Copyright (C) 2008 Lawrence Livermore National Security.
5
* Copyright (C) 2008-2009 Lawrence Livermore National Security.
6
6
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
* Written by Morris Jette <jette1@llnl.gov>,
8
8
* Joey Ekstrom <ekstrom1@llnl.gov> et. al.
9
* CODE-OCEC-09-009. All rights reserved.
11
11
* This file is part of SLURM, a resource management program.
12
* For details, see <http://www.llnl.gov/linux/slurm/>.
12
* For details, see <https://computing.llnl.gov/linux/slurm/>.
13
* Please also read the included file: DISCLAIMER.
14
15
* SLURM is free software; you can redistribute it and/or modify it under
15
16
* the terms of the GNU General Public License as published by the Free
133
134
typedef struct switch_jobinfo *switch_jobinfo_t; /* opaque data type */
136
/* Define select_jobinfo_t below to avoid including extraneous slurm headers */
137
/* Define select_jobinfo_t and select_job_res_t below
138
* to avoid including extraneous slurm headers */
137
139
#ifndef __select_jobinfo_t_defined
138
# define __select_jobinfo_t_defined
139
typedef struct select_jobinfo *select_jobinfo_t; /* opaque data type */
140
# define __select_jobinfo_t_defined /* Opaque data for select plugins */
141
typedef struct select_jobinfo *select_jobinfo_t; /* for BlueGene */
142
typedef struct select_job_res *select_job_res_t; /* for non-BlueGene */
142
145
/* Define jobacctinfo_t below to avoid including extraneous slurm headers */
221
224
WAIT_HELD, /* job is held, priority==0 */
222
225
WAIT_TIME, /* job waiting for specific begin time */
223
226
WAIT_LICENSES, /* job is waiting for licenses */
224
WAIT_ASSOC_LIMIT, /* user/bank job limit reached */
227
WAIT_ASSOC_JOB_LIMIT, /* user/bank job limit reached */
228
WAIT_ASSOC_RESOURCE_LIMIT,/* user/bank resource limit reached */
229
WAIT_ASSOC_TIME_LIMIT, /* user/bank time limit reached */
230
WAIT_RESERVATION, /* reservation not available */
227
233
FAIL_DOWN_PARTITION, /* partition for job is DOWN */
356
364
#define OPEN_MODE_TRUNCATE 2
358
366
typedef enum cpu_bind_type { /* cpu binding type from --cpu_bind=... */
367
/* verbose can be set with any other flag */
368
CPU_BIND_VERBOSE = 0x01, /* =v, */
359
369
/* the following auto-binding flags are mutually exclusive */
360
CPU_BIND_TO_THREADS= 0x01, /* =threads */
361
CPU_BIND_TO_CORES = 0x02, /* =cores */
362
CPU_BIND_TO_SOCKETS= 0x04, /* =sockets */
363
/* verbose can be set with any other flag */
364
CPU_BIND_VERBOSE = 0x08, /* =v, */
370
CPU_BIND_TO_THREADS= 0x02, /* =threads */
371
CPU_BIND_TO_CORES = 0x04, /* =cores */
372
CPU_BIND_TO_SOCKETS= 0x08, /* =sockets */
373
CPU_BIND_TO_LDOMS = 0x10, /* locality domains */
365
374
/* the following manual binding flags are mutually exclusive */
366
/* CPU_BIND_NONE needs to be the first in this sub-list */
367
CPU_BIND_NONE = 0x10, /* =no */
368
CPU_BIND_RANK = 0x20, /* =rank */
369
CPU_BIND_MAP = 0x40, /* =map_cpu:<list of CPU IDs> */
370
CPU_BIND_MASK = 0x80 /* =mask_cpu:<list of CPU masks> */
375
/* CPU_BIND_NONE needs to be the lowest value among manual bindings */
376
CPU_BIND_NONE = 0x20, /* =no */
377
CPU_BIND_RANK = 0x40, /* =rank */
378
CPU_BIND_MAP = 0x80, /* =map_cpu:<list of CPU IDs> */
379
CPU_BIND_MASK = 0x100,/* =mask_cpu:<list of CPU masks> */
380
CPU_BIND_LDRANK = 0x200,/* =locality domain rank */
381
CPU_BIND_LDMAP = 0x400,/* =map_ldom:<list of locality domains> */
382
CPU_BIND_LDMASK = 0x800,/* =mask_ldom:<list of ldom masks> */
384
/* the following is used only as a flag for expressing
385
* the contents of TaskPluginParams */
386
CPU_BIND_CPUSETS = 0x8000
371
387
} cpu_bind_type_t;
373
389
typedef enum mem_bind_type { /* memory binding type from --mem_bind=... */
447
466
CR_CPU_MEMORY /* CPU and Memory are CRs */
448
467
} select_type_plugin_info_t ;
450
/* Values for slurm_ctl_conf.task_plugin_param */
451
#define TASK_PARAM_NONE 0x0000
452
#define TASK_PARAM_CPUSETS 0x0001
453
#define TASK_PARAM_SCHED 0x0002
455
469
#define MEM_PER_CPU 0x80000000
456
470
#define SHARED_FORCE 0x8000
458
#define PRIVATE_DATA_JOBS 0x0001 /* job/step data is private */
459
#define PRIVATE_DATA_NODES 0x0002 /* node data is private */
460
#define PRIVATE_DATA_PARTITIONS 0x0004 /* partition data is private */
461
#define PRIVATE_DATA_USAGE 0x0008 /* accounting usage data is private */
462
#define PRIVATE_DATA_USERS 0x0010 /* accounting user data is private */
463
#define PRIVATE_DATA_ACCOUNTS 0x0020 /* accounting account data is private */
472
#define PRIVATE_DATA_JOBS 0x0001 /* job/step data is private */
473
#define PRIVATE_DATA_NODES 0x0002 /* node data is private */
474
#define PRIVATE_DATA_PARTITIONS 0x0004 /* partition data is private */
475
#define PRIVATE_DATA_USAGE 0x0008 /* accounting usage data is private */
476
#define PRIVATE_DATA_USERS 0x0010 /* accounting user data is private */
477
#define PRIVATE_DATA_ACCOUNTS 0x0020 /* accounting account data is private*/
478
#define PRIVATE_DATA_RESERVATIONS 0x0040 /* reservation data is private */
480
#define PRIORITY_RESET_NONE 0x0000 /* never clear */
481
#define PRIORITY_RESET_NOW 0x0001 /* clear now (when slurmctld restarts) */
482
#define PRIORITY_RESET_DAILY 0x0002 /* clear daily at midnight */
483
#define PRIORITY_RESET_WEEKLY 0x0003 /* clear weekly at Sunday 00:00 */
484
#define PRIORITY_RESET_MONTHLY 0x0004 /* clear monthly on first at 00:00 */
485
#define PRIORITY_RESET_QUARTERLY 0x0005 /* clear quarterly on first at 00:00 */
486
#define PRIORITY_RESET_YEARLY 0x0006 /* clear yearly on first at 00:00 */
465
488
/*****************************************************************************\
466
489
* PROTOCOL DATA STRUCTURE DEFINITIONS
479
502
uint32_t argc; /* number of arguments to the script */
480
503
char **argv; /* arguments to the script */
481
504
time_t begin_time; /* delay initiation until this time */
505
uint16_t ckpt_interval; /* periodically checkpoint this job */
506
char *ckpt_dir; /* directory to store checkpoint images */
482
507
char *comment; /* arbitrary comment (used by Moab scheduler) */
483
508
uint16_t contiguous; /* 1 if job requires contiguous nodes,
484
509
* 0 otherwise,default=0 */
510
char *cpu_bind; /* binding map for map/mask_cpu */
511
uint16_t cpu_bind_type; /* see cpu_bind_type_t */
485
512
char *dependency; /* syncrhonize job execution with other jobs */
486
513
char **environment; /* environment variables to set for job,
487
514
* name=value pairs, one per line */
501
528
char *licenses; /* licenses required by the job */
502
529
uint16_t mail_type; /* see MAIL_JOB_ definitions above */
503
530
char *mail_user; /* user to receive notification */
531
char *mem_bind; /* binding map for map/mask_cpu */
532
uint16_t mem_bind_type; /* see mem_bind_type_t */
504
533
char *name; /* name of the job, default "" */
505
534
char *network; /* network use spec */
506
535
uint16_t nice; /* requested priority change,
507
536
* NICE_OFFSET == no change */
508
uint32_t num_tasks; /* number of tasks to be started, for batch only */
537
uint32_t num_tasks; /* number of tasks to be started,
509
539
uint8_t open_mode; /* out/err open mode truncate or append,
510
540
* see OPEN_MODE_* */
511
541
uint16_t other_port; /* port to send various notification msg to */
588
618
/* End of Blue Gene specific values */
590
620
select_jobinfo_t select_jobinfo; /* opaque data type,
591
* SLURM internal use only */
621
* SLURM internal use only */
622
char *wckey; /* wckey for job */
592
623
} job_desc_msg_t;
594
625
typedef struct job_info {
595
626
char *account; /* charge to specified account */
596
627
char *alloc_node; /* local node making resource alloc */
597
628
uint32_t alloc_sid; /* local sid making resource alloc */
629
uint32_t assoc_id; /* association id for job */
598
630
uint16_t batch_flag; /* 1 if batch: queued job with script */
599
631
char *command; /* command to be executed */
600
632
char *comment; /* arbitrary comment (used by Moab scheduler) */
601
633
uint16_t contiguous; /* 1 if job requires contiguous nodes */
634
uint32_t *cpu_count_reps;/* how many nodes have same cpu count */
635
uint16_t *cpus_per_node;/* cpus per node */
602
636
uint16_t cpus_per_task; /* number of processors required for each task */
603
637
char *dependency; /* syncrhonize job execution with other jobs */
604
638
time_t end_time; /* time of termination, actual or expected */
618
652
uint32_t job_min_tmp_disk; /* minimum tmp disk per node, default=0 */
619
653
uint16_t job_state; /* state of the job, see enum job_states */
620
654
char *licenses; /* licenses required by the job */
655
uint16_t max_cores; /* maximum number of cores per cpu */
656
uint32_t max_nodes; /* maximum number of nodes usable by job */
657
uint16_t max_sockets; /* maximum number of sockets per node */
658
uint16_t max_threads; /* maximum number of threads per core */
659
uint16_t min_cores; /* minimum number of cores per cpu */
660
uint16_t min_sockets; /* minimum number of sockets per node */
661
uint16_t min_threads; /* minimum number of threads per core */
621
662
char *name; /* name of the job */
622
663
char *network; /* network specification */
623
664
char *nodes; /* list of nodes allocated to job */
636
681
* start_range_1, end_range_1,
637
682
* start_range_2, .., -1 */
638
683
uint16_t requeue; /* enable or disable job requeue option */
684
uint16_t restart_cnt; /* count of job restarts */
685
char *resv_name; /* reservation name */
639
686
select_jobinfo_t select_jobinfo; /* opaque data type,
640
687
* process using select_g_get_jobinfo() */
641
688
uint16_t shared; /* 1 if job can share nodes with other jobs */
642
689
time_t start_time; /* time execution begins, actual or expected */
690
char *state_desc; /* optional details for state_reason */
643
691
uint16_t state_reason; /* reason job still pending or failed, see
644
692
* slurm.h:enum job_state_reason */
645
693
time_t submit_time; /* time of job submission */
646
694
time_t suspend_time; /* time job last suspended or resumed */
647
695
uint32_t time_limit; /* maximum run time in minutes or INFINITE */
648
696
uint32_t user_id; /* user the job runs as */
697
char *wckey; /* wckey for job */
649
698
char *work_dir; /* pathname of working directory */
651
uint16_t num_cpu_groups;/* elements in below cpu arrays */
652
uint32_t *cpus_per_node;/* cpus per node */
653
uint32_t *cpu_count_reps;/* how many nodes have same cpu count */
654
uint32_t num_procs; /* number of processors required by job */
655
uint32_t num_nodes; /* minimum number of nodes required by job */
656
uint32_t max_nodes; /* maximum number of nodes usable by job */
657
uint16_t min_sockets; /* minimum number of sockets per node */
658
uint16_t max_sockets; /* maximum number of sockets per node */
659
uint16_t min_cores; /* minimum number of cores per cpu */
660
uint16_t max_cores; /* maximum number of cores per cpu */
661
uint16_t min_threads; /* minimum number of threads per core */
662
uint16_t max_threads; /* maximum number of threads per core */
665
701
typedef struct job_info_msg {
671
707
typedef struct slurm_step_layout {
672
708
uint32_t node_cnt; /* node count */
673
uint32_t task_cnt; /* total number of tasks in the step */
675
709
char *node_list; /* list of nodes in step */
710
uint16_t plane_size; /* plane size when task_dist =
711
* SLURM_DIST_PLANE */
676
712
/* Array of length "node_cnt". Each element of the array
677
713
* is the number of tasks assigned to the corresponding node */
715
uint32_t task_cnt; /* total number of tasks in the step */
716
uint16_t task_dist; /* see enum task_dist_state */
680
717
/* Array (of length "node_cnt") of task ID arrays. The length
681
718
* of each subarray is designated by the corresponding value in
682
719
* the tasks array. */
683
720
uint32_t **tids; /* host id => task id mapping */
685
uint16_t task_dist; /* see enum task_dist_state */
686
uint16_t plane_size; /* plane size when task_dist =
687
* SLURM_DIST_PLANE */
688
721
} slurm_step_layout_t;
690
723
typedef struct slurm_step_io_fds {
740
773
typedef struct srun_node_fail_msg {
741
774
uint32_t job_id; /* slurm job_id */
742
uint32_t step_id; /* step_id or NO_VAL */
743
775
char *nodelist; /* name of failed node(s) */
776
uint32_t step_id; /* step_id or NO_VAL */
744
777
} srun_node_fail_msg_t;
779
typedef struct srun_step_missing_msg {
780
uint32_t job_id; /* slurm job_id */
781
char *nodelist; /* name of node(s) lacking this step */
782
uint32_t step_id; /* step_id or NO_VAL */
783
} srun_step_missing_msg_t;
786
uint16_t ckpt_interval; /* checkpoint interval in minutes */
787
uint32_t cpu_count; /* number of required processors */
788
uint16_t exclusive; /* 1 if CPUs not shared with other steps */
789
uint16_t immediate; /* 1 if allocate to run or fail immediately,
790
* 0 if to be queued awaiting resources */
747
791
uint32_t job_id; /* job ID */
792
uint32_t mem_per_task; /* memory required per task (MB),
793
* use job limit if 0 */
794
char *ckpt_dir; /* directory to store checkpoint image files */
749
795
char *name; /* name of the job step */
796
char *network; /* network use spec */
797
uint8_t no_kill; /* 1 if no kill on node failure */
750
798
uint32_t node_count; /* number of required nodes */
751
uint32_t cpu_count; /* number of required processors */
799
char *node_list; /* list of required nodes */
800
bool overcommit; /* "true" to allow the allocation of more tasks
801
* to a node than available processors,
802
* "false" to accept at most one task per
803
* processor. "false" by default. */
804
uint16_t plane_size; /* plane size when task_dist =
805
* SLURM_DIST_PLANE */
806
uint16_t relative; /* first node to use of job's allocation */
807
uint16_t resv_port_cnt; /* reserve ports if set */
752
808
uint32_t task_count; /* number of tasks required */
753
uint16_t relative; /* first node to use of job's allocation */
754
809
uint16_t task_dist; /* see enum task_dist_state, default
755
is SLURM_DIST_CYCLIC */
756
uint16_t plane_size; /* plane size when task_dist =
758
char *node_list; /* list of required nodes */
759
char *network; /* network use spec */
760
uint16_t immediate; /* 1 if allocate to run or fail immediately,
761
* 0 if to be queued awaiting resources */
762
uint16_t exclusive; /* 1 if CPUs not shared with other steps */
763
bool overcommit; /* "true" to allow the allocation of more tasks
764
to a node than available processors,
765
"false" to accept at most one task per
766
processor. "false" by default. */
767
bool no_kill; /* true of no kill on node failure */
768
uint16_t ckpt_interval; /* checkpoint interval in minutes */
769
char *ckpt_path; /* path to store checkpoint image files */
810
* is SLURM_DIST_CYCLIC */
811
uid_t uid; /* user ID */
770
812
uint16_t verbose_level; /* for extra logging decisions in step
773
uint16_t mem_per_task; /* memory required per task (MB), 0=no limit */
774
814
} slurm_step_ctx_params_t;
833
871
} slurm_allocation_callbacks_t;
874
char *ckpt_dir; /* path to store checkpoint image files */
875
uint16_t ckpt_interval; /* checkpoint interval in minutes */
836
876
uint32_t job_id; /* job ID */
837
uint16_t step_id; /* step ID */
838
uint32_t user_id; /* user the job runs as */
877
char *name; /* name of job step */
878
char *network; /* network specs for job step */
879
char *nodes; /* list of nodes allocated to job_step */
880
int *node_inx; /* list index pairs into node_table for *nodes:
881
* start_range_1, end_range_1,
882
* start_range_2, .., -1 */
839
883
uint32_t num_tasks; /* number of tasks */
884
char *partition; /* name of assigned partition */
885
char *resv_ports; /* ports allocated for MPI */
886
time_t run_time; /* net run time (factor out time suspended) */
840
887
time_t start_time; /* step start time */
841
time_t run_time; /* net run time (factor out time suspended) */
842
char *partition; /* name of assigned partition */
843
char *nodes; /* list of nodes allocated to job_step */
844
char *name; /* name of job step */
845
char *network; /* network specs for job step */
846
int *node_inx; /* list index pairs into node_table for *nodes:
847
* start_range_1, end_range_1,
848
* start_range_2, .., -1 */
849
uint16_t ckpt_interval; /* checkpoint interval in minutes */
850
char *ckpt_path; /* path to store checkpoint image files */
888
uint32_t step_id; /* step ID */
889
uint32_t user_id; /* user the job runs as */
851
890
} job_step_info_t;
853
892
typedef struct job_step_info_response_msg {
857
896
} job_step_info_response_msg_t;
859
898
typedef struct node_info {
860
char *name; /* node name */
861
uint16_t node_state; /* see enum node_states */
899
char *arch; /* computer architecture */
900
uint16_t cores; /* number of cores per CPU */
862
901
uint16_t cpus; /* configured count of cpus running on
864
uint16_t used_cpus; /* count of used cpus on this node */
903
char *features; /* arbitrary list of features for node */
904
char *name; /* node name */
905
uint16_t node_state; /* see enum node_states */
906
char *os; /* operating system currently running */
907
uint32_t real_memory; /* configured MB of real memory on the node */
908
char *reason; /* reason for node being DOWN or DRAINING */
865
909
uint16_t sockets; /* number of sockets per node */
866
uint16_t cores; /* number of cores per CPU */
867
910
uint16_t threads; /* number of threads per core */
868
uint32_t real_memory; /* configured MB of real memory on the node */
869
911
uint32_t tmp_disk; /* configured MB of total disk in TMP_FS */
912
uint16_t used_cpus; /* count of used cpus on this node */
870
913
uint32_t weight; /* arbitrary priority of node for scheduling */
871
char *arch; /* computer architecture */
872
char *features; /* arbitrary list of features for node */
873
char *os; /* operating system currently running */
874
char *reason; /* reason for node being DOWN or DRAINING */
877
916
typedef struct node_info_msg {
880
919
node_info_t *node_array; /* the node records */
881
920
} node_info_msg_t;
922
typedef struct topo_info {
923
uint16_t level; /* level in hierarchy, leaf=0 */
924
uint32_t link_speed; /* link speed, arbitrary units */
925
char *name; /* switch name */
926
char *nodes; /* name if direct descendent nodes */
927
char *switches; /* name if direct descendent switches */
930
typedef struct topo_info_response_msg {
931
uint32_t record_count; /* number of records */
932
topo_info_t *topo_array; /* the switch topology records */
933
} topo_info_response_msg_t;
883
935
typedef struct job_alloc_info_msg {
884
936
uint32_t job_id; /* job ID */
885
937
} job_alloc_info_msg_t;
887
939
typedef struct partition_info {
940
char *allow_alloc_nodes;/* list names of allowed allocating nodes */
888
941
char *allow_groups; /* comma delimited list of groups,
889
942
* null indicates all */
890
943
uint16_t default_part; /* 1 if this is default partition */
944
uint32_t default_time; /* minutes, NO_VAL or INFINITE */
891
945
uint16_t disable_root_jobs; /* 1 if user root jobs disabled */
892
946
uint16_t hidden; /* 1 if partition is hidden by default */
893
947
uint32_t max_nodes; /* per job or INFINITE */
942
996
partition_info_t *partition_array; /* the partition records */
943
997
} partition_info_msg_t;
1000
* Resource reservation data structures.
1001
* Create, show, modify and delete functions are required
1003
#define RESERVE_FLAG_MAINT 0x0001 /* Set MAINT flag */
1004
#define RESERVE_FLAG_NO_MAINT 0x0002 /* Clear MAINT flag */
1005
#define RESERVE_FLAG_DAILY 0x0004 /* Set DAILY flag */
1006
#define RESERVE_FLAG_NO_DAILY 0x0008 /* Clear DAILY flag */
1007
#define RESERVE_FLAG_WEEKLY 0x0010 /* Set WEEKLY flag */
1008
#define RESERVE_FLAG_NO_WEEKLY 0x0020 /* Clear WEEKLY flag */
1009
#define RESERVE_FLAG_IGN_JOBS 0x0040 /* Ignore running jobs */
1010
#define RESERVE_FLAG_NO_IGN_JOB 0x0080 /* Clear ignore running jobs */
1011
#define RESERVE_FLAG_SPEC_NODES 0x8000 /* Contains specific nodes */
1013
typedef struct reserve_info {
1014
char *accounts; /* names of accounts permitted to use */
1015
time_t end_time; /* end time of reservation */
1016
char *features; /* required node features */
1017
uint16_t flags; /* see RESERVE_FLAG_* above */
1018
char *name; /* name of reservation */
1019
uint32_t node_cnt; /* count of nodes required */
1020
int *node_inx; /* list index pairs into node_table for *nodes:
1021
* start_range_1, end_range_1,
1022
* start_range_2, .., -1 */
1023
char *node_list; /* list of reserved nodes or ALL */
1024
char *partition; /* name of partition to be used */
1025
time_t start_time; /* start time of reservation */
1026
char *users; /* names of users permitted to use */
1029
typedef struct reserve_info_msg {
1030
time_t last_update; /* time of latest info */
1031
uint32_t record_count; /* number of records */
1032
reserve_info_t *reservation_array; /* the reservation records */
1033
} reserve_info_msg_t;
1035
typedef struct resv_desc_msg {
1036
char *accounts; /* names of accounts permitted to use */
1037
uint32_t duration; /* duration of reservation in seconds */
1038
time_t end_time; /* end time of reservation */
1039
char *features; /* required node features */
1040
uint16_t flags; /* see RESERVE_FLAG_* above */
1041
char *name; /* name of reservation (optional on create) */
1042
uint32_t node_cnt; /* count of nodes required */
1043
char *node_list; /* list of reserved nodes or ALL */
1044
char *partition; /* name of partition to be used */
1045
time_t start_time; /* start time of reservation */
1046
char *users; /* names of users permitted to use */
1049
typedef struct reserve_response_msg {
1050
char *name; /* name of reservation */
1051
} reserve_response_msg_t;
1053
typedef struct reservation_name_msg {
1054
char *name; /* name of reservation just created or
1056
} reservation_name_msg_t;
1059
#define DEBUG_FLAG_SELECT_TYPE 0x00000001 /* SelectType plugin */
1060
#define DEBUG_FLAG_STEPS 0x00000002 /* slurmctld steps */
1061
#define DEBUG_FLAG_TRIGGERS 0x00000004 /* slurmctld triggers */
1062
#define DEBUG_FLAG_CPU_BIND 0x00000008 /* CPU binding */
1063
#define DEBUG_FLAG_WIKI 0x00000010 /* wiki communications */
945
1065
typedef struct slurm_ctl_conf {
946
1066
time_t last_update; /* last update time of the build parameters */
947
1067
uint16_t accounting_storage_enforce; /* job requires valid association:
948
* user/account/partition/cluster */
949
char *accounting_storage_host; /* accounting storage host */
950
char *accounting_storage_loc; /* accounting storage (db table)
952
char *accounting_storage_pass; /* accounting storage
1068
* user/account/partition/cluster */
1069
char *accounting_storage_backup_host; /* accounting storage
1071
char *accounting_storage_host; /* accounting storage host */
1072
char *accounting_storage_loc; /* accounting storage (db table)
1074
char *accounting_storage_pass; /* accounting storage
954
1076
uint32_t accounting_storage_port;/* node accountinging storage port */
955
1077
char *accounting_storage_type; /* accounting storage type */
956
1078
char *accounting_storage_user; /* accounting storage user */
962
1084
uint16_t cache_groups; /* cache /etc/groups to avoid initgroups(2) */
963
1085
char *checkpoint_type; /* checkpoint plugin type */
964
1086
char *cluster_name; /* general name of the entire cluster */
1087
uint16_t complete_wait; /* seconds to wait for job completion before
1088
* scheduling another job */
965
1089
char *control_addr; /* comm path of slurmctld primary server */
966
1090
char *control_machine; /* name of slurmctld primary server */
967
1091
char *crypto_type; /* cryptographic signature plugin */
1092
uint32_t debug_flags; /* see DEBUG_FLAG_* above for values */
968
1093
uint32_t def_mem_per_task; /* default MB memory per spawned task */
969
1094
uint16_t disable_root_jobs; /* if set then user root can't run jobs */
970
1095
uint16_t enforce_part_limits; /* if set, reject job exceeding
972
1097
char *epilog; /* pathname of job epilog */
973
1098
uint32_t epilog_msg_time; /* usecs for slurmctld to process an
974
1099
* epilog complete message */
1100
char *epilog_slurmctld; /* pathname of job epilog run by slurmctld */
975
1101
uint16_t fast_schedule; /* 1 to *not* check configurations by node
976
1102
* (only check configuration file, faster) */
977
1103
uint32_t first_job_id; /* first slurm generated job_id to assign */
978
uint32_t next_job_id; /* next slurm generated job_id to assign */
979
1104
uint16_t get_env_timeout; /* timeout for srun --get-user-env option */
980
1105
uint16_t health_check_interval; /* secs between health checks */
981
1106
char * health_check_program; /* pathname of health check program */
982
1107
uint16_t inactive_limit;/* seconds of inactivity before a
983
1108
* inactive resource allocation is released */
984
char *job_acct_gather_type; /* job accounting gather type */
985
1109
uint16_t job_acct_gather_freq; /* poll frequency for job accounting
986
1110
* gather plugins */
1111
char *job_acct_gather_type; /* job accounting gather type */
1112
char *job_ckpt_dir; /* directory saving job record checkpoint */
987
1113
char *job_comp_host; /* job completion logging host */
988
1114
char *job_comp_loc; /* job completion logging location */
989
1115
char *job_comp_pass; /* job completion storage password */
1003
1132
uint16_t min_job_age; /* COMPLETED jobs over this age (secs)
1004
1133
* purged from in memory records */
1005
1134
char *mpi_default; /* Default version of MPI in use */
1135
char *mpi_params; /* MPI parameters */
1006
1136
uint16_t msg_timeout; /* message timeout */
1137
uint32_t next_job_id; /* next slurm generated job_id to assign */
1007
1138
char *node_prefix; /* prefix of nodes in partition, only set in
1008
1139
bluegene clusters NULL otherwise */
1140
uint16_t over_time_limit; /* job's time limit can be exceeded by this
1141
* number of minutes before cancellation */
1009
1142
char *plugindir; /* pathname to plugins */
1010
char *plugstack; /* pathname to plugin stack config file */
1143
char *plugstack; /* pathname to plugin stack config
1145
uint32_t priority_decay_hl; /* priority decay half life in
1147
uint16_t priority_favor_small; /* favor small jobs over large */
1148
uint32_t priority_max_age; /* time when not to add any more
1149
* priority to a job if reached */
1150
uint16_t priority_reset_period; /* when to clear usage,
1151
* see PRIORITY_RESET_* */
1152
char *priority_type; /* priority type plugin */
1153
uint32_t priority_weight_age; /* weight for age factor */
1154
uint32_t priority_weight_fs; /* weight for Fairshare factor */
1155
uint32_t priority_weight_js; /* weight for Job Size factor */
1156
uint32_t priority_weight_part; /* weight for Partition factor */
1157
uint32_t priority_weight_qos; /* weight for QOS factor */
1011
1158
uint16_t private_data; /* block viewing of information,
1012
1159
* see PRIVATE_DATA_* */
1013
1160
char *proctrack_type; /* process tracking plugin type */
1014
char *prolog; /* pathname of job prolog */
1161
char *prolog; /* pathname of job prolog run by slurmd */
1162
char *prolog_slurmctld; /* pathname of job prolog run by slurmctld */
1015
1163
uint16_t propagate_prio_process; /* 1 if process priority should
1016
1164
* be propagated */
1017
1165
char *propagate_rlimits;/* Propagate (all/specific) resource limits */
1018
1166
char *propagate_rlimits_except;/* Propagate all rlimits except these */
1167
char *resume_program; /* program to make nodes full power */
1019
1168
uint16_t resume_rate; /* nodes to make full power, per minute */
1020
char *resume_program; /* program to make nodes full power */
1169
uint16_t resume_timeout;/* time required in order to perform a node
1170
* resume operation */
1171
uint16_t resv_over_run; /* how long a running job can exceed
1172
* reservation time */
1021
1173
uint16_t ret2service; /* 1 return DOWN node to service at
1022
1174
* registration */
1175
char *salloc_default_command; /* default salloc command */
1023
1176
char *sched_params; /* SchedulerParameters OR
1024
1177
* contents of scheduler plugin config file */
1025
1178
uint16_t sched_time_slice; /* gang scheduler slice time, secs */
1028
1181
uint16_t schedrootfltr; /* 1 if rootOnly partitions should be
1029
1182
* filtered from scheduling (if needed) */
1030
1183
char *select_type; /* type of node selector to use */
1184
void *select_conf_key_pairs; /* key-pair list which can be
1185
* listed with slurm_print_key_pairs */
1031
1186
uint16_t select_type_param; /* Parameters
1032
1187
* describing the select_type plugin */
1033
1188
uint32_t slurm_user_id; /* uid of slurm_user_name */
1034
1189
char *slurm_user_name; /* user that slurmctld runs as */
1190
uint32_t slurmd_user_id;/* uid of slurmd_user_name */
1191
char *slurmd_user_name; /* user that slurmd runs as */
1035
1192
uint16_t slurmctld_debug; /* slurmctld logging level */
1036
1193
char *slurmctld_logfile;/* where slurmctld error log gets written */
1037
1194
char *slurmctld_pidfile;/* where to put slurmctld pidfile */
1055
1213
char *suspend_program; /* program to make nodes power saving */
1056
1214
uint16_t suspend_rate; /* nodes to make power saving, per minute */
1057
1215
uint16_t suspend_time; /* node idle for this long before power save mode */
1216
uint16_t suspend_timeout;/* time required in order to perform a node
1217
* suspend operation */
1058
1218
char *switch_type; /* switch or interconnect type */
1059
1219
char *task_epilog; /* pathname of task launch epilog */
1060
1220
char *task_plugin; /* task launch plugin */
1061
1221
uint16_t task_plugin_param; /* see TASK_PARAM_* */
1062
1222
char *task_prolog; /* pathname of task launch prolog */
1063
1223
char *tmp_fs; /* pathname of temporary file system */
1224
char *topology_plugin; /* network topology plugin */
1064
1225
uint16_t track_wckey; /* see if we are using wckey or not */
1065
1226
uint16_t tree_width; /* number of threads per node to span */
1066
1227
char *unkillable_program; /* program run by the slurmstepd when
1556
1718
void slurm_print_slurmd_status PARAMS((
1557
1719
FILE* out, slurmd_status_t * slurmd_status_ptr));
1722
* slurm_print_key_pairs - output the contents of key_pairs
1723
* which is a list of opaque data type config_key_pair_t
1724
* IN out - file to write to
1725
* IN key_pairs - List contianing key pairs to be printed
1726
* IN title - title of key pair list
1728
void slurm_print_key_pairs PARAMS((
1729
FILE* out, void* key_pairs, char *title));
1559
1731
/*****************************************************************************\
1560
1732
* SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
1561
1733
\*****************************************************************************/
1816
1994
/*****************************************************************************\
1995
* SLURM SWITCH TOPOLOGY CONFIGURATION READ/PRINT FUNCTIONS
1996
\*****************************************************************************/
1999
* slurm_load_topo - issue RPC to get slurm all switch topology configuration
2001
* IN node_info_msg_pptr - place to store a node configuration pointer
2002
* RET 0 or a slurm error code
2003
* NOTE: free the response using slurm_free_topo_info_msg
2005
extern int slurm_load_topo PARAMS((
2006
topo_info_response_msg_t **topo_info_msg_pptr ));
2009
* slurm_free_topo_info_msg - free the switch topology configuration
2010
* information response message
2011
* IN msg - pointer to switch topology configuration response message
2012
* NOTE: buffer is loaded by slurm_load_topo.
2014
extern void slurm_free_topo_info_msg PARAMS(( topo_info_response_msg_t *msg ));
2017
* slurm_print_topo_info_msg - output information about all switch topology
2018
* configuration information based upon message as loaded using
2020
* IN out - file to write to
2021
* IN topo_info_msg_ptr - switch topology information message pointer
2022
* IN one_liner - print as a single line if not zero
2024
extern void slurm_print_topo_info_msg PARAMS((
2025
FILE * out, topo_info_response_msg_t *topo_info_msg_ptr, int one_liner )) ;
2028
* slurm_print_topo_record - output information about a specific Slurm topology
2029
* record based upon message as loaded using slurm_load_topo
2030
* IN out - file to write to
2031
* IN topo_ptr - an individual switch information record pointer
2032
* IN one_liner - print as a single line if not zero
2033
* RET out - char * containing formatted output (must be freed after call)
2034
* NULL is returned on failure.
2036
extern void slurm_print_topo_record PARAMS((FILE * out, topo_info_t *topo_ptr,
2038
/*****************************************************************************\
1817
2039
* SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
1818
2040
\*****************************************************************************/
1821
2043
* slurm_init_part_desc_msg - initialize partition descriptor with
1822
2044
* default values
1823
* OUT job_desc_msg - user defined partition descriptor
2045
* IN/OUT update_part_msg - user defined partition descriptor
1825
2047
extern void slurm_init_part_desc_msg PARAMS((update_part_msg_t * update_part_msg ));
1894
2124
extern int slurm_delete_partition PARAMS(( delete_part_msg_t * part_msg ));
1896
2126
/*****************************************************************************\
2127
* SLURM RESERVATION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
2128
\*****************************************************************************/
2131
* slurm_init_resv_desc_msg - initialize reservation descriptor with
2133
* OUT job_desc_msg - user defined partition descriptor
2135
extern void slurm_init_resv_desc_msg PARAMS((
2136
resv_desc_msg_t * update_resv_msg ));
2138
* slurm_create_reservation - create a new reservation, only usable by user root
2139
* IN resv_msg - description of reservation
2140
* RET name of reservation on success (caller must free the memory),
2141
* otherwise return NULL and set errno to indicate the error
2143
extern char * slurm_create_reservation PARAMS((
2144
resv_desc_msg_t * resv_msg ));
2147
* slurm_update_reservation - modify an existing reservation, only usable by
2149
* IN resv_msg - description of reservation
2150
* RET 0 on success, otherwise return -1 and set errno to indicate the error
2152
extern int slurm_update_reservation PARAMS((resv_desc_msg_t * resv_msg));
2155
* slurm_delete_reservation - issue RPC to delete a reservation, only usable
2157
* IN resv_msg - description of reservation to delete
2158
* RET 0 on success, otherwise return -1 and set errno to indicate the error
2160
extern int slurm_delete_reservation PARAMS((
2161
reservation_name_msg_t * resv_msg ));
2164
* slurm_load_reservations - issue RPC to get all slurm reservation
2165
* configuration information if changed since update_time
2166
* IN update_time - time of current configuration data
2167
* IN reserve_info_msg_pptr - place to store a reservation configuration
2169
* RET 0 or a slurm error code
2170
* NOTE: free the response using slurm_free_reservation_info_msg
2172
extern int slurm_load_reservations PARAMS(( time_t update_time,
2173
reserve_info_msg_t **resp ));
2176
* slurm_print_reservation_info_msg - output information about all Slurm
2177
* reservations based upon message as loaded using slurm_load_reservation
2178
* IN out - file to write to
2179
* IN resv_info_ptr - reservation information message pointer
2180
* IN one_liner - print as a single line if true
2182
void slurm_print_reservation_info_msg PARAMS(( FILE* out,
2183
reserve_info_msg_t * resv_info_ptr, int one_liner ));
2186
* slurm_print_reservation_info - output information about a specific Slurm
2187
* reservation based upon message as loaded using slurm_load_reservation
2188
* IN out - file to write to
2189
* IN resv_ptr - an individual reservation information record pointer
2190
* IN one_liner - print as a single line if true
2192
void slurm_print_reservation_info PARAMS(( FILE* out,
2193
reserve_info_t * resv_ptr, int one_liner ));
2196
* slurm_sprint_reservation_info - output information about a specific Slurm
2197
* reservation based upon message as loaded using slurm_load_reservations
2198
* IN resv_ptr - an individual reservation information record pointer
2199
* IN one_liner - print as a single line if true
2200
* RET out - char * containing formatted output (must be freed after call)
2201
* NULL is returned on failure.
2203
char *slurm_sprint_reservation_info PARAMS(( reserve_info_t * resv_ptr,
2207
* slurm_free_reservation_info_msg - free the reservation information
2209
* IN msg - pointer to reservation information response message
2210
* NOTE: buffer is loaded by slurm_load_reservation
2212
extern void slurm_free_reservation_info_msg PARAMS((
2213
reserve_info_msg_t * resv_info_ptr ));
2215
/*****************************************************************************\
1897
2216
* SLURM PING/RECONFIGURE/SHUTDOWN FUNCTIONS
1898
2217
\*****************************************************************************/
2006
2336
* IN job_id - job on which to perform operation
2007
2337
* IN step_id - job step on which to perform operation
2008
2338
* IN max_wait - maximum wait for operation to complete, in seconds
2339
* IN image_dir - directory to store image files
2009
2340
* RET 0 or a slurm error code
2011
2342
extern int slurm_checkpoint_vacate PARAMS(( uint32_t job_id,
2012
uint32_t step_id, uint16_t max_wait ));
2015
2348
* slurm_checkpoint_restart - restart execution of a checkpointed job step.
2016
2349
* IN job_id - job on which to perform operation
2017
2350
* IN step_id - job step on which to perform operation
2351
* IN stick - stick to nodes previously running on
2352
* IN image_dir - directory to find checkpoint image files
2018
2353
* RET 0 or a slurm error code
2020
2355
extern int slurm_checkpoint_restart PARAMS(( uint32_t job_id,
2021
uint32_t step_id ));
2024
2361
* slurm_checkpoint_complete - note the completion of a job step's checkpoint
2062
2404
* must be freed by the caller to prevent memory leak
2063
2405
* RET 0 or a slurm error code
2065
extern int slurm_checkpoint_error PARAMS(( uint32_t job_id,
2066
uint32_t step_id, uint32_t *error_code,
2067
char **error_msg ));
2407
extern int slurm_checkpoint_error PARAMS(( uint32_t job_id, uint32_t step_id,
2408
uint32_t *error_code,
2409
char **error_msg ));
2070
* slurm_get_checkpoint_file_path - return the checkpoint file
2071
* path of this process, creating the directory if needed.
2072
* IN len: length of the file path buffer
2073
* OUT buf: buffer to store the checkpoint file path
2074
* RET: 0 on success, -1 on failure with errno set
2412
* slurm_checkpoint_tasks - send checkpoint request to tasks of
2414
* IN job_id: job ID of step
2415
* IN step_id: step ID of step
2416
* IN image_dir: location to store ckpt images. parameter to plugin.
2417
* IN max_wait: seconds to wait for the operation to complete
2418
* IN nodelist: nodes to send the request
2419
* RET: 0 on success, non-zero on failure with errno set
2076
extern int slurm_get_checkpoint_file_path(size_t len, char *buf);
2421
extern int slurm_checkpoint_tasks PARAMS(( uint32_t job_id, uint16_t step_id,
2422
time_t begin_time, char *image_dir,
2423
uint16_t max_wait, char *nodelist));
2078
2426
/*****************************************************************************\
2079
2427
* SLURM HOSTLIST FUNCTIONS
2124
2472
extern hostlist_t slurm_hostlist_create PARAMS(( const char *hostlist ));
2474
/* slurm_hostlist_count():
2476
* Return the number of hosts in hostlist hl.
2478
extern int slurm_hostlist_count PARAMS((hostlist_t hl));
2481
* slurm_hostlist_destroy():
2483
* Destroy a hostlist object. Frees all memory allocated to the hostlist.
2485
extern void slurm_hostlist_destroy PARAMS(( hostlist_t hl ));
2487
/* slurm_hostlist_find():
2489
* Searches hostlist hl for the first host matching hostname
2490
* and returns position in list if found.
2492
* Returns -1 if host is not found.
2495
extern int slurm_hostlist_find PARAMS((hostlist_t hl, const char *hostname));
2497
/* slurm_hostlist_push():
2499
* push a string representation of hostnames onto a hostlist.
2501
* The hosts argument may take the same form as in slurm_hostlist_create()
2503
* Returns the number of hostnames inserted into the list,
2506
extern int slurm_hostlist_push PARAMS((hostlist_t hl, const char *hosts));
2508
/* slurm_hostlist_push_host():
2510
* Push a single host onto the hostlist hl.
2511
* This function is more efficient than slurm_hostlist_push() for a single
2512
* hostname, since the argument does not need to be checked for ranges.
2514
* return value is 1 for success, 0 for failure.
2516
extern int slurm_hostlist_push_host PARAMS((hostlist_t hl, const char *host));
2518
/* slurm_hostlist_ranged_string():
2520
* Write the string representation of the hostlist hl into buf,
2521
* writing at most n chars. Returns the number of bytes written,
2522
* or -1 if truncation occurred.
2524
* The result will be NULL terminated.
2526
* slurm_hostlist_ranged_string() will write a bracketed hostlist representation
2529
extern ssize_t slurm_hostlist_ranged_string PARAMS((hostlist_t hl,
2530
size_t n, char *buf));
2127
2533
* slurm_hostlist_shift():