├── inputs
├── INPUTS.md
├── ariel
│ └── dag_input
│ │ ├── preschd_dag_2.txt
│ │ ├── preschd_dag_1.txt
│ │ ├── preschd_dag_0.txt
│ │ ├── dag_1.txt
│ │ ├── dag_0.txt
│ │ ├── dag1.graphml
│ │ ├── dag2.graphml
│ │ └── dag0.graphml
├── mapping
│ └── dag_input
│ │ ├── preschd_dag_1.txt
│ │ ├── preschd_dag_2.txt
│ │ ├── preschd_dag_0.txt
│ │ ├── dag_1.txt
│ │ ├── dag_2.txt
│ │ ├── dag_0.txt
│ │ ├── dag1.graphml
│ │ ├── dag2.graphml
│ │ └── dag0.graphml
├── package
│ └── dag_input
│ │ ├── preschd_dag_1.txt
│ │ ├── preschd_dag_2.txt
│ │ ├── preschd_dag_0.txt
│ │ ├── dag_1.txt
│ │ ├── dag_2.txt
│ │ ├── dag_0.txt
│ │ ├── dag1.graphml
│ │ ├── dag2.graphml
│ │ └── dag0.graphml
├── ad
│ ├── dag_input
│ │ ├── preschd_dag_3.txt
│ │ ├── preschd_dag_2.txt
│ │ ├── preschd_dag_1.txt
│ │ ├── preschd_dag_0.txt
│ │ ├── dag_3.txt
│ │ ├── dag_2.txt
│ │ ├── dag_1.txt
│ │ ├── dag_0.txt
│ │ ├── dag3.graphml
│ │ ├── dag2.graphml
│ │ ├── dag1.graphml
│ │ └── dag0.graphml
│ └── trace_files
│ │ └── ad_trace.trc
├── synthetic
│ └── dag_input
│ │ ├── preschd_dag_5.txt
│ │ ├── preschd_dag_7.txt
│ │ ├── preschd_dag_10.txt
│ │ ├── dag_5_slack.txt
│ │ ├── dag_5.txt
│ │ ├── dag_7.txt
│ │ ├── dag_7_slack.txt
│ │ ├── dag_10.txt
│ │ ├── dag_10_slack.txt
│ │ ├── dag5.graphml
│ │ ├── dag7.graphml
│ │ └── dag10.graphml
└── search
│ └── dag_input
│ ├── dag_1.txt
│ ├── dag_2.txt
│ ├── dag_0.txt
│ ├── dag1.graphml
│ ├── dag2.graphml
│ └── dag0.graphml
├── simulator
├── meta_policies
│ ├── __init__.py
│ ├── edf.py
│ ├── ms_wcet.py
│ ├── ms.py
│ ├── heft.py
│ └── rheft.py
├── task_policies
│ ├── __init__.py
│ ├── simple_policy_ver1.py
│ ├── README.md
│ ├── edf.py
│ ├── simple_policy_ver3.py
│ ├── simple_policy_ver2.py
│ ├── heft.py
│ ├── simple_policy_ver4.py
│ ├── edf_eft.py
│ ├── ts_eft.py
│ ├── ads.py
│ ├── ms_hetero.py
│ ├── ms_hyb.py
│ ├── rheft.py
│ └── ms.py
├── stomp_main.py
└── utils.py
├── utils
├── python-gantt
│ ├── requirements.in
│ ├── requirements-dev.in
│ ├── MANIFEST.in
│ ├── requirements.txt
│ ├── gantt
│ │ ├── __init__.py
│ │ └── test_gantt.py
│ ├── tox.ini
│ ├── requirements-dev.txt
│ ├── setup.py
│ ├── org2gantt
│ │ ├── taskjuggler.org
│ │ ├── example.org
│ │ └── README.org
│ ├── Makefile
│ ├── TODOLIST.org
│ ├── example.py
│ ├── README.md
│ └── README.txt
├── trace_generator.py
├── trace_generator_real.py
├── README.md
└── stomp-viz.py
├── .gitignore
├── stomp-viz-example.png
├── requirements.txt
├── Makefile
├── .vscode
└── launch.json
├── TRACES.md
└── README.md
/inputs/INPUTS.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/preschd_dag_2.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/simulator/meta_policies/__init__.py:
--------------------------------------------------------------------------------
1 | from . import *
2 |
--------------------------------------------------------------------------------
/simulator/task_policies/__init__.py:
--------------------------------------------------------------------------------
1 | from . import *
2 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/preschd_dag_1.txt:
--------------------------------------------------------------------------------
1 | 0 0 2
2 | 1 2 3
3 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/preschd_dag_0.txt:
--------------------------------------------------------------------------------
1 | 0 0 96
2 | 1 96 2
3 | 2 98 3
4 |
--------------------------------------------------------------------------------
/utils/python-gantt/requirements.in:
--------------------------------------------------------------------------------
1 | dateutils
2 | svgwrite
3 | clize
4 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/preschd_dag_1.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 3
3 | 2 13 1
4 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/preschd_dag_1.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 3
3 | 2 13 1
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .*DS_Store
2 | *.pyc
3 | sim_*
4 | *.swp
5 | *.swo
6 | *.csv
7 | *.out
8 |
--------------------------------------------------------------------------------
/stomp-viz-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/stomp/HEAD/stomp-viz-example.png
--------------------------------------------------------------------------------
/inputs/ad/dag_input/preschd_dag_3.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 0 96
3 | 2 96 2
4 | 3 98 1
5 | 4 99 8
6 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/preschd_dag_2.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 951
3 | 2 961 5
4 | 3 966 1
5 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/preschd_dag_2.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 951
3 | 2 961 5
4 | 3 966 1
5 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/preschd_dag_5.txt:
--------------------------------------------------------------------------------
1 | 0 0 1
2 | 1 19 7
3 | 2 11 2
4 | 3 1 18
5 | 4 1 10
6 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/preschd_dag_2.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 0 96
3 | 2 96 2
4 | 3 98 1
5 | 4 10 1
6 | 5 99 10
7 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/preschd_dag_0.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 951
3 | 2 1456 5
4 | 3 961 495
5 | 4 1461 1
6 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/preschd_dag_0.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 10 951
3 | 2 1340 7
4 | 3 961 379
5 | 4 1347 1
6 |
--------------------------------------------------------------------------------
/utils/python-gantt/requirements-dev.in:
--------------------------------------------------------------------------------
1 | -r requirements.in
2 | recommonmark
3 | sphinx-autobuild
4 | sphinx
5 | tox
--------------------------------------------------------------------------------
/inputs/ad/dag_input/preschd_dag_1.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 0 96
3 | 2 96 2
4 | 3 96 6
5 | 4 102 1
6 | 5 103 10
7 | 6 96 4
8 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/preschd_dag_7.txt:
--------------------------------------------------------------------------------
1 | 0 0 2
2 | 1 50 1
3 | 2 2 2
4 | 3 2 8
5 | 4 2 25
6 | 5 27 23
7 | 6 10 2
8 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/preschd_dag_0.txt:
--------------------------------------------------------------------------------
1 | 0 0 10
2 | 1 0 96
3 | 2 96 2
4 | 3 96 4
5 | 4 102 2
6 | 5 10 1
7 | 6 104 10
8 | 7 96 6
9 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/dag_1.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | track,0.99,1820,17,None,None,2
3 | path,0.00055,1,None,None,None,None
4 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/dag_0.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | detect,0.66,3530,156,None,96,None
3 | track,0.34,1820,17,None,None,2
4 | path,0.0002,1,None,None,None,None
5 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/preschd_dag_10.txt:
--------------------------------------------------------------------------------
1 | 0 0 1
2 | 1 42 9
3 | 2 1 2
4 | 3 3 39
5 | 4 42 8
6 | 5 2 18
7 | 6 20 2
8 | 7 1 1
9 | 8 50 2
10 | 9 20 29
11 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag_1.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.98,165,95,10,None,None
3 | collision,0.0006,1,None,None,None,None
4 | path,0.0006,1,None,None,None,None
5 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag_1.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.98,165,95,10,None,None
3 | collision,0.0006,1,None,None,None,None
4 | path,0.0006,1,None,None,None,None
5 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_5_slack.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | fft_256,0.66,319,10,1
3 | cnn_32,1.0,58,35,5
4 | decoder,0.63,100,2,None
5 | cnn_14,0.74,161,52,18
6 | fft_64,0.06,9,8,1
7 |
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag_1.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.46,165,95,10,None,None
3 | collision,0.19,1,None,None,None,None
4 | path,0.19,1,None,None,None,None
5 | detect,0.1,3530,156,96,None
6 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_5.txt:
--------------------------------------------------------------------------------
1 | type,sub-deadline-ratio,P1,P2,...,Pn
2 | fft_256,0.6,319,10,1
3 | cnn_32,0.11,58,35,5
4 | decoder,0.27,100,2,None
5 | cnn_14,0.3,161,52,18
6 | fft_64,0.03,9,8,1
7 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag_2.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.14,165,95,10,None,None
3 | map,0.85,973,761,None,None,None
4 | collision,0.0009,1,None,None,None,None
5 | path,0.0009,1,None,None,None,None
6 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag_2.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.14,165,95,10,None,None
3 | map,0.85,973,761,None,None,None
4 | collision,0.0009,1,None,None,None,None
5 | path,0.0009,1,None,None,None,None
6 |
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag_2.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.46,165,95,10,None,None
3 | map,0.19,973,761,None,None,None
4 | collision,0.19,1,None,None,None,None
5 | path,0.19,1,None,None,None,None
6 | detect,0.1,3530,156,96,None
7 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_7.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | decoder,0.2,99,2,None
3 | fft_128,0.17,84,8,1
4 | cnn_32,0.29,58,35,1
5 | fft_64,0.32,9,8,1
6 | cnn_14,0.32,161,52,19
7 | cnn_14,0.32,160,52,19
8 | decoder,0.51,100,2,None
9 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_7_slack.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | decoder,0.2,99,2,None
3 | fft_128,1.0,84,8,1
4 | cnn_32,0.37,58,35,1
5 | fft_64,0.04,9,8,1
6 | cnn_14,0.4,161,52,19
7 | cnn_14,0.66,160,52,19
8 | decoder,1.0,100,2,None
9 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag_3.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.998,165,95,10,None,None
3 | detect,0.66,3530,156,None,96,None
4 | track,0.34,1820,17,None,None,2
5 | fusion,0.000184,1,None,None,None,None
6 | motion,0.0014,8,None,None,None,None
7 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag_0.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.078,165,95,10,None,None
3 | map,0.45,973,761,None,None,None
4 | collision,0.0005,1,None,None,None,None
5 | sp,0.47,1004,379,None,None,None
6 | path,0.0005,1,None,None,None,None
7 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag_0.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.11,165,95,10.1,None,None
3 | map,0.63,973,761,None,None,None
4 | collision,0.0007,1,None,None,None,None
5 | Frontier,0.26,396,None,None,None,None
6 | path,0.0007,1,None,None,None,None
7 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag_2.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.98,165,95,10,None,None
3 | detect,0.66,3530,156,None,96,None
4 | track,0.34,1820,17,None,None,2
5 | fusion,0.00184,1,None,None,None,None
6 | mission,0.000011,1,None,None,None,None
7 | motion,0.0014,8,None,None,None,None
8 |
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag_0.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.11,165,95,10.1,None,None
3 | map,0.63,973,761,None,None,None
4 | collision,0.0007,1,None,None,None,None
5 | Frontier,0.0.26,396,None,None,None,None
6 | path,0.0007,1,None,None,None,None
7 | detect,0.1,3530,156,96,None
8 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag_1.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.998,165,95,10,None,None
3 | detect,0.66,3530,156,None,96,None
4 | track,0.34,1820,17,None,None,2
5 | track,0.34,1802,17,None,None,2
6 | fusion,0.000184,1,None,None,None,None
7 | motion,0.0014,8,None,None,None,None
8 | track,0.34,1820,17,None,None,2
9 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_10.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | fft_256,0.32,327,10,1
3 | fft_256,0.42,322,10,1
4 | decoder,0.1,101,2,None
5 | cnn_14,0.16,162,52,18
6 | fft_256,0.32,322,10,1
7 | cnn_14,0.27,162,52,18
8 | decoder,0.17,102,2,None
9 | fft_128,0.14,83,8,1
10 | decoder,0.1,100,2,None
11 | cnn_32,0.13,58,35,5
12 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi==2021.10.8
2 | mkl-fft==1.3.0
3 | mkl-random==1.0.2
4 | mkl-service==2.3.0
5 | networkx @ file:///tmp/build/80754af9/networkx_1633639043937/work
6 | numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1607448141537/work
7 | simpy==4.0.1
8 | six @ file:///tmp/build/80754af9/six_1623709665295/work
9 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag_10_slack.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | fft_256,0.32,327,10,1
3 | fft_256,1.0,322,10,1
4 | decoder,0.15,101,2,None
5 | cnn_14,0.28,162,52,18
6 | fft_256,0.76,322,10,1
7 | cnn_14,0.57,162,52,18
8 | decoder,0.83,102,2,None
9 | fft_128,0.18,83,8,1
10 | decoder,1.0,100,2,None
11 | cnn_32,1.0,58,35,5
12 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag_0.txt:
--------------------------------------------------------------------------------
1 | type,P1,P2,...,Pn
2 | loc,0.98,165,95,10,None,None
3 | detect,0.66,3530,156,None,96,None
4 | track,0.34,1820,17,None,None,2
5 | track,0.34,1820,17,None,None,2
6 | fusion,0.000184,1,None,None,None,None
7 | mission,0.000011,1,None,None,None,None
8 | motion,0.0014,8,None,None,None,None
9 | track,0.34,1820,17,None,None,2
10 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 | run_syn: simulator/stomp_main.py simulator/stomp.py simulator/meta.py inputs/stomp.json
3 | ./simulator/stomp_main.py
4 |
5 | run_ad: simulator/stomp_main.py simulator/stomp.py simulator/meta.py inputs/stomp_real.json
6 | ./simulator/stomp_main.py --conf-file=inputs/stomp_real.json
7 |
8 | clean:
9 | rm sched.* run_stdout_*
10 |
11 | clobber:
12 | rm -r sim_*
13 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/dag1.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/dag2.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/utils/python-gantt/MANIFEST.in:
--------------------------------------------------------------------------------
1 | #include *.txt
2 | include CHANGELOG
3 | include MANIFEST.in
4 | include Makefile
5 | include gpl-3.0.txt
6 | include setup.py
7 | include README.md
8 | include README.txt
9 | include requirements.txt
10 | include gantt/gantt.py
11 | include gantt/test_gantt.py
12 | include gantt/__init__.py
13 | include org2gantt/org2gantt.py
14 | include org2gantt/Orgnode.py
15 | include org2gantt/README.org
16 | include org2gantt/example.org
17 |
--------------------------------------------------------------------------------
/inputs/ariel/dag_input/dag0.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag1.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Python: Current File",
9 | "type": "python",
10 | "request": "launch",
11 | "program": "${file}",
12 | "console": "integratedTerminal",
13 | "justMyCode": false
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag2.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/utils/python-gantt/requirements.txt:
--------------------------------------------------------------------------------
1 | #
2 | # This file is autogenerated by pip-compile
3 | # Make changes in requirements.in, then run this to update:
4 | #
5 | # pip-compile requirements.in
6 | #
7 | argparse==1.4.0 # via dateutils
8 | clize==3.0
9 | dateutils==0.6.6
10 | funcsigs==0.4 # via sigtools
11 | pyparsing==2.0.7 # via svgwrite
12 | python-dateutil==2.4.2 # via dateutils
13 | pytz==2015.7 # via dateutils
14 | sigtools==1.0 # via clize
15 | six==1.10.0 # via clize, python-dateutil, sigtools
16 | svgwrite==1.1.6
17 |
--------------------------------------------------------------------------------
/inputs/search/dag_input/dag0.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag1.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 1
10 |
11 |
12 | 1
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag1.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 1
10 |
11 |
12 | 1
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/simulator/meta_policies/edf.py:
--------------------------------------------------------------------------------
1 |
2 | from meta import BaseMetaPolicy
3 | from meta import max_length
4 |
5 | class TaskVariables:
6 | def __init__(self):
7 | pass
8 |
9 | class DAGVariables:
10 | def __init__(self):
11 | pass
12 |
13 | class MetaPolicy(BaseMetaPolicy):
14 |
15 | def init(self, params):
16 | pass
17 |
18 | def set_task_variables(self, dag, task_node):
19 | return None
20 |
21 | def set_dag_variables(self, dag):
22 | return None
23 |
24 | def meta_static_rank(self, stomp, dag):
25 | pass
26 |
27 | def meta_dynamic_rank(self, stomp, task, comp, max_time, min_time, deadline, priority):
28 | pass
29 |
30 | def dropping_policy(self, dag, task_node):
31 | return False
32 |
33 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag2.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 761
10 |
11 |
12 | 1
13 |
14 |
15 | 1
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag2.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 761
10 |
11 |
12 | 1
13 |
14 |
15 | 1
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag3.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 96
10 |
11 |
12 | 2
13 |
14 |
15 | 1
16 |
17 |
18 | 8
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/inputs/mapping/dag_input/dag0.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 761
10 |
11 |
12 | 1
13 |
14 |
15 | 396
16 |
17 |
18 | 1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/inputs/package/dag_input/dag0.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 761
10 |
11 |
12 | 1
13 |
14 |
15 | 379
16 |
17 |
18 | 1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag5.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 1
7 |
8 |
9 | 5
10 |
11 |
12 | 2
13 |
14 |
15 | 18
16 |
17 |
18 | 1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag2.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 96
10 |
11 |
12 | 2
13 |
14 |
15 | 1
16 |
17 |
18 | 0
19 |
20 |
21 | 8
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/utils/python-gantt/gantt/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | python-gantt - 2015.01.04
6 |
7 | python-gantt is a python library which helps to draw gantt charts.
8 |
9 |
10 | Author :
11 |
12 | * Alexandre Norman - norman@xael.org
13 |
14 |
15 | Licence : GPL v3 or any later version
16 |
17 |
18 | This program is free software: you can redistribute it and/or modify
19 | it under the terms of the GNU General Public License as published by
20 | the Free Software Foundation, either version 3 of the License, or
21 | any later version.
22 |
23 | This program is distributed in the hope that it will be useful,
24 | but WITHOUT ANY WARRANTY; without even the implied warranty of
25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 | GNU General Public License for more details.
27 |
28 | You should have received a copy of the GNU General Public License
29 | along with this program. If not, see .
30 | """
31 |
32 | from .gantt import *
33 | from .gantt import __author__
34 | from .gantt import __version__
35 | from .gantt import __last_modification__
36 |
--------------------------------------------------------------------------------
/utils/python-gantt/tox.ini:
--------------------------------------------------------------------------------
1 | [base]
2 | # Let's configure base dependencies
3 | deps =
4 | flake8
5 | coverage
6 | nose
7 | clize
8 | argparse==1.4.0 # via dateutils
9 | backports-abc==0.4 # via tornado
10 | commonmark==0.5.4 # via recommonmark
11 | dateutils==0.6.6
12 | pyparsing==2.0.6 # via svgwrite
13 | python-dateutil==2.4.2 # via dateutils
14 | pytz==2015.7 # via babel, dateutils
15 | recommonmark==0.2.0
16 | six==1.10.0 # via livereload, python-dateutil, sphinx
17 | svgwrite==1.1.6
18 |
19 |
20 | [tox]
21 | # Here is the list of our environments
22 | envlist =
23 | py27,
24 | py34
25 |
26 | [testenv]
27 | # Install current package before testing
28 | usedevelop = True
29 |
30 | # Configure the actual testing command
31 | whitelist_externals = /usr/bin/make
32 | commands =
33 | make toxtest
34 |
35 | # Let's define specific dependencies for each environment
36 | [testenv:py27]
37 | basepython = python2.7
38 | deps =
39 | {[base]deps}
40 |
41 | [testenv:py34]
42 | basepython = python3.4
43 | deps =
44 | {[base]deps}
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag1.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 96
10 |
11 |
12 | 2
13 |
14 |
15 | 2
16 |
17 |
18 | 1
19 |
20 |
21 | 8
22 |
23 |
24 | 2
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag7.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 2
7 |
8 |
9 | 1
10 |
11 |
12 | 1
13 |
14 |
15 | 1
16 |
17 |
18 | 19
19 |
20 |
21 | 19
22 |
23 |
24 | 2
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/inputs/ad/dag_input/dag0.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 10
7 |
8 |
9 | 96
10 |
11 |
12 | 2
13 |
14 |
15 | 2
16 |
17 |
18 | 1
19 |
20 |
21 | 0
22 |
23 |
24 | 8
25 |
26 |
27 | 2
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/simulator/meta_policies/ms_wcet.py:
--------------------------------------------------------------------------------
1 |
2 | from meta import BaseMetaPolicy
3 | from meta import max_length
4 |
5 | class TaskVariables:
6 | def __init__(self):
7 | pass
8 |
9 | class DAGVariables:
10 | def __init__(self):
11 | pass
12 |
13 | class MetaPolicy(BaseMetaPolicy):
14 |
15 | def init(self, params):
16 | pass
17 |
18 | def set_task_variables(self, dag, task_node):
19 | return None
20 |
21 | def set_dag_variables(self, dag):
22 | return None
23 |
24 | def meta_static_rank(self, stomp, dag):
25 | pass
26 |
27 | def meta_dynamic_rank(self, stomp, task, comp, max_time, min_time, deadline, priority):
28 |
29 | wcet_slack = deadline - max_time
30 | bcet_slack = deadline - min_time
31 | if (wcet_slack >= 0):
32 | # WCET deadline exists
33 | slack = 1 + wcet_slack
34 | task.rank = int((100000 * (priority))/slack)
35 | else:
36 | # Missed WCET deadline
37 | slack = 1 + 0.99/wcet_slack
38 | task.rank = int((100000 * (priority))/slack)
39 |
40 | def dropping_policy(self, dag, task_node):
41 | ex_time = max_length(dag.graph, task_node) #BCET of critical path
42 | if(dag.slack - ex_time < 0 and dag.priority == 1):
43 | dag.dropped = 1
44 | return True
45 |
46 | return False
47 |
48 |
--------------------------------------------------------------------------------
/utils/python-gantt/requirements-dev.txt:
--------------------------------------------------------------------------------
1 | #
2 | # This file is autogenerated by pip-compile
3 | # Make changes in requirements-dev.in, then run this to update:
4 | #
5 | # pip-compile requirements-dev.in
6 | #
7 | alabaster==0.7.7 # via sphinx
8 | argh==0.26.1 # via sphinx-autobuild, watchdog
9 | argparse==1.4.0 # via dateutils
10 | babel==2.2.0 # via sphinx
11 | backports-abc==0.4 # via tornado
12 | clize==3.0
13 | commonmark==0.5.4 # via recommonmark
14 | dateutils==0.6.6
15 | docutils==0.12 # via recommonmark, sphinx
16 | jinja2==2.8 # via sphinx
17 | livereload==2.4.1 # via sphinx-autobuild
18 | markupsafe==0.23 # via jinja2
19 | pathtools==0.1.2 # via sphinx-autobuild, watchdog
20 | pluggy==0.3.1 # via tox
21 | py==1.4.31 # via tox
22 | pygments==2.1 # via sphinx
23 | pyparsing==2.0.7 # via svgwrite
24 | python-dateutil==2.4.2 # via dateutils
25 | pytz==2015.7 # via babel, dateutils
26 | pyyaml==3.11 # via sphinx-autobuild, watchdog
27 | recommonmark==0.4.0
28 | sigtools==1.0 # via clize
29 | six==1.10.0 # via clize, livereload, python-dateutil, sigtools, sphinx
30 | snowballstemmer==1.2.1 # via sphinx
31 | sphinx-autobuild==0.5.2
32 | sphinx-rtd-theme==0.1.9 # via sphinx
33 | sphinx==1.3.5
34 | svgwrite==1.1.6
35 | tornado==4.3 # via livereload, sphinx-autobuild
36 | tox==2.3.1
37 | virtualenv==14.0.5 # via tox
38 | watchdog==0.8.3 # via sphinx-autobuild
39 |
--------------------------------------------------------------------------------
/inputs/synthetic/dag_input/dag10.graphml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 1
7 |
8 |
9 | 1
10 |
11 |
12 | 2
13 |
14 |
15 | 18
16 |
17 |
18 | 1
19 |
20 |
21 | 18
22 |
23 |
24 | 2
25 |
26 |
27 | 1
28 |
29 |
30 | 2
31 |
32 |
33 | 5
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/utils/python-gantt/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 |
4 | #from distutils.core import setup, Extension
5 |
6 | from setuptools import setup, find_packages # Always prefer setuptools over distutils
7 | from codecs import open # To use a consistent encoding
8 | from os import path
9 |
10 | here = path.abspath(path.dirname(__file__))
11 |
12 | # Get the long description from the relevant file
13 | with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
14 | long_description = f.read()
15 |
16 | setup (
17 | name = 'python-gantt',
18 | version = '0.6.0',
19 | author = 'Alexandre Norman',
20 | author_email = 'norman@xael.org',
21 | license ='gpl-3.0.txt',
22 | keywords="gantt, graphics, scheduling, project management",
23 | # Get more strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
24 | platforms=[
25 | "Operating System :: OS Independent",
26 | ],
27 | classifiers=[
28 | "Development Status :: 5 - Production/Stable",
29 | "Programming Language :: Python",
30 | "Environment :: Console",
31 | "Intended Audience :: Developers",
32 | "Intended Audience :: End Users/Desktop",
33 | "License :: OSI Approved :: GNU General Public License (GPL)",
34 | "Operating System :: OS Independent",
35 | "Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
36 | "Topic :: Office/Business :: Scheduling",
37 | "Topic :: Scientific/Engineering :: Visualization",
38 | ],
39 | packages=['gantt'],
40 | url = 'http://xael.org/pages/python-gantt-en.html',
41 | bugtrack_url = 'https://bitbucket.org/xael/python-gantt',
42 | description = 'This is a python class to create gantt chart using SVG.',
43 | long_description=long_description,
44 | install_requires=[
45 | 'svgwrite>=1.1.6',
46 | 'clize>=2.0',
47 | 'python-dateutil>=2.4'
48 | ],
49 | zip_safe = True,
50 | )
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/inputs/ad/trace_files/ad_trace.trc:
--------------------------------------------------------------------------------
1 | 0,0,2,3,400
2 | 2,1,0,1,400
3 | 23,2,0,1,400
4 | 24,3,1,1,400
5 | 35,4,0,1,400
6 | 41,5,0,1,400
7 | 45,6,3,1,400
8 | 66,7,1,1,400
9 | 69,8,0,1,400
10 | 72,9,2,1,400
11 | 81,10,0,3,400
12 | 97,11,2,1,400
13 | 99,12,0,1,400
14 | 104,13,0,1,400
15 | 113,14,0,1,400
16 | 116,15,2,1,400
17 | 126,16,2,1,400
18 | 132,17,1,1,400
19 | 137,18,3,1,400
20 | 144,19,2,1,400
21 | 159,20,3,3,400
22 | 162,21,2,1,400
23 | 186,22,2,1,400
24 | 189,23,3,1,400
25 | 200,24,3,1,400
26 | 200,25,0,1,400
27 | 205,26,2,1,400
28 | 206,27,2,1,400
29 | 206,28,2,1,400
30 | 239,29,2,1,400
31 | 256,30,0,3,400
32 | 264,31,0,1,400
33 | 282,32,2,1,400
34 | 286,33,2,1,400
35 | 301,34,3,1,400
36 | 317,35,3,1,400
37 | 325,36,3,1,400
38 | 329,37,2,1,400
39 | 341,38,3,1,400
40 | 352,39,2,1,400
41 | 361,40,2,3,400
42 | 378,41,0,1,400
43 | 379,42,3,1,400
44 | 384,43,2,1,400
45 | 386,44,2,1,400
46 | 409,45,0,1,400
47 | 415,46,3,1,400
48 | 439,47,3,1,400
49 | 458,48,0,1,400
50 | 468,49,3,1,400
51 | 486,50,1,3,400
52 | 490,51,2,1,400
53 | 506,52,0,1,400
54 | 509,53,1,1,400
55 | 522,54,3,1,400
56 | 535,55,2,1,400
57 | 572,56,3,1,400
58 | 573,57,0,1,400
59 | 594,58,0,1,400
60 | 596,59,2,1,400
61 | 600,60,3,3,400
62 | 605,61,2,1,400
63 | 613,62,0,1,400
64 | 619,63,0,1,400
65 | 635,64,0,1,400
66 | 658,65,2,1,400
67 | 678,66,0,1,400
68 | 696,67,2,1,400
69 | 758,68,0,1,400
70 | 785,69,3,1,400
71 | 796,70,3,3,400
72 | 829,71,1,1,400
73 | 833,72,1,1,400
74 | 846,73,2,1,400
75 | 853,74,3,1,400
76 | 867,75,0,1,400
77 | 882,76,0,1,400
78 | 885,77,0,1,400
79 | 886,78,3,1,400
80 | 925,79,2,1,400
81 | 927,80,3,3,400
82 | 936,81,0,1,400
83 | 946,82,2,1,400
84 | 969,83,2,1,400
85 | 974,84,3,1,400
86 | 1011,85,2,1,400
87 | 1012,86,2,1,400
88 | 1015,87,1,1,400
89 | 1020,88,3,1,400
90 | 1023,89,3,1,400
91 | 1034,90,2,3,400
92 | 1051,91,1,1,400
93 | 1054,92,0,1,400
94 | 1058,93,2,1,400
95 | 1079,94,1,1,400
96 | 1084,95,2,1,400
97 | 1087,96,1,1,400
98 | 1106,97,1,1,400
99 | 1108,98,0,1,400
100 | 1109,99,1,1,400
101 |
--------------------------------------------------------------------------------
/simulator/meta_policies/ms.py:
--------------------------------------------------------------------------------
1 |
2 | from meta import BaseMetaPolicy
3 | from meta import max_length
4 |
5 | class TaskVariables:
6 | def __init__(self):
7 | pass
8 |
9 | class DAGVariables:
10 | def __init__(self):
11 | pass
12 |
13 | class MetaPolicy(BaseMetaPolicy):
14 |
15 | def init(self, params):
16 | pass
17 |
18 | def set_task_variables(self, dag, task_node):
19 | return None
20 |
21 | def set_dag_variables(self, dag):
22 | return None
23 |
24 | def meta_static_rank(self, stomp, dag):
25 | pass
26 |
27 | def meta_dynamic_rank(self, stomp, task, comp, max_time, min_time, deadline, priority):
28 |
29 | wcet_slack = deadline - max_time
30 | bcet_slack = deadline - min_time
31 | if (priority > 1):
32 | if (wcet_slack >= 0):
33 | slack = 1 + wcet_slack
34 | task.rank = int((100000 * (priority))/slack)
35 | task.rank_type = 3
36 | elif (bcet_slack >= 0):
37 | slack = 1 + bcet_slack
38 | task.rank = int((100000 * (priority))/slack)
39 | task.rank_type = 4
40 | else:
41 | slack = 1 + 0.99/bcet_slack
42 | task.rank = int((100000 * (priority))/slack)
43 | task.rank_type = 5
44 | else:
45 | if (wcet_slack >= 0):
46 | slack = 1 + wcet_slack
47 | task.rank = int((100000 * (priority))/slack)
48 | task.rank_type = 2
49 | elif (bcet_slack >= 0):
50 | slack = 1 + bcet_slack
51 | task.rank = int((100000 * (priority))/slack)
52 | task.rank_type = 1
53 | else:
54 | slack = 1 + 0.99/bcet_slack
55 | task.rank = int((100000 * (priority))/slack)
56 | task.rank_type = 0
57 |
58 | def dropping_policy(self, dag, task_node):
59 | ex_time = max_length(dag.graph, task_node) #BCET of critical path
60 | if(dag.slack - ex_time < 0 and dag.priority == 1):
61 | dag.dropped = 1
62 | return True
63 |
64 | return False
65 |
66 |
--------------------------------------------------------------------------------
/simulator/meta_policies/heft.py:
--------------------------------------------------------------------------------
1 |
2 | from meta import BaseMetaPolicy
3 |
4 | class TaskVariables:
5 | def __init__(self):
6 | pass
7 |
8 | class DAGVariables:
9 | def __init__(self):
10 | pass
11 |
12 | class MetaPolicy(BaseMetaPolicy):
13 |
14 | def init(self, params):
15 | pass
16 |
17 | def set_task_variables(self, dag, task_node):
18 | return None
19 |
20 | def set_dag_variables(self, dag):
21 | return None
22 |
23 | def meta_static_rank(self, stomp, dag):
24 | graph = dag.graph
25 | comp = dag.comp
26 | size = len(graph.nodes())
27 | childs= [-1]*size
28 |
29 | while size > 0:
30 | for node in graph.nodes():
31 |
32 | child_rank_comp = True
33 | child_rank = [0]
34 | for child in graph.successors(node):
35 | child_rank.append(childs[child.tid])
36 | if childs[child.tid]== -1:
37 | child_rank_comp = False
38 |
39 |
40 | if child_rank_comp == True:
41 | if node.rank ==-1:
42 | size -=1
43 | sum=0
44 | count = 0
45 | i = 0
46 | num_servers = 0
47 | for service_time in comp[node.tid]:
48 | # Ignore first two columns.
49 | if (count <= 1):
50 | count += 1
51 | continue
52 | else:
53 | if (service_time != "None"):
54 | sum += round(float(service_time))
55 | num_servers += stomp.params['simulation']['servers'][stomp.server_types[i]]['count']
56 | i += 1
57 | count += 1
58 |
59 | node.rank = sum/(num_servers) + max(child_rank)
60 | childs[node.tid] = node.rank
61 | # print("tid: %d, rank: %d" %(node.tid, node.rank))
62 |
63 |
64 | def meta_dynamic_rank(self, stomp, task, comp, max_time, min_time, deadline, priority):
65 | pass
66 |
67 | def dropping_policy(self, dag, task_node):
68 | pass
69 |
--------------------------------------------------------------------------------
/utils/trace_generator.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import sys, getopt
3 | import importlib
4 | import json
5 | import collections
6 | import numpy
7 |
8 | probs = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
9 | app = "synthetic"
10 | dag_type_choice = ['5', '7', '10']
11 | deadline = [537, 428, 1012]
12 |
13 | class TRACE:
14 |
15 | def __init__(self, stomp_params):
16 | self.params = stomp_params
17 | self.params['max_dags_simulated'] = 1000
18 | self.output_trace_file = ""
19 | self.working_dir = "."
20 | self.sim_time = 0
21 | self.count_dags = 0
22 |
23 | def run(self):
24 |
25 | output_trace = {}
26 | for prob in probs:
27 | self.output_trace_file = "inputs/" + app + "/trace_files/" + app + "_trace_" + str(prob) + ".trc"
28 | if (self.output_trace_file):
29 | out_trace_name = self.working_dir + '/' + self.output_trace_file
30 | # logging.info('Generating output trace file to %s' % (out_trace_name))
31 | output_trace[prob] = open(out_trace_name, 'w')
32 |
33 | self.sim_time = 0
34 | self.count_dags = 0
35 |
36 | print("MAT: %d, ATS: %d" %(self.params['simulation']['mean_arrival_time'],self.params['simulation']['arrival_time_scale']))
37 |
38 | for dag_id in range(self.params['max_dags_simulated']):
39 | atime = self.sim_time
40 | dag_id = self.count_dags
41 | dag_type = numpy.random.choice(dag_type_choice)
42 | for prob in probs:
43 | if (dag_id % (int(1/prob)) == 0):
44 | priority = '3'
45 | #priority = numpy.random.choice(['1','3'], p=[1-prob, prob])
46 | else:
47 | priority = '1'
48 | deadline_dag = deadline[dag_type_choice.index(dag_type)]
49 | # trace_entry = (atime,dag_id,dag_type,priority,deadline_dag)
50 | output_trace[prob].write('%d,%d,%s,%s,%d\n' % (atime,dag_id,dag_type,priority,deadline_dag))
51 |
52 | self.sim_time = int(numpy.round(self.sim_time + numpy.random.exponential(scale=self.params['simulation']['mean_arrival_time']*self.params['simulation']['arrival_time_scale'], size=1)))
53 | self.count_dags += 1
54 |
55 | if __name__ == "__main__":
56 |
57 | conf_file = "stomp.json"
58 | stomp_params = {}
59 | with open(conf_file) as conf_file:
60 | stomp_params = json.load(conf_file)
61 | trace = TRACE(stomp_params)
62 | trace.run()
63 |
64 |
--------------------------------------------------------------------------------
/utils/python-gantt/org2gantt/taskjuggler.org:
--------------------------------------------------------------------------------
1 | #+PROPERTY: Effort_ALL 2d 5d 10d 20d 30d 35d 50d
2 | #+PROPERTY: allocate_ALL dev doc test
3 | #+COLUMNS: %30ITEM(Task) %Effort %allocate %BLOCKER %ORDERED
4 |
5 | * Accounting Software
6 |
7 | ** Milestones
8 | *** TODO Project start
9 | SCHEDULED: <2015-01-09 Fri>
10 | :PROPERTIES:
11 | :task_id: start
12 | :Effort: 1d
13 | :END:
14 |
15 | *** TODO Technology Preview
16 | :PROPERTIES:
17 | :BLOCKER: back_end
18 | :Effort: 1d
19 | :END:
20 |
21 | *** TODO Beta version
22 | :PROPERTIES:
23 | :BLOCKER: alpha
24 | :Effort: 1d
25 | :END:
26 |
27 | *** TODO Ship Product to Customer
28 | :PROPERTIES:
29 | :BLOCKER: beta manual
30 | :Effort: 1d
31 | :END:
32 |
33 | ** TODO Specification
34 | :PROPERTIES:
35 | :Effort: 20d
36 | :BLOCKER: start
37 | :allocate: dev
38 | :END:
39 |
40 | ** Software Development
41 | :PROPERTIES:
42 | :ORDERED: t
43 | :BLOCKER: previous-sibling
44 | :priority: 1000
45 | :allocate: dev
46 | :END:
47 |
48 | *** TODO Database coupling
49 | :PROPERTIES:
50 | :Effort: 20d
51 | :END:
52 |
53 | *** TODO Back-End Functions
54 | :PROPERTIES:
55 | :Effort: 30d
56 | :task_id: back_end
57 | :END:
58 |
59 | *** TODO Graphical User Interface
60 | :PROPERTIES:
61 | :Effort: 35d
62 | :allocate: paul, seb
63 | :END:
64 |
65 | ** Software testing
66 | :PROPERTIES:
67 | :ORDERED: t
68 | :BLOCKER: previous-sibling
69 | :allocate: test
70 | :END:
71 | *** TODO Alpha Test
72 | :PROPERTIES:
73 | :Effort: 5d
74 | :task_id: alpha
75 | :END:
76 |
77 | *** TODO Beta Test
78 | :PROPERTIES:
79 | :Effort: 20d
80 | :task_id: beta
81 | :allocate: test, paul
82 | :END:
83 |
84 | ** TODO Manual
85 | :PROPERTIES:
86 | :Effort: 50d
87 | :task_id: manual
88 | :BLOCKER: start
89 | :allocate: doc
90 | :END:
91 |
92 | * RESOURCES
93 | ** Developers
94 | :PROPERTIES:
95 | :resource_id: dev
96 | :END:
97 | *** Paul Smith
98 | :PROPERTIES:
99 | :resource_id: paul
100 | :END:
101 | *** Sébastien Bono
102 | :PROPERTIES:
103 | :resource_id: seb
104 | :END:
105 | *** Klaus Müller
106 |
107 | ** Others
108 | *** Peter Murphy
109 | :PROPERTIES:
110 | :resource_id: doc
111 | :limits: { dailymax 6.4h }
112 | :END:
113 | *** Dim Sung
114 | :PROPERTIES:
115 | :resource_id: test
116 | :END:
117 |
118 |
--------------------------------------------------------------------------------
/utils/python-gantt/Makefile:
--------------------------------------------------------------------------------
1 | # python-gantt Makefile
2 |
3 | VERSION=$(shell $(PYTHON) setup.py --version)
4 | ARCHIVE=$(shell $(PYTHON) setup.py --fullname)
5 | PYTHON=python3.4
6 | PANDOC=~/.cabal/bin/pandoc
7 |
8 | install:
9 | @$(PYTHON) setup.py install
10 |
11 | check_version_consistency:
12 | SETUPVERSION=$(shell python setup.py --version 2> /dev/null)
13 | PYTHOVERSION=$(shell python -c 'import gantt; print(gantt.__version__)')
14 | ifneq ($(shell python setup.py --version 2> /dev/null), $(shell python -c 'import gantt; print(gantt.__version__)'))
15 | $(error VERSION INCONSISTENCY between setup.py and gantt/gantt.py)
16 | endif
17 |
18 | archive: doc readme changelog
19 | @$(PYTHON) setup.py sdist
20 | @echo Archive is create and named dist/$(ARCHIVE).tar.gz
21 | @echo -n md5sum is :
22 | @md5sum dist/$(ARCHIVE).tar.gz
23 |
24 | license:
25 | @$(PYTHON) setup.py --license
26 |
27 | readme:
28 | @$(PANDOC) -f org -t markdown_github org2gantt/README.org -o org2gantt/README.txt
29 | @$(PANDOC) -f markdown -t rst README.md -o README.txt
30 |
31 | changelog:
32 | @hg shortlog |~/.cabal/bin/pandoc -f org -t plain > CHANGELOG
33 |
34 |
35 | test:
36 | nosetests gantt
37 | export PYTHONPATH=$(shell pwd)/gantt; $(PYTHON) org2gantt/org2gantt.py org2gantt/example.org -r -g test.py
38 | export PYTHONPATH=$(shell pwd)/gantt; $(PYTHON) test.py
39 | rm test.py
40 |
41 | tox:
42 | tox
43 |
44 | toxtest:
45 | nosetests gantt
46 | export PYTHONPATH=$(shell pwd)/gantt; $(PYTHON) org2gantt/org2gantt.py org2gantt/example.org -r -g test.py
47 | export PYTHONPATH=$(shell pwd)/gantt; $(PYTHON) test.py
48 | rm test.py
49 |
50 | conformity:
51 | pyflakes org2gantt/org2gantt.py
52 | pyflakes gantt/gantt.py
53 | flake8 org2gantt/org2gantt.py
54 | flake8 gantt/gantt.py
55 |
56 |
57 | pipregister:
58 | $(PYTHON) setup.py register
59 |
60 | register:
61 | $(PYTHON) setup.py sdist upload --identity="Alexandre Norman" --sign --quiet
62 |
63 | doc:
64 | @pydoc -w gantt/gantt.py
65 |
66 | web:
67 | @cp dist/$(ARCHIVE).tar.gz web2/
68 | @m4 -DVERSION=$(VERSION) -DMD5SUM=$(shell md5sum dist/$(ARCHIVE).tar.gz |cut -d' ' -f1) -DDATE=$(shell date +%Y-%m-%d) web2/index.md.m4 > web2/index.md
69 | @m4 -DVERSION=$(VERSION) -DMD5SUM=$(shell md5sum dist/$(ARCHIVE).tar.gz |cut -d' ' -f1) -DDATE=$(shell date +%Y-%m-%d) web2/index-en.md.m4 > web2/index-en.md
70 | @bash -c 'source /usr/local/bin/virtualenvwrapper.sh; workon xael.org; make ftp_upload'
71 |
72 | hgcommit:
73 | hg commit || true
74 | hg tag $(VERSION) -f
75 | hg push
76 |
77 |
78 | release: check_version_consistency tox doc changelog hgcommit register web
79 |
80 |
81 | .PHONY: web
82 |
--------------------------------------------------------------------------------
/utils/trace_generator_real.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import sys, getopt
3 | import importlib
4 | import json
5 | import collections
6 | import numpy
7 |
8 | probs = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
9 | app = "ad"
10 | dag_type_choice = [0,1,2,3]
11 | deadline = [400, 400, 400, 400] #ad
12 |
13 |
14 | #app = "mapping"
15 | #dag_type_choice = [0,1,2]
16 | #deadline = [1536, 167, 1140] #mapping
17 |
18 | #app = "package"
19 | #dag_type_choice = [0,1,2]
20 | #deadline = [2144, 167, 1140] #package
21 |
22 |
23 | class TRACE:
24 |
25 | def __init__(self, stomp_params):
26 | self.params = stomp_params
27 | self.params['max_dags_simulated'] = 1000
28 | self.output_trace_file = ""
29 | self.working_dir = "."
30 | self.sim_time = 0
31 | self.count_dags = 0
32 |
33 | def run(self):
34 |
35 | output_trace = {}
36 | for prob in probs:
37 | self.output_trace_file = "inputs/" + app + "/trace_files/" + app + "_trace_" + str(prob) + ".trc"
38 | print(self.output_trace_file)
39 | if (self.output_trace_file):
40 | out_trace_name = self.working_dir + '/' + self.output_trace_file
41 | # logging.info('Generating output trace file to %s' % (out_trace_name))
42 | output_trace[prob] = open(out_trace_name, 'w')
43 |
44 | self.sim_time = 0
45 | self.count_dags = 0
46 |
47 | print("MAT: %d, ATS: %d" %(self.params['simulation']['mean_arrival_time'],self.params['simulation']['arrival_time_scale']))
48 |
49 | for dag_id in range(self.params['max_dags_simulated']):
50 | atime = self.sim_time
51 | dag_id = self.count_dags
52 | dag_type = numpy.random.choice(dag_type_choice)
53 | for prob in probs:
54 | if (dag_id % (int(1/prob)) == 0):
55 | priority = '3'
56 | #priority = numpy.random.choice(['1','3'], p=[1-prob, prob])
57 | else:
58 | priority = '1'
59 | deadline_dag = deadline[dag_type_choice.index(dag_type)]
60 | # trace_entry = (atime,dag_id,dag_type,priority,deadline_dag)
61 | output_trace[prob].write('%d,%d,%d,%s,%d\n' % (atime,dag_id,dag_type,priority,deadline_dag))
62 |
63 | self.sim_time = int(numpy.round(self.sim_time + numpy.random.exponential(scale=self.params['simulation']['mean_arrival_time']*self.params['simulation']['arrival_time_scale'], size=1)))
64 | self.count_dags += 1
65 |
66 | if __name__ == "__main__":
67 |
68 | conf_file = "inputs/stomp_real.json"
69 | stomp_params = {}
70 | with open(conf_file) as conf_file:
71 | stomp_params = json.load(conf_file)
72 | trace = TRACE(stomp_params)
73 | trace.run()
74 |
75 |
--------------------------------------------------------------------------------
/simulator/task_policies/simple_policy_ver1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright 2018 IBM
4 | #
5 | # This is free software; you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation; either version 3, or (at your option)
8 | # any later version.
9 | #
10 | # This software is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with this software; see the file COPYING. If not, write to
17 | # the Free Software Foundation, Inc., 51 Franklin Street,
18 | # Boston, MA 02110-1301, USA.
19 | #
20 |
21 | # SCHEDULING POLICY DESCRIPTION:
22 | # This scheduling policy tries to schedule the task at the head of the
23 | # queue ONLY in its best scheduling option (i.e. fastest server).
24 | # If a queue from the best scheduling option isn't available, the task
25 | # remains in the queue (i.e. no other less-optimal server platform is
26 | # considered).
27 |
28 | import logging
29 | from stomp import BaseSchedulingPolicy
30 | from datetime import datetime, timedelta
31 |
32 | class SchedulingPolicy(BaseSchedulingPolicy):
33 |
34 | def init(self, servers, stomp_stats, stomp_params):
35 |
36 | self.stomp_stats = stomp_stats
37 | self.stomp_params = stomp_params
38 | self.servers = servers
39 | self.n_servers = len(servers)
40 | self.ta_time = timedelta(microseconds=0)
41 | self.to_time = timedelta(microseconds=0)
42 |
43 | def assign_task_to_server(self, sim_time, tasks, dags_dropped, drop_hint_list):
44 |
45 | if (len(tasks) == 0):
46 | # There aren't tasks to serve
47 | return None
48 |
49 | # Determine task's best scheduling option (target server)
50 | target_server_type = tasks[0].mean_service_time_list[0][0]
51 | # logging.info(tasks)
52 | # logging.info('POL: %d,%s,%d,%d,%d,%d,%s' % (sim_time, tasks[0].type, tasks[0].dag_id, tasks[0].tid, tasks[0].priority, tasks[0].deadline, ','.join(map(str, tasks[0].per_server_services))))
53 | # if(sim_time != tasks[0].arrival_time):
54 | # logging.info("CHECK")
55 | # Look for an available server to process the task
56 | for server in self.servers:
57 |
58 | if (server.type == target_server_type and not server.busy):
59 |
60 | # Pop task in queue's head and assign it to server
61 | # print('SERVER_ASSIGNED: %d,%s,%d,%s,%d,%d\n' % (sim_time, server.type, server.id, tasks[0].type, tasks[0].dag_id, tasks[0].tid)) #Aporva
62 | # for server_stat in self.servers:
63 | # if (server_stat.busy):
64 | # print('BUSY: %s,%d,%s' % (server_stat.type, server_stat.id, server_stat.busy))
65 | task = tasks.pop(0)
66 | task.ptoks_used = task.power_dict[server.type]
67 | server.assign_task(sim_time, task)
68 | return server
69 |
70 | return None
71 |
72 |
73 | def remove_task_from_server(self, sim_time, server):
74 | pass
75 |
76 | def output_final_stats(self, sim_time):
77 | pass
78 |
--------------------------------------------------------------------------------
/simulator/task_policies/README.md:
--------------------------------------------------------------------------------
1 | # STOMP Policies
2 |
3 | This subdirectory contains *policies* to be used by STOMP during various simulations. A policy in STOMP is generated by writing a small amount of Python code to fill out the contents of a base class *BaseSchedulingPolicy*.
4 | This base class contains only three main routines:
5 | * init
6 | * assign_task_to_server
7 | * remove_task_from_server
8 |
9 |
10 | ## The 'init' Routine
11 |
12 | The 'init' routine is largely boilerplate and mostly ensures that the policy class has copies of the servers, stomp_stats and stomp_params data for the current simulation run. In most cases this routine will have the form as below:
13 | ```
14 | def init(self, servers, stomp_stats, stomp_params):
15 | self.stomp_stats = stomp_stats
16 | self.stomp_params = stomp_params
17 | self.servers = servers
18 | self.n_servers = len(servers)
19 | ```
20 | If the scheduling policy also required additional state or initialization, that could also be placed in the init routine.
21 |
22 | ### Inputs to 'init'
23 | The inputs to the init routine are
24 | * the servers present in the current STOMP simulation
25 | * the statistics tracked by STOMP
26 | * the parameters to the current STOMP run
27 |
28 | ## The 'assign_task_to_server' Routine
29 |
30 | The 'assign_task_to_server' routine is used to determine which server should be assigned the next task to be assigned. This is the primary focus of the scheduler policy analysis at this time, and this STOMP distribution contains several example policies to help prospective policy writers to understand how one might make such a decision. Note that the 'assign_task_to_server' has access to the servers of the current STOMP simulation (see the 'class Server' in stomp.py) and the set of tasks (see 'class Task' in the stomp.py code) and thus can make use of the members of those classes to determine to which server (from among the 'servers') the current task (which is at 'tasks[0]') should be scheduled.
31 |
32 |
33 | ### Inputs to 'assign_task_to_server'
34 | The inputs to the 'assign_task_to_server' routine are:
35 | * The current simulation time
36 | * The current list of to-be-scheduled tasks
37 |
38 | *Note:*
39 | At this time, STOMP always schedules the first task in the waiting tasks list. Support for scheduling tasks out of arrival order is a current TO-DO.
40 |
41 |
42 | ## The 'remove_task_from_server' Routine
43 |
44 | The 'remove_task_from_server' routine is invoked when a task is retired from the simulation, and is primarily intended to allow the policy to clean up whatever internal data or state is necessary on task retirement. The current example policies do not yet require any action at task retirement time, and so their 'remove_task_from_server' routine is as below:
45 |
46 | ```
47 | def remove_task_from_server(self, sim_time, server):
48 | pass
49 | ```
50 |
51 | ### Inputs to 'remove_task_from_server'
52 | The inputs (arguments) to the 'remove_task_from_server' routine are:
53 | * the current simulation time
54 | * the server from which the task is being removed/finishing/retiring
55 |
56 | ## Requirements
57 |
58 | STOMP requires:
59 | * Python 2.7
60 |
61 |
62 | ## Contributors
63 |
64 | * Augusto Vega (IBM) -- ajvega@us.ibm.com
65 | * J-D Wellman (IBM) -- wellman@us.ibm.com
66 |
67 | ## Current Maintainers
68 |
69 | * Augusto Vega (IBM) -- ajvega@us.ibm.com
70 | * J-D Wellman (IBM) -- wellman@us.ibm.com
71 |
--------------------------------------------------------------------------------
/simulator/task_policies/edf.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright 2018 IBM
4 | #
5 | # This is free software; you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation; either version 3, or (at your option)
8 | # any later version.
9 | #
10 | # This software is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with this software; see the file COPYING. If not, write to
17 | # the Free Software Foundation, Inc., 51 Franklin Street,
18 | # Boston, MA 02110-1301, USA.
19 | #
20 |
21 | # SCHEDULING POLICY DESCRIPTION:
22 | # This scheduling policy tries to schedule the task at the head of the
23 | # queue in its best scheduling option (i.e. fastest server). If the best
24 | # scheduling option isn't available, the policy will try to schedule the
25 | # task in less-optimal server platforms. This policy tries to clear the
26 | # first task by allowing any (eligible) server to execute it even if it is
27 | # not the most optimal execution platform.
28 | # This is effectively a sorted earliest-out-of-queue approach, where the
29 | # task checks the fastest servers, then the next-fastest servers, etc. until
30 | # it finds one that is not busy.
31 |
32 | from stomp import BaseSchedulingPolicy
33 | import logging
34 | import numpy
35 | from datetime import datetime, timedelta
36 |
37 | class SchedulingPolicy(BaseSchedulingPolicy):
38 |
39 | def init(self, servers, stomp_stats, stomp_params):
40 |
41 | self.stomp_stats = stomp_stats
42 | self.stomp_params = stomp_params
43 | self.servers = servers
44 | self.n_servers = len(servers)
45 | self.ta_time = timedelta(microseconds=0)
46 | self.to_time = timedelta(microseconds=0)
47 |
48 | def assign_task_to_server(self, sim_time, tasks, dags_dropped, stomp_obj):
49 |
50 | if (len(tasks) == 0):
51 | # There aren't tasks to serve
52 | return None
53 |
54 | tasks.sort(key=lambda task: task.dtime, reverse=False)
55 |
56 | # Look for an available server to process the task
57 | for target_server in tasks[0].mean_service_time_list:
58 |
59 | target_server_type = target_server[0]
60 |
61 | for server in self.servers:
62 |
63 | if (server.type == target_server_type and not server.busy):
64 |
65 | # for target_server1 in tasks[0].mean_service_time_list:
66 | # target_server_type = target_server1[0]
67 | # print(str(target_server_type) + "," + str(tasks[0].per_server_service_dict[target_server_type]))
68 |
69 | # Pop task in queue's head and assign it to server
70 | task = tasks.pop(0)
71 | task.ptoks_used = task.power_dict[server.type]
72 | server.assign_task(sim_time, task)
73 | return server
74 |
75 | return None
76 |
77 |
78 | def remove_task_from_server(self, sim_time, server):
79 | pass
80 |
81 | def output_final_stats(self, sim_time):
82 | pass
83 |
84 |
--------------------------------------------------------------------------------
/TRACES.md:
--------------------------------------------------------------------------------
1 | # STOMP: Scheduling Techniques Optimization in heterogeneous Multi-Processors
2 |
3 | STOMP is a simple yet powerful queue-based **discrete-event** simulator that enables fast implementation and evaluation of OS scheduling policies in multi-core/multi-processor systems. It implements a convenient interface to allow users and researchers to _plug in_ new scheduling policies in a simple manner and without the need to touch the STOMP code.
4 |
5 | STOMP supports task traces in order to provide the user with the ability to both generate specific profiles of task arrival/execution and to produce a completely re-producible input to a series of STOMP parameter sets.
6 | STOMP can be used to both generate and consume such traces.
7 |
8 | ## STOMP Input Trace Format
9 |
10 | The STOMP input trace format consists of a time of arrival, a task type, and an execution time (for that task) per server type. This provides a complete set of information to determine how a particular task would execute within the STOMP simulation, and therefore guarantees that subsequent simulations (e.g. with differing numbers of servers, etc.) can produce a representation of the run that is consistent, varying only in the parameterized changes in the STOMP parameters (e.g. the number of servers of each type, the scheduling policy, etc.) and not unintentionally in parameters of the underlying execution (e.g. execution time on a particular server instance).
11 |
12 | The trace format is a simple comma-separated ASCII format which contains the following information:
13 | * A header row (line) that indicates the ordered set of server_types in the trace
14 | * One row (line) per task arrival that includes
15 | * The task arrival time
16 | * The task type
17 | * The server type service time for that task (for each server type)
18 |
19 | Each non-header line of the trace file conatins an ASCII entry for a single task arrival, in the form:
20 | time,task,s1_time,s2_time,...,sn_time
21 | Where time is the task arrival time (an integer value)
22 | and task is the task type from the json configuration file (e.g. fft, decoder, etc.)
23 | and s1_time is the execution time for that task on server type 1 (taken from the json file, e.g. cpu_core, gpu, fft_accel, etc.)
24 |
25 | ### NOTES:
26 | If a given task cannot execute on a given server type, then the service time for that server type should be entered as None.
27 | The ordering of the servers is specified in the first line of the trace file, and all task entries must contain a matching number of service times, whcih are applied to the server types in that order.
28 |
29 | ## Example trace file
30 | The following illustrates the start of a trace file for a system with 3 server types (cpu_core, gpu, and fft_accel) and two types of arriving tasks (fft, decoder).
31 | ```
32 | cpu_core, gpu, fft_accel
33 | 0,fft,250,150,50
34 | 45,decoder,100,200,None
35 | 100,fft,221,160,71
36 | ```
37 | This trace illustrates 3 arriving tasks, first an fft at time 0 (with execution times of 250 on cpu_core, 150 on gpu, and 50 on fft_accel) adn then a decoder task at time 45 (with execution times of 100 on cpu_core, 200 on gpu, and no possible execution on an fft_accel server), and then another fft at time 100 (with execution times of 221 on cpu_core, 160 on gpu, and 71 onb fft_accel).
38 |
39 |
40 | ## Requirements
41 |
42 | STOMP requires:
43 | - Python 2.7
44 |
45 |
46 | ## Contributors
47 |
48 | * Augusto Vega (IBM) -- ajvega@us.ibm.com
49 | * J-D Wellman (IBM) -- wellman@us.ibm.com
50 |
51 | ## Current Maintainers
52 |
53 | * Augusto Vega (IBM) -- ajvega@us.ibm.com
54 | * J-D Wellman (IBM) -- wellman@us.ibm.com
55 |
--------------------------------------------------------------------------------
/simulator/stomp_main.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright 2022 IBM
4 | #
5 | # This is free software; you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation; either version 3, or (at your option)
8 | # any later version.
9 | #
10 | # This software is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with this software; see the file COPYING. If not, write to
17 | # the Free Software Foundation, Inc., 51 Franklin Street,
18 | # Boston, MA 02110-1301, USA.
19 | #
20 |
21 | import sys, getopt
22 | import importlib
23 | import json
24 | import simpy
25 | import argparse
26 | from collections import abc
27 | import threading
28 |
29 | from stomp import STOMP
30 | from meta import META
31 |
32 | import utils
33 | from utils import SharedObjs
34 |
35 | def usage_and_exit(exit_code):
36 | print('usage: stomp_main.py [--help] [--debug] [--conf-file=] [--conf-json=] [--input-trace=] ')
37 | sys.exit(exit_code)
38 |
39 | def update(d, u):
40 | for k, v in u.items():
41 | if (k in d):
42 | if isinstance(v, abc.Mapping):
43 | r = update(d.get(k, {}), v)
44 | d[k] = r
45 | else:
46 | d[k] = u[k]
47 | return d
48 |
49 | def parse_args():
50 | parser = argparse.ArgumentParser()
51 | parser.add_argument('--conf-file', '-c', type=str, default="inputs/stomp.json",
52 | help="specifies a json configuration file for STOMP to use this run")
53 | parser.add_argument('--input-trace', '-i', type=str,
54 | help="specifies the filename from which STOMP should read an input DAG trace")
55 | parser.add_argument('--conf-json', '-j', type=str,
56 | help="specifies a json string that includes the configuration information for STOMP to use this run")
57 | parser.add_argument('--debug', '-d', action="store_true",
58 | help="Output run-time debugging messages")
59 | args = parser.parse_args()
60 | return args
61 |
62 | def main(argv):
63 | args = parse_args()
64 | conf_file = args.conf_file
65 | debug = args.debug
66 | conf_json = args.conf_json
67 | input_trace_file = args.input_trace
68 |
69 | with open(conf_file) as conf_f:
70 | stomp_params = json.load(conf_f)
71 | if conf_json:
72 | # We update configuration parameters with JSON
73 | # values received through the command line
74 | update(stomp_params, json.loads(conf_json))
75 | if debug:
76 | stomp_params['general']['logging_level'] = "DEBUG"
77 | if input_trace_file:
78 | stomp_params['general']['input_trace_file'] = input_trace_file
79 |
80 | # Dynamically import the scheduling policy class
81 | sched_policy_module = importlib.import_module(stomp_params['simulation']['sched_policy_module'])
82 |
83 | # Dynamically import the meta policy class
84 | meta_policy_module = importlib.import_module(stomp_params['simulation']['meta_policy_module'])
85 |
86 | max_timesteps = 2**64
87 | sharedObjs = SharedObjs(max_timesteps)
88 | sharedObjs.setup_env()
89 |
90 | stomp_sim = STOMP(sharedObjs, stomp_params, sched_policy_module.SchedulingPolicy())
91 | meta_sim = META(sharedObjs, stomp_params, stomp_sim, meta_policy_module.MetaPolicy())
92 |
93 | stomp_sim.meta = meta_sim
94 |
95 | sharedObjs.run()
96 |
97 | if __name__ == "__main__":
98 | main(sys.argv[1:])
99 |
--------------------------------------------------------------------------------
/utils/README.md:
--------------------------------------------------------------------------------
1 | # STOMP Parameter Sweep Example Script
2 |
3 | run_all.py is a simple Python script used to invoke a series of STOMP runs across a sweep of parameters. In this example, the run_all.py will sweep across a set of different standard deviation factors and scheduling policies, running a STOMP simulation at each point, and then generating some aggregated files summarizing the average response time and queue size during the run.
4 | The results of the run are placed into a directory which is automatically generated, and has the form sim__