4
4
* Copyright (C) 2008 Lawrence Livermore National Security.
5
5
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6
6
* Written by Morris Jette <jette1@llnl.gov>
7
* CODE-OCEC-09-009. All rights reserved.
9
9
* This file is part of SLURM, a resource management program.
10
* For details, see <http://www.llnl.gov/linux/slurm/>.
10
* For details, see <https://computing.llnl.gov/linux/slurm/>.
11
* Please also read the included file: DISCLAIMER.
12
13
* SLURM is free software; you can redistribute it and/or modify it under
13
14
* the terms of the GNU General Public License as published by the Free
51
52
sstat_parameters_t params;
52
fields_t fields[] = {{"cputime", print_cputime},
53
{"jobid", print_jobid},
54
{"ntasks", print_ntasks},
55
{"pages", print_pages},
57
{"state", print_state},
58
{"vsize", print_vsize},
53
print_field_t fields[] = {
54
{10, "AveCPU", print_fields_str, PRINT_AVECPU},
55
{10, "AvePages", print_fields_str, PRINT_AVEPAGES},
56
{10, "AveRSS", print_fields_str, PRINT_AVERSS},
57
{10, "AveVMSize", print_fields_str, PRINT_AVEVSIZE},
58
{10, "JobID", print_fields_str, PRINT_JOBID},
59
{8, "MaxPages", print_fields_str, PRINT_MAXPAGES},
60
{12, "MaxPagesNode", print_fields_str, PRINT_MAXPAGESNODE},
61
{14, "MaxPagesTask", print_fields_int, PRINT_MAXPAGESTASK},
62
{10, "MaxRSS", print_fields_str, PRINT_MAXRSS},
63
{10, "MaxRSSNode", print_fields_str, PRINT_MAXRSSNODE},
64
{10, "MaxRSSTask", print_fields_int, PRINT_MAXRSSTASK},
65
{10, "MaxVMSize", print_fields_str, PRINT_MAXVSIZE},
66
{14, "MaxVMSizeNode", print_fields_str, PRINT_MAXVSIZENODE},
67
{14, "MaxVMSizeTask", print_fields_int, PRINT_MAXVSIZETASK},
68
{10, "MinCPU", print_fields_str, PRINT_MINCPU},
69
{10, "MinCPUNode", print_fields_str, PRINT_MINCPUNODE},
70
{10, "MinCPUTask", print_fields_int, PRINT_MINCPUTASK},
71
{8, "NTasks", print_fields_int, PRINT_NTASKS},
72
{10, "SystemCPU", print_fields_str, PRINT_SYSTEMCPU},
73
{10, "TotalCPU", print_fields_str, PRINT_TOTALCPU},
77
jobacct_job_rec_t job;
62
78
jobacct_step_rec_t step;
64
int printfields[MAX_PRINTFIELDS], /* Indexed into fields[] */
67
void _print_header(void)
70
for (i=0; i<nprintfields; i++) {
74
(fields[j].print_routine)(HEADLINE, 0);
77
for (i=0; i<nprintfields; i++) {
81
(fields[j].print_routine)(UNDERSCORE, 0);
79
List print_fields_list = NULL;
80
ListIterator print_fields_itr = NULL;
86
83
int _sstat_query(slurm_step_layout_t *step_layout, uint32_t job_id,
99
96
debug("getting the stat of job %d on %d nodes",
100
97
job_id, step_layout->node_cnt);
99
memset(&job, 0, sizeof(jobacct_job_rec_t));
102
memset(&step, 0, sizeof(jobacct_step_rec_t));
102
104
memset(&temp_sacct, 0, sizeof(sacct_t));
103
105
temp_sacct.min_cpu = (float)NO_VAL;
104
106
memset(&step.sacct, 0, sizeof(sacct_t));
105
107
step.sacct.min_cpu = (float)NO_VAL;
108
110
step.stepid = step_id;
109
111
step.nodes = step_layout->node_list;
110
112
step.stepname = NULL;
232
229
uint32_t stepid = 0;
233
230
jobacct_selected_step_t *selected_step = NULL;
232
print_fields_list = list_create(NULL);
233
print_fields_itr = list_iterator_create(print_fields_list);
235
235
parse_command_line(argc, argv);
236
236
if(!params.opt_job_list || !list_count(params.opt_job_list)) {
237
237
error("You didn't give me any jobs to stat.");
241
if (!params.opt_noheader) /* give them something to look */
242
_print_header();/* at while we think... */
241
print_fields_header(print_fields_list);
243
242
itr = list_iterator_create(params.opt_job_list);
244
243
while((selected_step = list_next(itr))) {
245
244
if(selected_step->stepid != NO_VAL)