LSF_LSLOAD_FORMAT

Syntax

LSF_LSLOAD_FORMAT="field_name[:[-][output_width]][:unit]] ... [delimiter='character']"

Description

Sets the customized output format for the lsload command.

  • Specify which lsload fields, in which order, and with what width to display.
  • Specify the asterisk wildcard character (*) in the field name to specify multiple external resource names. You can only specify one asterisk, but this asterisk can be at any position in the field name.

    For example, running lsload -o "gpu_mode*" shows fields such as gpu_mode0, gpu_mode1, gpu_mode2, gpu_model0, gpu_model1, and gpu_model2.

  • Specify only the lsload field name to set its output to unlimited width and left justification.
  • Specify the width colon (:) without a width to set the output width to the recommended width for that field.
  • Specify the width colon (:) with a width to set the maximum number of characters to display for the field. When its value exceeds this width, lsload truncates the ending characters.
  • Specify a hyphen (-) to set right justification when lsload displays the output for the specific field. If not specified, the default is to set left justification when lsload displays the output for a field.
  • Specify the unit colon (:) with a unit to set the unit for the output of the specific field:
    • Specify S to use a built-in conversion for space or capacity, such as memory or disk space. Values are automatically scaled for M (MB), G (GB), and T (TB), where the default unit is M (MB).
      For example, when displaying the mem field with a specified width of 3,
      • For a value of 30, running the lsload -o "mem:3:S" command shows 30.0M.
      • For a value of 4096, running the lsload -o "mem:3:S" command shows 4.0G.
      • For a value of 5000000, running the lsload -o "mem:3:S" command shows 4.8T.
    • Specify D to use a built-in conversion for duration or time, such as memory or disk space. Values are automatically scaled for s (seconds), m (minutes), h (hours), and d (days), where the default unit is s (seconds). The automatically scaled value is rounded up after the first decimal point.
      For example, when displaying the external mytime resource field with a specified width of 5,
      • For a value of 30, running the lsload -o "mytime:5:D" command shows 30.0s.
      • For a value of 8000, running the lsload -o "mytime:5:D" command shows 2.2h.
      • For a value of 5000000, running the lsload -o "mytime:5:D" command shows 57.8d.
    • Specify any other string of 1 - 3 characters and the characters are used as is in the field value. The first character must be a letter (upper or lower case). The second and third characters must be an alphanumeric character.

      For example, when displaying the external gpu_temp resource with a width of 3, running the lsload -o "gpu_temp:3:C" command for a value of 30 shows 30C

  • Use delimiter= to set the delimiting character to display between different headers and fields. This delimiter must be a single character. By default, the delimiter is a space.
Output customization applies only to the output for certain lsload options:
  • LSF_LSLOAD_FORMAT and lsload -o both apply to output for the lsload command with no options, and for lsload options with short form output that filter information, including the following options: -a, -E, -cname, -N, -n, -R.
  • LSF_LSLOAD_FORMAT and lsload -o do not apply to output for lsload options that use a modified format, including the following options: -I, -l, -w, -s.

The lsload -o option overrides the LSF_LSLOAD_FORMAT environment variable, which overrides the LSF_LSLOAD_FORMAT setting in lsf.conf.

Valid values

By default, the lsload command displays the built-in resource indices. You can also specify the names of external resources. The following are the field names for the built-in resource indices that are used to specify the lsload fields to display, recommended width, and units of measurement for the displayed field:

Table 1. Output fields for lsload
Field name Width Unit
HOST_NAME 20  
status 15  
r15s 6  
r1m 6  
r15m 6  
ut 6  
pg 6  
ls 6  
it 6  
io 6  
tmp 10 LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
swp 10 LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
mem 10 LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
gpu_status*

For example, gpu_status0 and gpu_status1 if there are two GPUs.

10  
gpu_error*

For example, gpu_error0 and gpu_error1 if there are two GPUs.

20  

Field names are case-sensitive. Valid values for the output width are any positive integer 1 - 4096.

Example

LSF_LSLOAD_FORMAT="HOST_NAME status: r15s:- r1m:7 r15m:-8 tmp:S swp::S mem:9:S delimiter='^'"

Running lsload displays the following fields:

  • HOST_NAME with unlimited width and left-aligned.
  • status with a maximum width of 15 characters (which is the recommended width) and left-aligned.
  • r15s with a maximum width of 6 characters (which is the recommended width) and right-aligned.
  • r1m with a maximum width of 7 characters and left-aligned.
  • r15m with a maximum width of 8 characters and right-aligned.
  • tmp with unlimited width, left-aligned, and automatically scaled for space or capacity (MB, GB, and TB).
  • swp with a maximum width of 10 characters (which is the recommended width), left-aligned, and automatically scaled for space or capacity (MB, GB, and TB)
  • mem with a maximum width of 9 characters, left-aligned, and automatically scaled for space or capacity (MB, GB, and TB)
  • The ^ character is displayed between different headers and fields.

Default

Not defined. The current lsload output is used.