Commit 4815d27a authored by Hermann Krumrey's avatar Hermann Krumrey

Prepare Repository for public release

parent 63b18ecd
# Created by https://www.gitignore.io/api/rust,python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# 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/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# 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/
### Rust ###
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# End of https://www.gitignore.io/api/rust,python
.idea/
target/
Cargo.lock
......
stages:
- mirror
github_mirror:
stage: mirror
tags:
- github_namboy94_push
script:
- git checkout master
- git pull
- git push git@github.com:namboy94/octorust.git master -f
Version 1.0.0:
- Completed the bachelor thesis
\ No newline at end of file
# Contributing
I do not currently plan on expanding on this project. Gitlab and Github
issues will be looked at however and you're free to fork the repository.
\ No newline at end of file
This diff is collapsed.
# octorust
# octorust [![pipeline status](https://gitlab.namibsun.net/namboy94/octorust/badges/master/pipeline.svg)](https://gitlab.namibsun.net/namboy94/octorust/commits/master)
![Logo](resources/logo/logo-readme.png)
`octorust` is a python application that makes use of `rustc`, `cargo` and `gcc`
to compile applications written in rust for use in invasive Platforms
utilizing OctoPOS/iRTSS.
The program has been written in the course of my bachelor thesis, which can be
found [here](https://pp.ipd.kit.edu/uploads/publikationen/krumrey17bachelorarbeit.pdf).
# Installation
`octorust` has been tested to work on Arch Linux and Ubuntu Linux. It should
......
#!/usr/bin/env python3
"""
Author: Hermann Krumrey <hermann@krumreyh.com> (2017)
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
"""
from octorust.main import main
......
#!/bin/bash
# Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
#
# This file is part of octorust.
#
# octorust is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# octorust is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with octorust. If not, see <http://www.gnu.org/licenses/>.
temci short exec -wd "octorust -i 2017-06-07 startup/startup -o out" --runs 50 --out temci_output/compile_rust.yaml
temci short exec -wd "octorust -i 2017-06-07 startup/startup --release -o out" --runs 50 --out temci_output/compile_rust_opt.yaml
......
#!/usr/bin/env python3
"""
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
"""
import os
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
import x10.io.Console;
class Garbage {
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#include <octopos.h>
#include <stdio.h>
#include <stdlib.h>
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#![no_std]
#![feature(alloc)]
......
package de.am.gc.benchmarks;
/**
* A GC micro benchmark running a given number of threads that create objects of a given size and dereference them immediately
*
* @author jsound
*/
public class GarbageOnly {
// object size in bytes
private static final int DEFAULT_NUMBEROFTHREADS=8;
private static final int DEFAULT_OBJECTSIZE=100;
private static int numberOfThreads=DEFAULT_NUMBEROFTHREADS;
private static int objectSize=DEFAULT_OBJECTSIZE;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// first (optional) argument is the number of threads to run
if( args.length>0 ) {
numberOfThreads = Integer.parseInt(args[0]);
// second (otpional) argument is the size of the objects
if( args.length>1 ) {
objectSize = Integer.parseInt(args[1]);
}
}
System.out.println("Creating objects of size "+objectSize+" with "+numberOfThreads+" threads");
// run the configured number of GC producer threads
for(int i=0; i<numberOfThreads; i++) {
new Thread(new GCProducer()).start();
}
try {
// Let the benchmark run 5 minutes (using the -Xloggc:<filename> JVM parameter)
// For evaluation of the GC rate from the GC log I disregard the first minute as warmup and
// use the average of the remaining 4 minutes as a score value
Thread.sleep(300000);
} catch( InterruptedException iexc) {
iexc.printStackTrace();
}
System.exit(0);
}
public static class GCProducer implements Runnable {
@Override
public void run() {
// make object creation as cheap as possible to measure GC performance with
// as little overhead as possible
int osize = objectSize;
while(true) {
// create character arrays of the configured size
char[] garbageObject = new char[osize];
}
}
}
}
\ No newline at end of file
#!/usr/bin/env python3
"""
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import sys
import yaml
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
import x10.io.Console;
import invasic.constraints.PEQuantity;
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#include <octopos.h>
#include <stdio.h>
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#![no_std]
extern crate libc;
......
package de.am.gc.benchmarks;
import java.util.ArrayList;
import java.util.List;
/**
* GC benchmark producing a mix of lifetime=0 and lifetime>0 objects which are kept in randomly updated lists.
*
* @author jsound
*/
public class MixedRandomList {
private static final int DEFAULT_NUMBEROFTHREADS=1;
// object size in bytes
private static final int DEFAULT_OBJECTSIZE=100;
private static int numberOfThreads=DEFAULT_NUMBEROFTHREADS;
private static int objectSize=DEFAULT_OBJECTSIZE;
// Number of objects to fill about half of the available memory with live objects
// The result of this calculation is not a constant with different garbage collectors.
// Therefore, it is preferable to set this value as an explicit parameter to the benchmark.
// Explicit setting is required if objectsize is different from default
private static long numLive = (Runtime.getRuntime().maxMemory()/objectSize/5);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
if( args.length>0 ) {
// first, optional argument is the size of the objects
objectSize = Integer.parseInt(args[0]);
// second, optional argument is the number of threads
if( args.length>1 ) {
numberOfThreads = Integer.parseInt(args[1]);
// third, optional argument is the number of live objects
if( args.length>2 ) {
numLive = Long.parseLong(args[2]);
}
}
}
for( int i=0; i<numberOfThreads; i++ ) {
// run several GarbageProducer threads, each with its own mix of lifetime=0 and higher lifetime objects
new Thread(new GarbageProducer((int)Math.pow(50.0,(double)(i+1)), numLive/numberOfThreads)).start();
}
try {
Thread.sleep(1200000);
} catch( InterruptedException iexc) {
iexc.printStackTrace();
}
System.exit(0);
}
/**
* Create a character array of a given length
* @param length
* @return the character array
*/
private static char[] getCharArray(int length) {
char[] retVal = new char[length];
for(int i=0; i<length; i++ ) {
retVal[i] = 'a';
}
return retVal;
}
/**
* A garbage producer implementation
*/
public static class GarbageProducer implements Runnable {
// the fraction of newly created objects that do not become garbage immediately but are stored in the liveList
int fractionLive;
// the size of the liveList
long myNumLive;
/**
* Each GarbageProducer creates objects that become garbage immediately (lifetime=0) and
* objects that become garbage only after a lifetime>0 which is distributed about an average lifetime.
* This average lifetime is a function of fractionLive and numLive
*
* @param fractionLive
* @param numLive
*/
public GarbageProducer(int fractionLive, long numLive) {
this.fractionLive = fractionLive;
this.myNumLive = numLive;
}
@Override
public void run() {
int osize = objectSize;
char[] chars = getCharArray(objectSize);
List<String> liveList = new ArrayList<String>((int)myNumLive);
// initially, the lifeList is filled
for(int i=0; i<myNumLive; i++) {
liveList.add(new String(chars));
}
while(true) {
// create the majority of objects as garbage
for(int i=0; i<fractionLive; i++) {
String garbageObject = new String(chars);
}
// keep the fraction of objects live by placing them in the list (at a random index)
int index = (int)(Math.random()*myNumLive);
liveList.set(index, new String(chars));
}
}
}
}
\ No newline at end of file
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
import x10.io.Console;
class Primes {
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#include <octopos.h>
#include <stdio.h>
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#![no_std]
#![feature(alloc)]
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
import x10.io.Console;
class Primes {
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/
#include <octopos.h>
#include <stdio.h>
......
/*
Copyright 2017 Hermann Krumrey <hermann@krumreyh.com>
This file is part of octorust.
octorust is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
octorust is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with octorust. If not, see <http://www.gnu.org/licenses/>.
*/