jsm simulator

Purpose

IBM® Job Step Manager (JSM) simulator is a simulator that can run on a single node and can be used for experimenting with scheduling jobs without creating user processes. The JSM simulator is used to help users understand how different jsrun options impact the resources that are allocated. The JSM simulator also helps users understand how jsrun options affect tasks placement and binding changes.

Syntax

jsm_simulator[--help] [-Soptional node description file] [-n <#>] [--smt_level<#>][command]

Description

The jsm_simulator command starts a JSM simulator. If a command is given, it executes that command in a context where any js commands (jslist, jswait, jsrun, or jskill) interact with the simulator. If no command is given, a posix shell is started to allow a user to interact with the simulator.

No real processes are created when jsrun is used in a simulator environment. The command passed to jsrun is ignored and the simulator behaves as if the processes were created and immediately exited with a 0 exit status. If the special command, sleep , is used as the jsrun command to execute, the simulator behaves as if the processes were created and exited after n seconds with a 0 exit status.

When running under the jsm_simulator, the jsrun command's default behavior for the --print_placement option is 1. To request the jrun command to suppress this process placement information, use the --print_placement 0 option when invoking the jsrun command under the jsm_simulator.

Options

NoteNo space is allowed between the -S variable and the node description filename.

Return values

The jsm command exits with success unless there was a problem starting the simulator. The status of the command invoked by the simulator is not used as the exit value of the simulator itself.

Examples

  1. The following example shows how ranks are bound to different smt threads when the smt-level is set to 8 compared to oversubscribing smt threads when the smt-level is set to 8:

     -bash-4.2$ jsm_simulator -- jsrun --nrs 2 -a 2 --bind packed:smt:4  foo
     app 0: foo
     rank: 0: { host: 1; cpu: {0-3}, {4-7} ; mem: {0-13106} } : app 0
     rank: 1: { host: 1; cpu: {8-11}, {12-15} ; mem: {13107-26213} } : app 0
     rank: 2: { host: 1; cpu: {4-7}, {0-3} ; mem: {0-13106} } : app 0
     rank: 3: { host: 1; cpu: {12-15}, {8-11} ; mem: {13107-26213} } : app 0
    
     -bash-4.2$ jsm_simulator --smt_level 4  -- jsrun --nrs 2 -a 2 --bind packed:smt:4  foo
     Warning: more than 1 task/rank assigned to a core
     app 0: foo
     rank: 0: { host: 1; cpu: {0-3} ; mem: {0-13106} } : app 0
     rank: 1: { host: 1; cpu: {4-7} ; mem: {13107-26213} } : app 0
     rank: 2: { host: 1; cpu: {0-3} ; mem: {0-13106} } : app 0
     rank: 3: { host: 1; cpu: {4-7} ; mem: {13107-26213} } : app 0
    
  2. The following example shows a simple interactive use of the simulator:

     $ jsm_simulator -n 4
     jsm-simultator$ jsrun --print_placement 0 --rs_per_socket 1 a.out
     jsm-simultator$ jslist
    
         parent        cpus            exit
      ID   ID    nrs  per RS  per RS  status  status
     ===============================================
      1    0      8     1       0       0    Complete
    
     jsm-simultator$ exit
    
  3. The following example shows how the simulator can be used to view the allocations created by various jsm command line options:

     $ jsm_simulator
     jsm-simultator$ jsrun --print_placement 0 -c 20 -g 4
                           --latency_priority CPU-CPU
                           --nrs 1 nop
     jsm-simultator$ jsrun --print_placement 0 -c 20 -g 4
                           --latency_priority GPU-CPU
                           --nrs 1 nop
     jsm-simultator$ jslist -R
    
          parent       cpus            exit
      ID    ID   nrs  per RS  per RS  status  status
     ================================================
      1     0     1     20      4       0    Complete
     ------------------------------------------------
     RS 0 HOST simhost-1:
         SOCKET 0: cpus: 0-19 gpus: 0 1 2 mem: 262140
         SOCKET 1: gpus: 3
     ------------------------------------------------
      2      0     1    20      4       0    Complete
     ------------------------------------------------
     RS 0 HOST simhost-1:
         SOCKET 0: cpus: 0-4 gpus: 0 mem: 65535
         SOCKET 1: cpus: 20-34 gpus: 3 4 5 mem: 196605
     -------------------------------------------------
     jsm-simulator$ exit
    
  4. The following example shows how the simulator can be used to view the placement and binding of individual tasks:

     $ jsm_simulator -n 2
         jsm-simultator$ jsrun --print_placement 0 --erf_output results --rs_per_socket 1 \
         -c 8 -g 1 --tasks_per_rs 4 --launch_distribution plane:2 --bind packed:2 nop
         jsm-simultator$ cat results
             app 0: nop
             cpu_index_using: logical
             overlapping_rs: allow
             oversubscribe_cpu: warn
             oversubscribe_gpu: allow
             oversubscribe_mem: allow
         launch_distribution: plane:2
    
         rank: 0: { host: 1; cpu: {0-7}, {8-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 1: { host: 1; cpu: {8-15}, {0-7,16-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 2: { host: 1; cpu: {80-87}, {88-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 3: { host: 1; cpu: {88-95}, {80-87,96-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 4: { host: 2; cpu: {0-7}, {8-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 5: { host: 2; cpu: {8-15}, {0-7,16-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 6: { host: 2; cpu: {80-87}, {88-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 7: { host: 2; cpu: {88-95}, {80-87,96-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 8: { host: 1; cpu: {16-23}, {0-15,24-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 9: { host: 1; cpu: {24-31}, {0-23} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 10: { host: 1; cpu: {96-103}, {80-95,104-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 11: { host: 1; cpu: {104-111}, {80-103} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 12: { host: 2; cpu: {16-23}, {0-15,24-31} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 13: { host: 2; cpu: {24-31}, {0-23} ; gpu: {0} ; mem: {0-39999} } : app 0
         rank: 14: { host: 2; cpu: {96-103}, {80-95,104-111} ; gpu: {3} ; mem: {100000-139999} } : app 0
         rank: 15: { host: 2; cpu: {104-111}, {80-103} ; gpu: {3} ; mem: {100000-139999} } : app 0
    
  5. The following example shows how you can use the sleep command to simulate running multiple job steps simultaneously:

     -bash-4.2$ jsm_simulator
         jsm-simultator$ jsrun --print_placement 0 --immediate --stdio_stderr /dev/null --stdio_stdout /dev/null --rs_per_socket 1 -c 10 sleep 100
         jsm-simultator$ jsrun --print_placement 0 --immediate --stdio_stderr /dev/null --stdio_stdout /dev/null --rs_per_socket 1 -c 10 sleep 100
         jsm-simultator$ jsrun --print_placement 0 --immediate --stdio_stderr /dev/null --stdio_stdout /dev/null --rs_per_host 1 sleep 1
         jsm-simultator$ jsrun --print_placement 0
    
         parent         cpus            exit
      ID   ID    nrs   per RS  per RS  status  status
     ================================================
      1    0      2      10       0       0   Running
      2    0      2      10       0       0   Running
      3    0      1      1        0       0   Queued
    
     jsm-simultator$ jswait 3
    


See also

jsrun(1), jslist(1), jskill(1), jswait(1)

Parent topic: Job Step Manager commands