~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to slurm/slurm.h.in

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 *  LLNL-CODE-402394.
 
9
 *  CODE-OCEC-09-009. All rights reserved.
10
10
 *  
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.
13
14
 *  
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 */
134
135
#endif
135
136
 
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 */
140
143
#endif
141
144
 
142
145
/* Define jobacctinfo_t below to avoid including extraneous slurm headers */
179
182
/* eg. the maximum count of nodes any job may use in some partition */
180
183
#define INFINITE (0xffffffff)
181
184
#define NO_VAL   (0xfffffffe)
182
 
#define MAX_TASKS_PER_NODE 64
 
185
#define MAX_TASKS_PER_NODE 128
183
186
 
184
187
/* Job step ID of batch scripts */
185
188
#define SLURM_BATCH_SCRIPT (0xfffffffe)
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 */
225
231
        WAIT_TBD1,
226
232
        WAIT_TBD2,
227
233
        FAIL_DOWN_PARTITION,    /* partition for job is DOWN */
281
287
        SELECT_DATA_MLOADER_IMAGE,/* data-> char *mloaderimage */
282
288
        SELECT_DATA_RAMDISK_IMAGE,/* data-> char *ramdiskimage */
283
289
        SELECT_DATA_REBOOT,     /* data-> uint16_t reboot */
 
290
        SELECT_DATA_RESV_ID,    /* data-> char *reservation_id */
284
291
};
285
292
 
286
293
enum select_print_mode {
299
306
        SELECT_PRINT_MLOADER_IMAGE,/* Print just the MLOADER IMAGE */
300
307
        SELECT_PRINT_RAMDISK_IMAGE,/* Print just the RAMDISK IMAGE */
301
308
        SELECT_PRINT_REBOOT,    /* Print just the REBOOT */
 
309
        SELECT_PRINT_RESV_ID,   /* Print just Cray/BASIL reservation ID */
302
310
};
303
311
 
304
312
enum select_node_cnt {
356
364
#define OPEN_MODE_TRUNCATE      2
357
365
 
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> */
 
383
        
 
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;
372
388
 
373
389
typedef enum mem_bind_type {    /* memory binding type from --mem_bind=... */
392
408
        NODE_STATE_DOWN,        /* node in non-usable state */
393
409
        NODE_STATE_IDLE,        /* node idle and available for use */
394
410
        NODE_STATE_ALLOCATED,   /* node has been allocated to a job */
 
411
        NODE_STATE_FUTURE,      /* node slot reserved for future use */
395
412
        NODE_STATE_END          /* last entry in table */
396
413
};
397
414
#define NODE_STATE_BASE       0x00ff
406
423
#define NODE_STATE_POWER_SAVE 0x1000    /* node in power save mode */
407
424
#define NODE_STATE_FAIL       0x2000    /* node is failing, do not allocate
408
425
                                         * new work */
 
426
#define NODE_STATE_POWER_UP   0x4000    /* restore power to a node */
 
427
#define NODE_STATE_MAINT      0x8000    /* node in maintenance reservation */
409
428
 
410
429
/* used to define the size of the credential.signature size
411
430
 * used to define the key size of the io_stream_header_t
447
466
        CR_CPU_MEMORY     /* CPU and Memory are CRs */
448
467
} select_type_plugin_info_t ;
449
468
 
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
454
 
 
455
469
#define MEM_PER_CPU  0x80000000
456
470
#define SHARED_FORCE 0x8000
457
471
 
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 */
 
479
 
 
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 */
464
487
 
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, 
 
538
                                 * for batch only */
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 */
522
552
        char *req_nodes;        /* comma separated list of required nodes
523
553
                                 * default NONE */
524
554
        uint16_t requeue;       /* enable or disable job requeue option */
525
 
 
 
555
        char *reservation;      /* name of reservation to use */
526
556
        char *script;           /* the actual job script, default NONE */
527
557
        uint16_t shared;        /* 1 if job can share nodes with other jobs,
528
558
                                 * 0 if job needs exclusive access to the node,
588
618
/* End of Blue Gene specific values */
589
619
 
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;
593
624
 
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 */
627
668
        uint16_t ntasks_per_core;/* number of tasks to invoke on each core */
628
669
        uint16_t ntasks_per_node;/* number of tasks to invoke on each node */
629
670
        uint16_t ntasks_per_socket;/* number of tasks to invoke on each socket */
 
671
        uint32_t num_cpu_groups;/* elements in cpu arrays below */
 
672
 
 
673
        uint32_t num_nodes;     /* minimum number of nodes required by job */
 
674
        uint32_t num_procs;     /* number of processors required by job */
630
675
        char *partition;        /* name of assigned partition */
631
676
        time_t pre_sus_time;    /* time job ran prior to last suspend */
632
677
        uint32_t priority;      /* relative priority of the 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 */
650
 
 
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 */
663
699
} job_info_t;
664
700
 
665
701
typedef struct job_info_msg {
670
706
 
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 */
674
 
 
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 */
678
714
        uint16_t *tasks;
679
 
 
 
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 */
684
 
 
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;
689
722
 
690
723
typedef struct slurm_step_io_fds {
739
772
 
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;
745
778
 
 
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;
 
784
 
746
785
typedef struct {
 
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 */
748
 
        uid_t uid;
 
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 =
757
 
                                   SLURM_DIST_PLANE */
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
771
 
                                   launch api */
772
 
 
773
 
        uint16_t mem_per_task;  /* memory required per task (MB), 0=no limit */
 
813
                                 * launch api */
774
814
} slurm_step_ctx_params_t;
775
815
 
776
816
typedef struct {
806
846
        uint16_t max_cores;
807
847
        uint16_t max_threads;
808
848
        uint16_t cpus_per_task;
809
 
        uint16_t ntasks_per_node;
810
 
        uint16_t ntasks_per_socket;
811
 
        uint16_t ntasks_per_core;
812
849
        uint16_t task_dist;
813
 
        uint16_t plane_size;
 
850
        bool preserve_env;
814
851
 
815
852
        char *mpi_plugin_name;
816
853
        uint8_t open_mode;
817
854
        uint16_t acctg_freq;
818
855
        bool pty;
819
 
        char *ckpt_path;
 
856
        char *ckpt_dir;
 
857
        char *restart_dir;
820
858
} slurm_step_launch_params_t;
821
859
 
822
860
typedef struct {
833
871
} slurm_allocation_callbacks_t;
834
872
 
835
873
typedef struct {
 
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;
852
891
 
853
892
typedef struct job_step_info_response_msg {
857
896
} job_step_info_response_msg_t;
858
897
 
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 
863
902
                                 * the node */
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 */
875
914
} node_info_t;
876
915
 
877
916
typedef struct node_info_msg {
880
919
        node_info_t *node_array;        /* the node records */
881
920
} node_info_msg_t;
882
921
 
 
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 */
 
928
} topo_info_t;
 
929
 
 
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;
 
934
 
883
935
typedef struct job_alloc_info_msg {
884
936
        uint32_t job_id;        /* job ID */
885
937
} job_alloc_info_msg_t;
886
938
 
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 */
914
968
typedef struct resource_allocation_response_msg {
915
969
        uint32_t job_id;        /* assigned job id */
916
970
        char *node_list;        /* assigned list of nodes */
917
 
        uint16_t num_cpu_groups;/* elements in below cpu arrays */
918
 
        uint32_t *cpus_per_node;/* cpus per node */
 
971
        uint32_t num_cpu_groups;/* elements in below cpu arrays */
 
972
        uint16_t *cpus_per_node;/* cpus per node */
919
973
        uint32_t *cpu_count_reps;/* how many nodes have same cpu count */
920
974
        uint32_t node_cnt;      /* count of nodes */
921
975
        uint32_t error_code;    /* error code for warning message */
926
980
typedef struct job_alloc_info_response_msg {
927
981
        uint32_t job_id;        /* assigned job id */
928
982
        char *node_list;        /* assigned list of nodes */
929
 
        uint16_t num_cpu_groups;/* elements in below cpu arrays */
930
 
        uint32_t *cpus_per_node;/* cpus per node */
 
983
        uint32_t num_cpu_groups;/* elements in below cpu arrays */
 
984
        uint16_t *cpus_per_node;/* cpus per node */
931
985
        uint32_t *cpu_count_reps;/* how many nodes have same cpu count */
932
986
        uint32_t node_cnt;      /* count of nodes */
933
987
        slurm_addr *node_addr;  /* network addresses */
942
996
        partition_info_t *partition_array; /* the partition records */
943
997
} partition_info_msg_t;
944
998
 
 
999
/*
 
1000
 * Resource reservation data structures.
 
1001
 * Create, show, modify and delete functions are required
 
1002
 */
 
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 */
 
1012
 
 
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 */
 
1027
} reserve_info_t;
 
1028
 
 
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;
 
1034
 
 
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 */
 
1047
} resv_desc_msg_t;
 
1048
 
 
1049
typedef struct reserve_response_msg {
 
1050
        char *name;             /* name of reservation */
 
1051
} reserve_response_msg_t;
 
1052
 
 
1053
typedef struct reservation_name_msg {
 
1054
        char *name;             /* name of reservation just created or
 
1055
                                 * to be delete */
 
1056
} reservation_name_msg_t;
 
1057
 
 
1058
 
 
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 */
 
1064
 
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)
951
 
                                       * location */
952
 
        char *accounting_storage_pass; /* accounting storage
953
 
                                            password */
 
1068
                                         * user/account/partition/cluster */
 
1069
        char *accounting_storage_backup_host;   /* accounting storage
 
1070
                                                 * backup host */
 
1071
        char *accounting_storage_host;  /* accounting storage host */
 
1072
        char *accounting_storage_loc;   /* accounting storage (db table)
 
1073
                                         * location */
 
1074
        char *accounting_storage_pass;  /* accounting storage
 
1075
                                         * password */
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 */
994
1120
        char *job_credential_public_certificate;/* path to public certificate*/
995
1121
        uint16_t job_file_append; /* if set, append to stdout/err file */
996
1122
        uint16_t job_requeue;   /* If set, jobs get requeued on node failre */
 
1123
        uint16_t kill_on_bad_exit; /* If set, the job will be
 
1124
                                 * terminated immediately when one of
 
1125
                                 * the processes is aborted or crashed */ 
997
1126
        uint16_t kill_wait;     /* seconds between SIGXCPU to SIGKILL 
998
1127
                                 * on job termination */
999
1128
        char *licenses;         /* licenses available on this cluster */
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
 
1144
                                 * file */
 
1145
        uint32_t priority_decay_hl; /* priority decay half life in
 
1146
                                     * seconds */
 
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         */
1047
1204
                                 * considering node DOWN */
1048
1205
        char *slurm_conf;       /* pathname of slurm config file */
1049
1206
        char *srun_epilog;      /* srun epilog program */
 
1207
        uint16_t srun_io_timeout; /* timeout for non-responsive tasks */
1050
1208
        char *srun_prolog;      /* srun prolog program */
1051
1209
        char *state_save_location;/* pathname of slurmctld state save
1052
1210
                                 * directory */
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
1070
1231
                                      * they are considered "unkillable". */
1071
1232
        uint16_t use_pam;       /* enable/disable PAM support */
1072
1233
        uint16_t wait_time;     /* default job --wait time */
1073
 
        char *salloc_default_command; /* default salloc command */
 
1234
        uint16_t z_16;          /* reserved for future use */
 
1235
        uint32_t z_32;          /* reserved for future use */
 
1236
        char *z_char;           /* reserved for future use */
1074
1237
} slurm_ctl_conf_t;
1075
1238
 
1076
1239
typedef struct slurmd_status_msg {
1101
1264
        uint16_t node_state;    /* see enum node_states */
1102
1265
        char *reason;           /* reason for node being DOWN or DRAINING */
1103
1266
        char *features;         /* new feature for node */
 
1267
        uint32_t weight;        /* new weight for node */
1104
1268
} update_node_msg_t;
1105
1269
 
1106
1270
typedef struct partition_info update_part_msg_t;
1457
1621
/*
1458
1622
 * slurm_step_launch - launch a parallel job step
1459
1623
 * IN ctx - job step context generated by slurm_step_ctx_create
1460
 
 * IN launcher_host - address used for PMI communications
1461
1624
 * IN callbacks - Identify functions to be called when various events occur
1462
1625
 * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
1463
1626
 */
1464
1627
extern int slurm_step_launch PARAMS((slurm_step_ctx_t *ctx,
1465
 
        char *launcher_host,
1466
1628
        const slurm_step_launch_params_t *params,
1467
1629
        const slurm_step_launch_callbacks_t *callbacks));
1468
1630
 
1556
1718
void slurm_print_slurmd_status PARAMS((
1557
1719
                FILE* out, slurmd_status_t * slurmd_status_ptr));
1558
1720
 
 
1721
/*
 
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
 
1727
 */
 
1728
void slurm_print_key_pairs PARAMS((
 
1729
                FILE* out, void* key_pairs, char *title));
 
1730
 
1559
1731
/*****************************************************************************\
1560
1732
 *      SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
1561
1733
\*****************************************************************************/
1805
1977
                                             int one_liner ));
1806
1978
 
1807
1979
/*
 
1980
 * slurm_init_update_node_msg - initialize node update message
 
1981
 * OUT update_node_msg - user defined node descriptor
 
1982
 */
 
1983
void slurm_init_update_node_msg (update_node_msg_t * update_node_msg);
 
1984
 
 
1985
/*
1808
1986
 * slurm_update_node - issue RPC to a node's configuration per request, 
1809
1987
 *      only usable by user root
1810
1988
 * IN node_msg - description of node updates
1814
1992
 
1815
1993
 
1816
1994
/*****************************************************************************\
 
1995
 *      SLURM SWITCH TOPOLOGY CONFIGURATION READ/PRINT FUNCTIONS
 
1996
\*****************************************************************************/
 
1997
 
 
1998
/*
 
1999
 * slurm_load_topo - issue RPC to get slurm all switch topology configuration 
 
2000
 *      information 
 
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
 
2004
 */
 
2005
extern int slurm_load_topo PARAMS(( 
 
2006
        topo_info_response_msg_t **topo_info_msg_pptr ));
 
2007
 
 
2008
/*
 
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.
 
2013
 */
 
2014
extern void slurm_free_topo_info_msg PARAMS(( topo_info_response_msg_t *msg ));
 
2015
 
 
2016
/*
 
2017
 * slurm_print_topo_info_msg - output information about all switch topology 
 
2018
 *      configuration information based upon message as loaded using 
 
2019
 *      slurm_load_topo
 
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
 
2023
 */
 
2024
extern void slurm_print_topo_info_msg PARAMS(( 
 
2025
        FILE * out, topo_info_response_msg_t *topo_info_msg_ptr, int one_liner )) ;
 
2026
 
 
2027
/*
 
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.
 
2035
 */
 
2036
extern void slurm_print_topo_record PARAMS((FILE * out, topo_info_t *topo_ptr, 
 
2037
                                    int one_liner ));
 
2038
/*****************************************************************************\
1817
2039
 *      SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
1818
2040
\*****************************************************************************/
1819
2041
 
1820
2042
/* 
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
1824
2046
 */
1825
2047
extern void slurm_init_part_desc_msg PARAMS((update_part_msg_t * update_part_msg ));
1826
2048
 
1877
2099
 */
1878
2100
extern char *slurm_sprint_partition_info PARAMS(( 
1879
2101
                partition_info_t * part_ptr, int one_liner ));
 
2102
 
 
2103
/*
 
2104
 * slurm_create_partition - create a new partition, only usable by user root
 
2105
 * IN part_msg - description of partition configuration
 
2106
 * RET 0 on success, otherwise return -1 and set errno to indicate the error
 
2107
 */
 
2108
extern int slurm_create_partition PARAMS(( update_part_msg_t * part_msg ));
 
2109
 
1880
2110
/*
1881
2111
 * slurm_update_partition - issue RPC to update a partition's configuration
1882
2112
 *      per request, only usable by user root
1894
2124
extern int slurm_delete_partition PARAMS(( delete_part_msg_t * part_msg ));
1895
2125
 
1896
2126
/*****************************************************************************\
 
2127
 *      SLURM RESERVATION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 
2128
\*****************************************************************************/
 
2129
 
 
2130
/*
 
2131
 * slurm_init_resv_desc_msg - initialize reservation descriptor with 
 
2132
 *      default values 
 
2133
 * OUT job_desc_msg - user defined partition descriptor
 
2134
 */
 
2135
extern void slurm_init_resv_desc_msg PARAMS(( 
 
2136
                resv_desc_msg_t * update_resv_msg ));
 
2137
/*
 
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
 
2142
 */
 
2143
extern char * slurm_create_reservation PARAMS((
 
2144
                resv_desc_msg_t * resv_msg ));
 
2145
 
 
2146
/*
 
2147
 * slurm_update_reservation - modify an existing reservation, only usable by 
 
2148
 *      user root
 
2149
 * IN resv_msg - description of reservation
 
2150
 * RET 0 on success, otherwise return -1 and set errno to indicate the error
 
2151
 */
 
2152
extern int slurm_update_reservation PARAMS((resv_desc_msg_t * resv_msg));
 
2153
 
 
2154
/*
 
2155
 * slurm_delete_reservation - issue RPC to delete a reservation, only usable 
 
2156
 *      by user root
 
2157
 * IN resv_msg - description of reservation to delete
 
2158
 * RET 0 on success, otherwise return -1 and set errno to indicate the error
 
2159
 */
 
2160
extern int slurm_delete_reservation PARAMS(( 
 
2161
                reservation_name_msg_t * resv_msg ));
 
2162
 
 
2163
/*
 
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 
 
2168
 *      pointer
 
2169
 * RET 0 or a slurm error code
 
2170
 * NOTE: free the response using slurm_free_reservation_info_msg
 
2171
 */
 
2172
extern int slurm_load_reservations PARAMS(( time_t update_time, 
 
2173
                reserve_info_msg_t **resp ));
 
2174
 
 
2175
/*
 
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
 
2181
 */
 
2182
void slurm_print_reservation_info_msg PARAMS(( FILE* out, 
 
2183
                reserve_info_msg_t * resv_info_ptr, int one_liner ));
 
2184
 
 
2185
/*
 
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
 
2191
 */
 
2192
void slurm_print_reservation_info PARAMS(( FILE* out, 
 
2193
                reserve_info_t * resv_ptr, int one_liner ));
 
2194
 
 
2195
/*
 
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.
 
2202
 */
 
2203
char *slurm_sprint_reservation_info PARAMS(( reserve_info_t * resv_ptr, 
 
2204
                int one_liner ));
 
2205
 
 
2206
/*
 
2207
 * slurm_free_reservation_info_msg - free the reservation information 
 
2208
 *      response message
 
2209
 * IN msg - pointer to reservation information response message
 
2210
 * NOTE: buffer is loaded by slurm_load_reservation
 
2211
 */
 
2212
extern void slurm_free_reservation_info_msg PARAMS(( 
 
2213
        reserve_info_msg_t * resv_info_ptr ));
 
2214
 
 
2215
/*****************************************************************************\
1897
2216
 *      SLURM PING/RECONFIGURE/SHUTDOWN FUNCTIONS
1898
2217
\*****************************************************************************/
1899
2218
 
1923
2242
extern int slurm_shutdown PARAMS(( uint16_t options ));
1924
2243
 
1925
2244
/*
 
2245
 * slurm_takeover - issue RPC to have Slurm backup controller (slurmctld)
 
2246
 *      take over the primary controller.
 
2247
 *
 
2248
 * RET 0 or a slurm error code
 
2249
 */
 
2250
extern int slurm_takeover PARAMS(( void ));
 
2251
 
 
2252
/*
1926
2253
 * slurm_set_debug_level - issue RPC to set slurm controller debug level
1927
2254
 * IN debug_level - requested debug level
1928
2255
 * RET 0 on success, otherwise return -1 and set errno to indicate the error
1987
2314
 * RET 0 or a slurm error code
1988
2315
 */
1989
2316
extern int slurm_checkpoint_enable PARAMS(( uint32_t job_id, 
1990
 
                uint32_t step_id ));
 
2317
                                            uint32_t step_id ));
1991
2318
 
1992
2319
/*
1993
2320
 * slurm_checkpoint_create - initiate a checkpoint requests for some job step.
1995
2322
 * IN job_id  - job on which to perform operation
1996
2323
 * IN step_id - job step on which to perform operation
1997
2324
 * IN max_wait - maximum wait for operation to complete, in seconds
 
2325
 * IN image_dir - directory to store image files
1998
2326
 * RET 0 or a slurm error code
1999
2327
 */
2000
2328
extern int slurm_checkpoint_create PARAMS(( uint32_t job_id, 
2001
 
                uint32_t step_id, uint16_t max_wait ));
 
2329
                                            uint32_t step_id, 
 
2330
                                            uint16_t max_wait, 
 
2331
                                            char *image_dir ));
2002
2332
 
2003
2333
/*
2004
2334
 * slurm_checkpoint_vacate - initiate a checkpoint requests for some job step.
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
2010
2341
 */
2011
2342
extern int slurm_checkpoint_vacate PARAMS(( uint32_t job_id, 
2012
 
                uint32_t step_id, uint16_t max_wait ));
 
2343
                                            uint32_t step_id, 
 
2344
                                            uint16_t max_wait, 
 
2345
                                            char *image_dir ));
2013
2346
 
2014
2347
/*
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
2019
2354
 */
2020
2355
extern int slurm_checkpoint_restart PARAMS(( uint32_t job_id, 
2021
 
                uint32_t step_id ));
 
2356
                                             uint32_t step_id, 
 
2357
                                             uint16_t stick, 
 
2358
                                             char *image_dir ));
2022
2359
 
2023
2360
/*
2024
2361
 * slurm_checkpoint_complete - note the completion of a job step's checkpoint
2031
2368
 * RET 0 or a slurm error code
2032
2369
 */
2033
2370
extern int slurm_checkpoint_complete PARAMS(( uint32_t job_id, 
2034
 
                uint32_t step_id, time_t begin_time, 
2035
 
                uint32_t error_code, char *error_msg ));
 
2371
                                              uint32_t step_id, 
 
2372
                                              time_t begin_time, 
 
2373
                                              uint32_t error_code, 
 
2374
                                              char *error_msg ));
2036
2375
 
2037
2376
/*
2038
2377
 * slurm_checkpoint_task_complete - note the completion of a task's checkpoint
2045
2384
 * IN error_msg - error message, preserved for highest error_code
2046
2385
 * RET 0 or a slurm error code
2047
2386
 */
2048
 
extern int slurm_checkpoint_task_complete (uint32_t job_id, uint32_t step_id,
2049
 
                                           uint32_t task_id, time_t begin_time, 
2050
 
                                           uint32_t error_code, char *error_msg);
 
2387
extern int slurm_checkpoint_task_complete PARAMS(( uint32_t job_id, 
 
2388
                                                   uint32_t step_id,
 
2389
                                                   uint32_t task_id, 
 
2390
                                                   time_t begin_time, 
 
2391
                                                   uint32_t error_code, 
 
2392
                                                   char *error_msg ));
2051
2393
 
2052
2394
/*
2053
2395
 * slurm_checkpoint_error - gather error information for the last checkpoint
2062
2404
 *      must be freed by the caller to prevent memory leak
2063
2405
 * RET 0 or a slurm error code
2064
2406
 */
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 ));
2068
2410
 
2069
2411
/*
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
 
2413
 *     specified step
 
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
2075
2420
 */
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));
 
2424
 
2077
2425
 
2078
2426
/*****************************************************************************\
2079
2427
 *      SLURM HOSTLIST FUNCTIONS
2123
2471
 */
2124
2472
extern hostlist_t slurm_hostlist_create PARAMS(( const char *hostlist ));
2125
2473
 
 
2474
/* slurm_hostlist_count():
 
2475
 *
 
2476
 * Return the number of hosts in hostlist hl.
 
2477
 */ 
 
2478
extern int slurm_hostlist_count PARAMS((hostlist_t hl));
 
2479
 
 
2480
/*
 
2481
 * slurm_hostlist_destroy():
 
2482
 *
 
2483
 * Destroy a hostlist object. Frees all memory allocated to the hostlist.
 
2484
 */
 
2485
extern void slurm_hostlist_destroy PARAMS(( hostlist_t hl ));
 
2486
 
 
2487
/* slurm_hostlist_find():
 
2488
 *
 
2489
 * Searches hostlist hl for the first host matching hostname 
 
2490
 * and returns position in list if found. 
 
2491
 *
 
2492
 * Returns -1 if host is not found.
 
2493
 *
 
2494
 */
 
2495
extern int slurm_hostlist_find PARAMS((hostlist_t hl, const char *hostname));
 
2496
 
 
2497
/* slurm_hostlist_push():
 
2498
 *
 
2499
 * push a string representation of hostnames onto a hostlist.
 
2500
 *
 
2501
 * The hosts argument may take the same form as in slurm_hostlist_create()
 
2502
 *
 
2503
 * Returns the number of hostnames inserted into the list, 
 
2504
 * or 0 on failure.
 
2505
 */
 
2506
extern int slurm_hostlist_push PARAMS((hostlist_t hl, const char *hosts));
 
2507
 
 
2508
/* slurm_hostlist_push_host():
 
2509
 *
 
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.
 
2513
 *
 
2514
 * return value is 1 for success, 0 for failure.
 
2515
 */
 
2516
extern int slurm_hostlist_push_host PARAMS((hostlist_t hl, const char *host));
 
2517
 
 
2518
/* slurm_hostlist_ranged_string():
 
2519
 *
 
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.
 
2523
 *
 
2524
 * The result will be NULL terminated.
 
2525
 * 
 
2526
 * slurm_hostlist_ranged_string() will write a bracketed hostlist representation
 
2527
 * where possible.
 
2528
 */
 
2529
extern ssize_t slurm_hostlist_ranged_string PARAMS((hostlist_t hl,
 
2530
                                                    size_t n, char *buf));
 
2531
 
2126
2532
/*
2127
2533
 * slurm_hostlist_shift():
2128
2534
 *
2134
2540
 */
2135
2541
extern char * slurm_hostlist_shift PARAMS(( hostlist_t hl ));
2136
2542
 
2137
 
/*
2138
 
 * slurm_hostlist_destroy():
 
2543
/* slurm_hostlist_uniq():
2139
2544
 *
2140
 
 * Destroy a hostlist object. Frees all memory allocated to the hostlist.
 
2545
 * Sort the hostlist hl and remove duplicate entries.
 
2546
 * 
2141
2547
 */
2142
 
extern void slurm_hostlist_destroy PARAMS(( hostlist_t hl ));
 
2548
extern void slurm_hostlist_uniq PARAMS((hostlist_t hl));
2143
2549
 
2144
2550
/*****************************************************************************\
2145
2551
 *      SLURM TRIGGER FUNCTIONS