Work Stealing Simulator


Avatar




Download WS-Simulator

To use ws-simulator, clone the code source from github : https://github.com/wssimulator/simulator


Use WS-Simulator

The simulator is develped with Python, Thus to use it, you need to install Python 3.x. To run simulation, go to simylation folder (cloned from github), then go to src/ folder:

First test, test simulator using python 3.x

~/simulator/src $  python3.5 simulator.py
The result should be like :
#using seed 0.043636
#PROCESSORS: 4, RUNS: 1
#proba  latency  runTime  processors  input-work-size  taskThreshold  W0 W1  IWR EWR
0.5	1	34	4	100	100	100	0	21	0
The default execution of simulator.py run simulation using 4 processors on a task with load egale 100 and latency egale 1

We explain the results as follow :
    - line 1 shows the seed number, so we can reproduce the same simulation using this seed
    - line 2 shows the number of processor used in the simulation and the number of simulation
    - line 3 shows the columns name of the results, for example :
                colum 1 shows the probability, column 2 shows the , column 3 shows the execution time ...
    - line 4 shows the in details the result of the first simulation

Configure a simulation

To configure the number of processors, use the option -p

For example to run a simulation with 16 processors we use :

~/simulator/src $  python3.5 simulator.py -p 16

To configure the size of the first tasks, use the option -iws

For example to run a simulation with 16 processors and 10000 unit independent tasks we use :

~/simulator/src $  python3.5 simulator.py -p 16 -iws 10000

We can also configure a range of value for the size of the first tasks, use the option -iwsconf with 3 values:
(min_input_work_size, max_input_work_size, multiplicative_step)

For example to run a simulation with 16 processors and 10, 100 and 10000 unit independent tasks we use :

~/simulator/src $  python3.5 simulator.py -p 16 -iwsconfig 10 10000 10

With the simulator, we can alse run several simulations in the same time using the option -r

For example to run 10 simulations with 16 processors and 10000 unit independent tasks we use :

~/simulator/src $  python3.5 simulator.py -p 16 -iws 10000 -r 10
In the resulst we will see the result of the 10 simulation, each in line as follow:
#using seed 0.068034
#PROCESSORS: 16, RUNS: 10
#proba  latency  runTime  processors  input-work-size  taskThreshold  W0 W1  IWR EWR
0.5	1	662	16	10000	100	10000	0	305	0
0.5	1	657	16	10000	100	10000	0	267	0
0.5	1	669	16	10000	100	10000	0	363	0
0.5	1	655	16	10000	100	10000	0	248	0
0.5	1	656	16	10000	100	10000	0	253	0
0.5	1	667	16	10000	100	10000	0	338	0
0.5	1	666	16	10000	100	10000	0	338	0
0.5	1	654	16	10000	100	10000	0	242	0
0.5	1	664	16	10000	100	10000	0	322	0
0.5	1	665	16	10000	100	10000	0	331	0

For more information about the available option use, use the option -h

~/simulator/src $  python3.5 simulator.py -h
The result should be like :
usage: simulator.py [-h] [-rsp REMOTE_STEAL_PROBABILITY]
              [-samax STEAL_ATTEMPT_MAX] [-samin STEAL_ATTEMPT_MIN]
              [-vss VICTIM_SELECTION_STRATEGY]
              [-samaxconf STEAL_ATTEMPT_CONF STEAL_ATTEMPT_CONF STEAL_ATTEMPT_CONF]
              [-rspconf PROBA_CONF PROBA_CONF PROBA_CONF]
              [-lconf LATENCIES_CONF LATENCIES_CONF LATENCIES_CONF]
              [-iwsconf IWS_CONFIG IWS_CONFIG IWS_CONFIG]
              [-p PROCESSORS] [-c CLUSTERS] [-iws WORK_SIZE]
              [-l LATENCY] [-s SEED] [-r RUNS] [-tasks] [-adapt] [-d]
              [-tt TASK_THRESHOLD [TASK_THRESHOLD ...]]
              [-lg LOCAL_GRANULARITY] [-rg REMOTE_GRANULARITY]
              [-f LOG_FILE] [-sim] [-json_in JSON_FILE_IN]
              [-json_out JSON_FILE_OUT] [-svgts SVG_TIME_SCAL]
              [-blk_factor BLOCK_FACTOR] [-itc INIT_TASK_COST]
              [-gbn GEO_BLK_NUMBER] [-ibs INIT_BS] [-mbs MAX_BS]
              [-config_type CONFIG_TYPE]

simulate work stealing algorithm

optional arguments:
  -h, --help            show this help message and exit
  -rsp REMOTE_STEAL_PROBABILITY
                        probability of stealing remotely
  -samax STEAL_ATTEMPT_MAX
                        max internal steal attempts
  -samin STEAL_ATTEMPT_MIN
                        mix internal steal attempts (used when vss=2)
  -vss VICTIM_SELECTION_STRATEGY
                        victim_selection_strategy, (0:probabilist, 1:static)
  -samaxconf STEAL_ATTEMPTION_CONFIG STEAL_ATTEMPTION_CONFIG STEAL_ATTEMPTION_CONFIG
                        interval config of stealing attemption max ,
                        (-samaxconf min_sam max_sam step)
  -rspconf PROBABILITIES_CONFIG PROBABILITIES_CONFIG PROBABILITIES_CONFIG
                        interval config of stealing remotely probabilities ,
                        (-rspconf min_probability max_probability step)
  -lconf LATENCIES_CONFIG LATENCIES_CONFIG LATENCIES_CONFIG
                        interval config of latencies , (-lconf min_latency
                        max_latency step)
  -iwsconf IWS_CONFIG IWS_CONFIG IWS_CONFIG
                        interval config of input work size, (-iwsconf
                        min_input_work_size max_input_work_size
                        multiplicative_step)
  -p PROCESSORS         total number of processors
  -c CLUSTERS           total number of clusters
  -iws WORK_SIZE        Input Work Size
  -l LATENCY            latency for remote steal
  -s SEED               random seed
  -r RUNS               number of runs to execute
  -tasks                use tree tasks
  -adapt                use adaptive tasks
  -d                    activate traces
  -tt TASK_THRESHOLD [TASK_THRESHOLD ...]
                        threshold for real tasks
  -lg LOCAL_GRANULARITY
                        local stealing granularity
  -rg REMOTE_GRANULARITY
                        remote stealing granularity
  -f LOG_FILE
  -sim                  activate simultaneously steal
  -json_in JSON_FILE_IN
  -json_out JSON_FILE_OUT
  -svgts SVG_TIME_SCAL  svg time scal
  -blk_factor BLOCK_FACTOR
  -itc INIT_TASK_COST
  -gbn GEO_BLK_NUMBER
  -ibs INIT_BS
  -mbs MAX_BS
  -config_type CONFIG_TYPE
  0-sqrt_dynamic, 1-log_dynamic, 2-sqrt_static,