Skip to content

Commit 5377443

Browse files
author
Lars T Hansen
committed
More doc
1 parent 096e724 commit 5377443

3 files changed

Lines changed: 61 additions & 19 deletions

File tree

doc/NEW-FORMAT.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,24 @@ The output is a tree structure that is constrained enough to be serialized as
7070
[JSON](https://www.rfc-editor.org/rfc/rfc8259) and other likely serialization formats (protobuf,
7171
bson, cbor, a custom format, whatever). It shall follow the [json:api
7272
specification](https://jsonapi.org/format/#document-structure). It generally does not
73-
incorporate many size optimizations.
73+
incorporate many size optimizations apart from the tree structure itself, which simply lifts
74+
redundancies up in the tree.
7475

7576
It is not a goal to have completely normalized data; redundancies are desirable in some cases to
7677
make data self-describing. Redundancies within a data packet must always be consistent, for
7778
example, if the time of a sample is represented multiple times in the packet, the value must be
7879
the same in all cases.
7980

80-
In a serialization format (such as JSON) that allows fields to be omitted, all fields except
81-
union fields will have default values, which are zero, empty string, false, the empty object, or
82-
the empty array. A non-omitted union field must have exactly one member present.
83-
8481
Field values are constrained by data types described below, and sometimes by additional
8582
constraints described in prose. Primitive types are as they are in Go: 64-bit integers and
8683
floating point, and Unicode strings. Numeric values outside the given ranges, non-Unicode
8784
string encodings, malformed timestamps, malformed node-ranges or type-incorrect data in any
8885
field can cause the entire top-level object containing them to be rejected by the back-end.
8986

87+
In a serialization format (such as JSON) that allows fields to be omitted, all fields except
88+
those of a type derived from NonemptyString have default values, which are zero, empty string,
89+
false, the empty object, or the empty array. Notably ExtendedUint defaults to zero, "unset".
90+
9091
The word "current" in the semantics of a field denotes an instantaneous reading or a
9192
short-interval statistical measure; contrast "cumulative", which is since start of process/job
9293
or since system boot or some other fixed time.
@@ -156,6 +157,10 @@ cluster):
156157
- job state data for a given slurm job id
157158
- cluster partition configuration data for a given partition name
158159

160+
### Bad time stamps (all streams)
161+
162+
Malformatted timestamps render the entire data packet invalid.
163+
159164
### Redundant time stamps (all streams)
160165

161166
Every primitive data stream can be sorted by ascending time. If two records in such a stream
@@ -229,6 +234,15 @@ stateless, so data are currently transmitted redundantly. Every record sent for
229234
typically have the same Priority field, for example. The back-end can usefully filter redundant
230235
or nearly-redundant records.
231236

237+
### Slurm job step streams
238+
239+
Most Slurm data objects belongs to a specific job step; thus for a given JobID, there can be
240+
multiple data streams, one for each step in the job, including some housekeeping steps. The
241+
(JobID, JobStep) pair identifies the stream. In a given Slurm data packet, there will be a
242+
"main" line for the job that is identified by its UserName field being not blank; this will have
243+
overall information about the job. The data objects for the individual steps will follow this
244+
main line.
245+
232246
### Computing the capability of nodes
233247

234248
Frequently it is useful to report on a job's resource use relative to the capability of the
@@ -752,7 +766,7 @@ Disk's local minor device number.
752766
Disk stats values in the order present in /proc/diskstats. Documentation: Linux 6.x has
753767
Documentation/admin-guide/iostats.rst [1]. Older kernels have Documentation/iostats.txt [2].
754768

755-
Note:
769+
NOTE:
756770
- The layout of this array changes between kernel versions and may require knowledge of
757771
the kernel version to interpret. See the OsRelease field in SysinfoAttributes.
758772
- In particular, the length of the array is not constant across kernel versions, though it
@@ -1183,6 +1197,13 @@ slurm: `JOB_INFO.steps[i].task.distribution`
11831197
Requested resources. If present, this comes from scontrol's ReqTRES field. See
11841198
DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details.
11851199

1200+
We are most often interested in GPU resources, as other resources are represented in other
1201+
ways. GPU resources are subfields tagged as "gres/gpu=*" for "any gpu" and
1202+
"gres/gpu:model=n" for specific GPU model names.
1203+
1204+
Memory sizes in the TRES may be encoded with a suffix K, M, G, T, or P representing (as far
1205+
as is known) 2^10, 20^20, 2^30, 2^40, and 2^50 bytes.
1206+
11861207
scontrol: `ReqTRES`
11871208

11881209
Note that it's been observed that scontrol produces the items in this field in a surprising
@@ -1192,8 +1213,8 @@ always so (yet AllocTRES seems to have the expected order).
11921213

11931214
#### **`allocated_resources`** string
11941215

1195-
Allocated resources. If present, this comes from sacct's AllocTRES field. See
1196-
DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details.
1216+
Allocated resources. If present, this comes from sacct's AllocTRES field. See ReqTRES
1217+
documentation for encoding details.
11971218

11981219
sacct: `AllocTRES`
11991220

doc/types.spec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ SampleDisk:
368368
stats:
369369
type: '[]uint64'
370370
doc: >
371-
Disk stats values in the order present in /proc/diskstats. Documentation: Linux 6.x has Documentation/admin-guide/iostats.rst [1]. Older kernels have Documentation/iostats.txt [2]. Note: - The layout of this array changes between kernel versions and may require knowledge of the kernel version to interpret. See the OsRelease field in SysinfoAttributes. - In particular, the length of the array is not constant across kernel versions, though it appears new fields are always appended. - Counters may sometimes wrap around, and they will be reset on reboot. See also the Boot field in SampleSystem. - Field interpretation may also vary between versions. - The field should be considered experimental; when it was introduced, we did not know which data would be interesting. It may be augmented by other fields in the future. [1] https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/iostats.rst. [2] https://elixir.bootlin.com/linux/v4.18.20/source/Documentation/iostats.txt.
371+
Disk stats values in the order present in /proc/diskstats. Documentation: Linux 6.x has Documentation/admin-guide/iostats.rst [1]. Older kernels have Documentation/iostats.txt [2]. NOTE: - The layout of this array changes between kernel versions and may require knowledge of the kernel version to interpret. See the OsRelease field in SysinfoAttributes. - In particular, the length of the array is not constant across kernel versions, though it appears new fields are always appended. - Counters may sometimes wrap around, and they will be reset on reboot. See also the Boot field in SampleSystem. - Field interpretation may also vary between versions. - The field should be considered experimental; when it was introduced, we did not know which data would be interesting. It may be augmented by other fields in the future. [1] https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/iostats.rst. [2] https://elixir.bootlin.com/linux/v4.18.20/source/Documentation/iostats.txt.
372372
SampleJob:
373373
fields:
374374
job:
@@ -582,11 +582,11 @@ SlurmJob:
582582
requested_resources:
583583
type: 'string'
584584
doc: >
585-
Requested resources. If present, this comes from scontrol's ReqTRES field. See DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details. scontrol: `ReqTRES` Note that it's been observed that scontrol produces the items in this field in a surprising order. Normally resource requests express a priority order, so specific GPUs will appear in the list before a generic request. In the output from scontrol for ReqTRES, this is not always so (yet AllocTRES seems to have the expected order).
585+
Requested resources. If present, this comes from scontrol's ReqTRES field. See DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details. We are most often interested in GPU resources, as other resources are represented in other ways. GPU resources are subfields tagged as "gres/gpu=*" for "any gpu" and "gres/gpu:model=n" for specific GPU model names. Memory sizes in the TRES may be encoded with a suffix K, M, G, T, or P representing (as far as is known) 2^10, 20^20, 2^30, 2^40, and 2^50 bytes. scontrol: `ReqTRES` Note that it's been observed that scontrol produces the items in this field in a surprising order. Normally resource requests express a priority order, so specific GPUs will appear in the list before a generic request. In the output from scontrol for ReqTRES, this is not always so (yet AllocTRES seems to have the expected order).
586586
allocated_resources:
587587
type: 'string'
588588
doc: >
589-
Allocated resources. If present, this comes from sacct's AllocTRES field. See DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details. sacct: `AllocTRES`
589+
Allocated resources. If present, this comes from sacct's AllocTRES field. See ReqTRES documentation for encoding details. sacct: `AllocTRES`
590590
requested_cpus:
591591
type: 'uint64'
592592
doc: >

util/formats/newfmt/types.go

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,24 @@ import (
7878
// [JSON](https://www.rfc-editor.org/rfc/rfc8259) and other likely serialization formats (protobuf,
7979
// bson, cbor, a custom format, whatever). It shall follow the [json:api
8080
// specification](https://jsonapi.org/format/#document-structure). It generally does not
81-
// incorporate many size optimizations.
81+
// incorporate many size optimizations apart from the tree structure itself, which simply lifts
82+
// redundancies up in the tree.
8283
//
8384
// It is not a goal to have completely normalized data; redundancies are desirable in some cases to
8485
// make data self-describing. Redundancies within a data packet must always be consistent, for
8586
// example, if the time of a sample is represented multiple times in the packet, the value must be
8687
// the same in all cases.
8788
//
88-
// In a serialization format (such as JSON) that allows fields to be omitted, all fields except
89-
// union fields will have default values, which are zero, empty string, false, the empty object, or
90-
// the empty array. A non-omitted union field must have exactly one member present.
91-
//
9289
// Field values are constrained by data types described below, and sometimes by additional
9390
// constraints described in prose. Primitive types are as they are in Go: 64-bit integers and
9491
// floating point, and Unicode strings. Numeric values outside the given ranges, non-Unicode
9592
// string encodings, malformed timestamps, malformed node-ranges or type-incorrect data in any
9693
// field can cause the entire top-level object containing them to be rejected by the back-end.
9794
//
95+
// In a serialization format (such as JSON) that allows fields to be omitted, all fields except
96+
// those of a type derived from NonemptyString have default values, which are zero, empty string,
97+
// false, the empty object, or the empty array. Notably ExtendedUint defaults to zero, "unset".
98+
//
9899
// The word "current" in the semantics of a field denotes an instantaneous reading or a
99100
// short-interval statistical measure; contrast "cumulative", which is since start of process/job
100101
// or since system boot or some other fixed time.
@@ -164,6 +165,10 @@ import (
164165
// - job state data for a given slurm job id
165166
// - cluster partition configuration data for a given partition name
166167
//
168+
// ### Bad time stamps (all streams)
169+
//
170+
// Malformatted timestamps render the entire data packet invalid.
171+
//
167172
// ### Redundant time stamps (all streams)
168173
//
169174
// Every primitive data stream can be sorted by ascending time. If two records in such a stream
@@ -237,6 +242,15 @@ import (
237242
// typically have the same Priority field, for example. The back-end can usefully filter redundant
238243
// or nearly-redundant records.
239244
//
245+
// ### Slurm job step streams
246+
//
247+
// Most Slurm data objects belongs to a specific job step; thus for a given JobID, there can be
248+
// multiple data streams, one for each step in the job, including some housekeeping steps. The
249+
// (JobID, JobStep) pair identifies the stream. In a given Slurm data packet, there will be a
250+
// "main" line for the job that is identified by its UserName field being not blank; this will have
251+
// overall information about the job. The data objects for the individual steps will follow this
252+
// main line.
253+
//
240254
// ### Computing the capability of nodes
241255
//
242256
// Frequently it is useful to report on a job's resource use relative to the capability of the
@@ -690,7 +704,7 @@ type SampleDisk struct {
690704
// Disk stats values in the order present in /proc/diskstats. Documentation: Linux 6.x has
691705
// Documentation/admin-guide/iostats.rst [1]. Older kernels have Documentation/iostats.txt [2].
692706
//
693-
// Note:
707+
// NOTE:
694708
// - The layout of this array changes between kernel versions and may require knowledge of
695709
// the kernel version to interpret. See the OsRelease field in SysinfoAttributes.
696710
// - In particular, the length of the array is not constant across kernel versions, though it
@@ -1064,6 +1078,13 @@ type SlurmJob struct {
10641078
// Requested resources. If present, this comes from scontrol's ReqTRES field. See
10651079
// DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details.
10661080
//
1081+
// We are most often interested in GPU resources, as other resources are represented in other
1082+
// ways. GPU resources are subfields tagged as "gres/gpu=*" for "any gpu" and
1083+
// "gres/gpu:model=n" for specific GPU model names.
1084+
//
1085+
// Memory sizes in the TRES may be encoded with a suffix K, M, G, T, or P representing (as far
1086+
// as is known) 2^10, 20^20, 2^30, 2^40, and 2^50 bytes.
1087+
//
10671088
// scontrol: `ReqTRES`
10681089
//
10691090
// Note that it's been observed that scontrol produces the items in this field in a surprising
@@ -1072,8 +1093,8 @@ type SlurmJob struct {
10721093
// always so (yet AllocTRES seems to have the expected order).
10731094
ReqTRES string `json:"requested_resources,omitempty"`
10741095

1075-
// Allocated resources. If present, this comes from sacct's AllocTRES field. See
1076-
// DecodeSlurmTRES() in decode_jobs.go in this directory for encoding details.
1096+
// Allocated resources. If present, this comes from sacct's AllocTRES field. See ReqTRES
1097+
// documentation for encoding details.
10771098
//
10781099
// sacct: `AllocTRES`
10791100
AllocTRES string `json:"allocated_resources,omitempty"`

0 commit comments

Comments
 (0)