The artifact zip file is available for download
We have installed the LITMUSRT kernel on Ubuntu 16.04.
All our code are assumed to be kept at a location
The directory structure is the following:
/home/common_shared/litmus/litmus-rt /home/common_shared/litmus/liblitmus /home/common_shared/PAStime/PMU/pmu-tools /home/common_shared/PAStime/pastime /home/common_shared/PAStime/darknet /home/common_shared/PAStime/video
In case this location is not accessible in your machine, then grep for common_shared and change those locations accordingly, because we had to use the absolute paths at some points in the code.
git clone https://github.com/sohamm17/litmus-rt-amc-pastime
mv litmus-rt-amc-pastime litmus-rt
Issues: The mouse and keyboard may not work in the newly installed kernel. Therefore, it is better to have an ethernet connection to
machine and connect over
git clone https://github.com/sohamm17/liblitmus-amc-pastime (i.e after
mv liblitmus-amc-pastime liblitmus
mkdir PMU && cd PMU
git clone https://github.com/andikleen/pmu-tools.git
sudo make install
git clone https://github.com/sohamm17/pastime
git clone email@example.com:sohamm17/darknet-master.git
Wherever you can, change it (
/home/common_shared/) with the full path
that you are using. You have to change it in line number 635, 662 of the
darknet/examples/classifier.c to get the experiments to run.
Otherwise, segmentation fault will happen.
coco/ directory like
converted, converted1, etc.
The benchmarking video of big buck bunny can be downloaded from:
It should be renamed to bunny_1080p_60fps.mp4
The video file md5sum:
There are some package dependencies for this video decoder to be compiled. Please install the following packages on Ubuntu:
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libswscale-ffmpeg3 libswscale-dev
mv bbb_sunflower_1080p_60fps_normal.mp4 bunny_1080p_60fps.mp4
As per our paper, experiments have two phases in PAStime: Profiling phase and Execution phase. First, we will note the time to reach a checkpoint in the Profiling phase. Then we will use the data from the Profiling phase in the Execution phase.
This phase does not need the LITMUSRT kernel at all.
By default, the darknet application which is considered to be a
high-criticality application, is set up for the Profiling phase.
A checkpoint is placed at 0.4x location in the
forward_network function. To get a checkpoint timing,
we run the code on multiple inputs and get an average of the
checkpoint timing. From our provided artifact zip file,
go inside the scripts folder and run the
file inside PAStime/darknet directory. Run the following commands:
You will file a file called
This file notes the checkpoint timing for different individual image inputs
which the darknet application classify.
You can use our script the following way to get a median of the checkpoint timing. Our script can be run the following way:
python profile.py -timefile timeinfo.h
mean_timeinfo.h will contain the resultant average
checkpoint timing. We will use this data in Execution phase.
For the Execution phase, we need to edit two files in darknet.
Here, we need to comment the
writeTime function call because it is for the Profiling phase. The call is made at line number 231. We need to uncomment the
ANNOUNCE_TIME macro at line number 232. In addition, we
need to get the checkpoint timing from the Profiling phase (the average value that we just got above), and place it at line number 200, where the line current has something like:
#define CP_1_11 <some number>. This
CP_1_11 macro is saying that it is a checkpoint at some function 1 and at some position identified by 11, which are random. In our automated LLVM compiler, these function numbers, and exact point where the macro call
is made, is decided by
the LLVM compiler infrastructure. As we are doing this manually, we can choose our own function call number, etc. We just need to be consistent with the Profiling phase and Execution phase.
examples/classifier.c: Here we need to uncomment the profiling bookkeeping code and enable the litmus-rt code. Go to line number 724. You will find comments there which tells which part of the code is for the Profiling phase
and which part is for the Execution phase. You need to comment the Profiling phase code and uncomment the Execution phase code. This part of the code is between 724 and 822 line numbers.
After this, recompile darknet with
We have automated the Execution phase with a script named amc_8_tasks_60_util.sh . The script runs 4 HC tasks of darknet and 4 LC tasks of the video decoder, totalling a 60% utilization. Look at the Results and Graphs section to know how to run the Execution phase in details.
Running the AMC scheduler:
To run only with AMC scheduling and not AMC-PAStime, you need to comment out the
ANNOUNCE_TIME macro in the src/network.c file. Our kernel changes incorporate PAStime on top of AMC. Therefore, if we do not announce any time, then the
AMC scheduler runs by default.
Download all our scripts by
git clone firstname.lastname@example.org:sohamm17/pastime_scripts.git
and keep them in
Results of different runs are taken with LITMUSRT feather-trace-tools. We use the
st-jobs-stats tool to collect how much utilization was achieved for
the HC and LC tasks.
We have modified the feather-trace-tools to show the average utilization of a run for a particular task. It can be downloaded by:
git clone email@example.com:sohamm17/feather-trace-tools.git
You should clone it at
How to run the Execution phase:
./amc_8_tasks_60_util.sh <LEN> or
LEN*8) is the number of seconds that the experiments will run (except two tasks).
LEN should be 25, to run the experiments for 180 seconds.
For 8 tasks, try with 15, the length of the run is around 90-120 seconds.
<enter> in T1 to finish tracing schedule by LITMUSRT.
It should be named something like
cpu=1.bin in the formerly mentioned scheduling trace file.
How to get the utilization: You need to run the following script (which we have modified in our modified feather-trace-tools repo):
The above script will give the utilization of each tasks which were run with the execution script. We need to
take these numbers and place in a text file to be parsed by some python scripts to generate the graph.
Instructions to generate graphs are given below.
How to generate graphs: From our script folder, the below scripts can be used to generate graphs. The data CSV files are also included in the scripts repository:
Contact: For any help, please contact Soham at soham1 <at> bu DOT edu