Commit 0f331a86 authored by PE Hladik's avatar PE Hladik
Browse files

jss version

parents
Makefile # automatically generated by config.py
# Executables (dataset1)
periodics_100pro_1task-per-pro
periodics_100pro_2task-per-pro
periodics_100pro_3task-per-pro
periodics_100pro_4task-per-pro
periodics_10pro_1task-per-pro
periodics_10pro_2task-per-pro
periodics_10pro_3task-per-pro
periodics_10pro_4task-per-pro
periodics_125pro_1task-per-pro
periodics_125pro_2task-per-pro
periodics_125pro_3task-per-pro
periodics_125pro_4task-per-pro
periodics_150pro_1task-per-pro
periodics_150pro_2task-per-pro
periodics_150pro_3task-per-pro
periodics_150pro_4task-per-pro
periodics_15pro_1task-per-pro
periodics_15pro_2task-per-pro
periodics_15pro_3task-per-pro
periodics_15pro_4task-per-pro
periodics_1pro_1task-per-pro
periodics_1pro_2task-per-pro
periodics_1pro_3task-per-pro
periodics_1pro_4task-per-pro
periodics_200pro_1task-per-pro
periodics_200pro_2task-per-pro
periodics_200pro_3task-per-pro
periodics_200pro_4task-per-pro
periodics_20pro_1task-per-pro
periodics_20pro_2task-per-pro
periodics_20pro_3task-per-pro
periodics_20pro_4task-per-pro
periodics_25pro_1task-per-pro
periodics_25pro_2task-per-pro
periodics_25pro_3task-per-pro
periodics_25pro_4task-per-pro
periodics_2pro_1task-per-pro
periodics_2pro_2task-per-pro
periodics_2pro_3task-per-pro
periodics_2pro_4task-per-pro
periodics_3pro_1task-per-pro
periodics_3pro_2task-per-pro
periodics_3pro_3task-per-pro
periodics_3pro_4task-per-pro
periodics_50pro_1task-per-pro
periodics_50pro_2task-per-pro
periodics_50pro_3task-per-pro
periodics_50pro_4task-per-pro
periodics_5pro_1task-per-pro
periodics_5pro_2task-per-pro
periodics_5pro_3task-per-pro
periodics_5pro_4task-per-pro
periodics_75pro_1task-per-pro
periodics_75pro_2task-per-pro
periodics_75pro_3task-per-pro
periodics_75pro_4task-per-pro
periodics_7pro_1task-per-pro
periodics_7pro_2task-per-pro
periodics_7pro_3task-per-pro
periodics_7pro_4task-per-pro
# Executables
periodics_1pro_1task-per-pro_100Hz
periodics_1pro_2task-per-pro_100Hz
periodics_1pro_3task-per-pro_100Hz
periodics_1pro_4task-per-pro_100Hz
periodics_5pro_1task-per-pro_100Hz
periodics_5pro_2task-per-pro_100Hz
periodics_5pro_3task-per-pro_100Hz
periodics_5pro_4task-per-pro_100Hz
periodics_10pro_1task-per-pro_100Hz
periodics_10pro_2task-per-pro_100Hz
periodics_10pro_3task-per-pro_100Hz
periodics_10pro_4task-per-pro_100Hz
periodics_25pro_1task-per-pro_100Hz
periodics_25pro_2task-per-pro_100Hz
periodics_25pro_3task-per-pro_100Hz
periodics_25pro_4task-per-pro_100Hz
periodics_50pro_1task-per-pro_100Hz
periodics_50pro_2task-per-pro_100Hz
periodics_50pro_3task-per-pro_100Hz
periodics_50pro_4task-per-pro_100Hz
periodics_75pro_1task-per-pro_100Hz
periodics_75pro_2task-per-pro_100Hz
periodics_75pro_3task-per-pro_100Hz
periodics_75pro_4task-per-pro_100Hz
periodics_100pro_1task-per-pro_100Hz
periodics_100pro_2task-per-pro_100Hz
periodics_100pro_3task-per-pro_100Hz
periodics_100pro_4task-per-pro_100Hz
periodics_125pro_1task-per-pro_100Hz
periodics_125pro_2task-per-pro_100Hz
periodics_125pro_3task-per-pro_100Hz
periodics_125pro_4task-per-pro_100Hz
periodics_150pro_1task-per-pro_100Hz
periodics_150pro_2task-per-pro_100Hz
periodics_150pro_3task-per-pro_100Hz
periodics_150pro_4task-per-pro_100Hz
periodics_200pro_1task-per-pro_100Hz
periodics_200pro_2task-per-pro_100Hz
periodics_200pro_3task-per-pro_100Hz
periodics_200pro_4task-per-pro_100Hz
periodics_1pro_1task-per-pro_1000Hz
periodics_1pro_2task-per-pro_1000Hz
periodics_1pro_3task-per-pro_1000Hz
periodics_1pro_4task-per-pro_1000Hz
periodics_5pro_1task-per-pro_1000Hz
periodics_5pro_2task-per-pro_1000Hz
periodics_5pro_3task-per-pro_1000Hz
periodics_5pro_4task-per-pro_1000Hz
periodics_10pro_1task-per-pro_1000Hz
periodics_10pro_2task-per-pro_1000Hz
periodics_10pro_3task-per-pro_1000Hz
periodics_10pro_4task-per-pro_1000Hz
periodics_25pro_1task-per-pro_1000Hz
periodics_25pro_2task-per-pro_1000Hz
periodics_25pro_3task-per-pro_1000Hz
periodics_25pro_4task-per-pro_1000Hz
periodics_50pro_1task-per-pro_1000Hz
periodics_50pro_2task-per-pro_1000Hz
periodics_50pro_3task-per-pro_1000Hz
periodics_50pro_4task-per-pro_1000Hz
periodics_75pro_1task-per-pro_1000Hz
periodics_75pro_2task-per-pro_1000Hz
periodics_75pro_3task-per-pro_1000Hz
periodics_75pro_4task-per-pro_1000Hz
periodics_100pro_1task-per-pro_1000Hz
periodics_100pro_2task-per-pro_1000Hz
periodics_100pro_3task-per-pro_1000Hz
periodics_100pro_4task-per-pro_1000Hz
periodics_125pro_1task-per-pro_1000Hz
periodics_125pro_2task-per-pro_1000Hz
periodics_125pro_3task-per-pro_1000Hz
periodics_125pro_4task-per-pro_1000Hz
periodics_150pro_1task-per-pro_1000Hz
periodics_150pro_2task-per-pro_1000Hz
periodics_150pro_3task-per-pro_1000Hz
periodics_150pro_4task-per-pro_1000Hz
periodics_200pro_1task-per-pro_1000Hz
periodics_200pro_2task-per-pro_1000Hz
periodics_200pro_3task-per-pro_1000Hz
periodics_200pro_4task-per-pro_1000Hz
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,python,c
### C ###
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# End of https://www.toptal.com/developers/gitignore/api/linux,macos,python,c
#!/usr/bin/python3
# @Author : rtekin
# @date : June 2020
# Generates fiacre/hippo models, execute it with tracing and process data
from exe.task_generator import *
from exe.gen_periodic import *
from run_lttng import *
from datetime import datetime
import os
import subprocess
import shlex
# modifying working directories
def working_directory_exe_fst():
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname + "/exe")
def working_directory_measures_snd():
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
dirname = ""
for s in dname.split("/exe")[:-1]:
dirname += s
os.chdir(dirname)
def main():
session_pre = ""
exe_path = "exe/"
toTrace = "engine"
nsamples = 3
list_of_tick_values = [0.01, 0.001] # in second : [10ms, 1ms]
timeout = 60 # 60s
nprocess = [1, 5, 10, 25, 50, 75, 100, 125, 150, 200]
ntaskPerProcess = [1, 2, 3, 4]
###############################
######## FIACRE MODELS ########
###############################
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Generate fiacre models,", date, "...")
working_directory_exe_fst()
fcr_names = []
for tick_value in list_of_tick_values :
for n in nprocess :
offsets = [0 for i in range(n)]
functions = ["f"+str(j) for j in range(n)]
periods = gen_periods_uniform(n, 1, 1, 9, True)[0]
for task_per_process in ntaskPerProcess:
name = "periodics_{:d}pro_{:d}task-per-pro_{:d}Hz".format(n, task_per_process, int(1/tick_value))
write_fcr(name, offsets, periods, functions, task_per_process)
fcr2hippo(name)
hippo2exec(name, tick_value)
fcr_names.append(name)
##############################
### EXECUTION with TRACING ###
##############################
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Execution with tracing,", date, "...")
working_directory_measures_snd()
lsession = []
lpath = [exe_path + fcr for fcr in fcr_names]
for i in range(len(lpath)):
for j in range(nsamples):
session = session_pre + fcr_names[i] + "_exe{:d}".format(j+1)
lsession.append(session)
cmd = shlex.split("./run_lttng.py -p {} -s {} -t {:d} --{}".format(lpath[i], session, timeout, toTrace))
subprocess.run(cmd)
##############################
###### DATA PROCESSING ######
##############################
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Data processing,", date, "...")
for session in lsession :
if "1000Hz" in session:
tick_value = 0.001
elif "100Hz" in session:
tick_value = 0.01
else:
print("Can not read tick value from session name {}, tick value is set to 0".format(session))
tick_value = 0
cmd = shlex.split("./process_data.py -s {} -T {} --{}".format(session, tick_value, toTrace))
subprocess.run(cmd)
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> All done,", date)
if __name__ == "__main__":
main()
#!/usr/bin/python3
# @Author : rtekin
# @date : August 2020
# Generates fiacre/hippo models, execute it with tracing and process data
from exe.task_generator import *
from exe.gen_periodic import *
from run_lttng import *
from datetime import datetime
import os
import subprocess
import shlex
########## GLOBAL VALUES ##########
session_pre = "session1_"
exe_path = "exe/"
toTrace = "engine"
nsamples = 1
list_of_tick_values = [0.001] # 1 ms
timeout = 60 # 60s
nprocess = [1] + list(range(5, 205, 5))
ntaskPerProcess = [2]
fcr_names = []
lsession = []
###################################
# modifying working directories
def working_directory_exe_fst():
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname + "/exe")
def working_directory_measures_snd():
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
dirname = ""
for s in dname.split("/exe")[:-1]:
dirname += s
os.chdir(dirname)
def fiacre_model(only_build_names=False):
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Generate fiacre models,", date, "...")
working_directory_exe_fst()
for tick_value in list_of_tick_values :
for n in nprocess :
if not only_build_names :
offsets = [0 for i in range(n)]
functions = ["f"+str(j) for j in range(n)]
periods = gen_periods_uniform(n, 1, 1, 9, True)[0]
for task_per_process in ntaskPerProcess:
name = "periodics_{:d}pro_{:d}task-per-pro_{:d}Hz".format(n, task_per_process, int(1/tick_value))
fcr_names.append(name)
if not only_build_names :
write_fcr(name, offsets, periods, functions, task_per_process)
fcr2hippo(name)
hippo2exec(name, tick_value)
def execute_and_trace(only_build_names=False):
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Execution with tracing,", date, "...")
working_directory_measures_snd()
lpath = [exe_path + fcr for fcr in fcr_names]
for i in range(len(lpath)):
for j in range(nsamples):
session = session_pre + fcr_names[i] + "_exe{:d}".format(j+1)
lsession.append(session)
if not only_build_names :
cmd = shlex.split("./run_lttng.py -p {} -s {} -t {:d} --{}".format(lpath[i], session, timeout, toTrace))
subprocess.run(cmd)
def process_data():
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> Data processing,", date, "...")
for session in lsession :
if "1000Hz" in session:
tick_value = 0.001
elif "100Hz" in session:
tick_value = 0.01
else:
print("Can not read tick value from session name {}, tick value is set to 0".format(session))
tick_value = 0
cmd = shlex.split("./process_data.py -s {} -T {} --{}".format(session, tick_value, toTrace))
subprocess.run(cmd)
def main():
fiacre_model() # give True in argument to only build model names if they were already generated and compiled (to only execute or to only perfom data)
execute_and_trace() # give True in argument to only build session names if they were already executed (to only perfom data of previous sessions)
process_data()
date = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("\n>>> All done,", date)
if __name__ == "__main__":
main()
#!/usr/bin/python3
# @Author : rtekin
# @date : June 2020
# Generate fiacre models of periodics process
import sys
import subprocess
import shlex
import getopt
CONFIG_PATH = "../../software/engine/config.py" # config script to generate hippo Makefile
HIPPO_PATH = "../../software/engine/lib/hippo/" # hippo library
def write_fcr(name, offsets, periods, functions, task_per_process):
"""
Writes a fiacre model.
Each process has it own periodic clock, wich can includes an offset.
Each process matchs with a single task and each task matchs with a
single process. A process can call several times the same task, according
to the task_per_process given argument, if it is the case, task calls are
seperated by their synchronization. All process have the same number of
task per process.
A single component "Main" contains all the process.
* Parameters :
- name : fiacre model name (can be a file path), as a string
- offsets : process' offsets in number of tick, as a list of float
- periods : process' periods in number of tick, as a list of float
- functions : process' tasks functions, as a list of function name
- task_per_process : number of task calls per process, as an integer
* Side effects :
- writes the fiacre model in a file <name>.fcr. If the file already
exists, it is overwritten.
"""
states_name = "a, b, c"
letters = [chr(i) for i in range(ord('a'),ord('z')+1)]
assert(task_per_process - 1 <= len(letters) - 3)
for i in range(0, 2*(task_per_process -1),2):
states_name += ", " + letters[3+i] + ", " + letters[3+i+1]
with open(name+".fcr", 'w') as out_file:
out_file.write("/** Automatically generated by {}\n".format(sys.argv[0]))
out_file.write(" * Task offsets are :\n")
out_file.write(" * {}\n".format(str(offsets)))
out_file.write(" * Task periods are :\n")
out_file.write(" * {}\n*/\n".format(str(periods)))
#functions
cnt = 0
func = dict()
for f in functions :
if not f in func :
out_file.write("task t{:d} (nat) : nat is {}\n".format(cnt, f))
func[f] = cnt
cnt += 1
#process
for i in range(len(periods)) :
T = int(periods[i])