Commit cfd9123d authored by Morris Jette's avatar Morris Jette
Browse files

squeue: contex-sensitive time printing

Especially on long listings of jobs or records, there is very little variation in
adjacent entries, causing repetition of output which can make it difficult to
quickly see changes.

This also makes it easier to spot outliers: as in the example a the end of
April below, where a user had set a BeginTime of about 1 month in advance:

JOBID  USER     ACCOUNT               NAME     REASON NODES  TIMELIMIT   START_TIME
54936  teyssier    s201     cut_largemodes   Priority    16 1-00:00:00     18:37:30
33544  jgomez       s89        Rh_12x12-4L   Priority     8 1-00:00:00     18:39:02
40798  jgomez       s89        Rh_8x8x8_D3   Priority    20   23:59:00     18:40:29
31994  xyy         s241     new-3g5u-lipid   Priority    22 1-00:00:00     18:40:29
32072  gstarek     s241        alpha_vs_dp   Priority    22 1-00:00:00     18:40:29
32078  gstarek     s241         control_vs   Priority    22 1-00:00:00     18:40:29
31699  jgomez       s89            CHP_120  BeginTime    20 1-00:00:00 29 May 16:43
22121  guerard     s263          an18QM370 Dependency     8    2:00:00          N/A

The patch introduces a context-sensitive time format which is
 * disabled by default
 * enabled via SLURM_TIME_FORMAT environment variable,
 * prints 24-hour clock based time relative to "now",
 * takes up at most 12 characters (i.e. 1/2 character per hour).

The following compares the formats for a range of settings:

  1) SLURM_TIME_FORMAT=standard
  now                      2011-06-06T12:57:22
  yesterday 2pm            2011-06-05T14:00:00
  19 jan 1904 3:15         1904-01-19T03:15:00
  -2 days 4:15pm           2011-06-04T16:15:00
  tomorrow                 2011-06-07T12:57:22
  +2 days 2:17am           2011-06-08T02:17:00
  +3 days 2:18pm           2011-06-09T14:18:00
  -6 weeks                 2011-04-25T12:57:22
  +3 weeks + 10 days       2011-07-07T12:57:22
  next year                2012-06-06T12:57:22

  2) SLURM_TIME_FORMAT=relative
  now                                 12:57:22
  yesterday 2pm                   Ystday 14:00
  19 jan 1904 3:15                 19 Jan 1904
  -2 days 4:15pm                   4 Jun 16:15
  tomorrow                        Tomorr 12:57
  +2 days 2:17am                     Wed 02:17
  +3 days 2:18pm                     Thu 14:18src/common/parse_time.c
  -6 weeks                        25 Apr 12:57
  +3 weeks + 10 days               7 Jul 12:57
  next year                         6 Jun 2012

  3) SLURM_TIME_FORMAT="%a %T"
  now                             Mon 12:57:22
  yesterday 2pm                   Sun 14:00:00
  19 jan 1904 3:15                Tue 03:15:00
  -2 days 4:15pm                  Sat 16:15:00
  tomorrow                        Tue 12:57:22
  +2 days 2:17am                  Wed 02:17:00
  +3 days 2:18pm                  Thu 14:18:00
04_COSMETICS_context-dependent-timestring.diff Patch by Gerrit Renker, CSCS
parent b0eb2a63
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment