LSF_LSHOSTS_FORMAT

Syntax

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

Description

Sets the customized output format for the lshosts command.

  • Specify which lshosts fields (or aliases instead of the full field names), in which order, and with what width to display.
  • Specify only the lshosts field name or alias to set its output to unlimited width and left justification.
  • Specify the colon (:) without a width to set the output width to the recommended width for that field.
  • Specify the colon (:) with a width to set the maximum number of characters to display for the field. When its value exceeds this width, lshosts truncates the ending characters.
  • Specify a hyphen (-) to set right justification when lshosts displays the output for the specific field. If not specified, the default is to set left justification when lshosts 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 lshosts -o "maxmem:3:S" command shows 30.0M.
      • For a value of 4096, running the lshosts -o "maxswp:3:S" command shows 4.0G.
      • For a value of 5000000, running the lshosts -o "maxtmp: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 lshosts -o "mytime:5:D" command shows 30.0s.
      • For a value of 8000, running the lshosts -o "mytime:5:D" command shows 2.2h.
      • For a value of 5000000, running the lshosts -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 lshosts -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 lshosts options:
  • LSF_LSHOSTS_FORMAT and lshosts -o both apply to output for the lshosts command with no options, and for lshosts options with output that filter information, including the following options: -a, -cname.
  • LSF_LSHOSTS_FORMAT and lshosts -o do not apply to output for other lshosts options that use a modified format, including the following options: -l, -w.

The lshosts -o option overrides the LSF_LSHOSTS_FORMAT environment variable, which overrides the LSF_LSHOSTS_FORMAT setting in lsf.conf.

Valid values

The following are the field names used to specify the lshosts fields to display, recommended width, aliases you can use instead of field names, and units of measurement for the displayed field:

Table 1. Output fields for lshosts
Field name Width Aliases Unit
HOST_NAME 20 hname  
type 10    
model 10    
cpuf 10    
ncpus 8    
maxmem 10   LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
maxswp 10   LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
server 10    
RESOURCES 20 res  
ndisks 8    
maxtmp 10   LSF_UNIT_FOR_LIMITS in lsf.conf (KB by default)
rexpri 10    
nprocs 8    
ncores 8    
nthreads 10    
RUN_WINDOWS 20 runwin  

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

Example

LSF_LSHOSTS_FORMAT="HOST_NAME type: RESOURCES:- RUN_WINDOWS:-16 delimiter='^'"

Running lshosts displays the following fields:

  • HOST_NAME with unlimited width and left-aligned.
  • type with a maximum width of 10 characters (which is the recommended width) and left-aligned.
  • RESOURCES with a maximum width of 20 characters (which is the recommended width) and right-aligned.
  • RUN_WINDOWS with a maximum width of 16 characters and right-aligned.
  • The ^ character is displayed between different headers and fields.

Default

Not defined. The current lshosts output is used.