Skip to content

Commit 886f394

Browse files
add: all sources
1 parent 7953f68 commit 886f394

File tree

123 files changed

+90241
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+90241
-1
lines changed

LICENSE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Parallel Applications Modelling Group - GMAP
4+
5+
GMAP website: https://gmap.pucrs.br
6+
7+
Pontifical Catholic University of Rio Grande do Sul (PUCRS)
8+
9+
Av. Ipiranga, 6681, Porto Alegre - Brazil, 90619-900
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
SOFTWARE.

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
# RustSreamBench
1+
# Rust Stream Bench
2+
3+
**The Rust Stream Bench** is a benchmark suite for evaluating stream parallelism on parallel APIs available in **Rust** language. Our [paper](https://doi.org/10.1016/j.cola.2021.101054) contains abundant information about the benchmark applications and workload characteristics. In the paper, we also discussed the methodology used and the outcome of performance evaluation. **You can use our paper as a guide to assess performance on different Rust features using this benchmark suite.**
4+
5+
This project was conducted in the Parallel Applications Modelling Group (GMAP) at PUCRS - Brazil.
6+
7+
## How to cite this work
8+
9+
[[DOI]](https://doi.org/10.1016/j.cola.2021.101054) R. Pieper, J. Löff, R.B. Hoffmann, D. Grieble, L. G. Fernandes. **High-level and efficient structuredstream parallelism for rust on multi-cores**, *Journal of Computer Languages (COLA)* (2021)
10+
11+
*You can also contribute with this project, writing issues and pull requests.*
12+
13+
# The Four Benchmark Applications
14+
15+
- **Micro-bench** - Is a mathematical synthetic application that was designed using a fractal in the complex plane, namely the Mandelbrot set. Contains unbalanced workload that requires efficient schedulers.
16+
17+
- **Image Processing** - Is characterized by a stream of images flowing through 5 different filters: Saturation, Emboss, GammaCorrection, Sharpen, and Grayscale. Some filters may take longer than others to complete and all of them are stateless.
18+
19+
- **Bzip2** - Is an important open-source tool for loss-less data compression/decompression. Compression is computationally costly whereas the decompression is shipper. Also, performance heavily depends on the characteristics of the input file.
20+
21+
- **Eye Detector** - Is a video processing application that detects the eyes in the faces within an input video. Performance heavily depends on the characteristics of the input video. More faces in the video require more computational power.
22+
23+
_Tip: Find more information in our [paper](https://doi.org/10.1016/j.cola.2021.101054)_
24+
25+
## Folders inside the project
26+
27+
- **bzip2** - This directory contains the *Bzip2* benchmark application with suitable parallel implementations.
28+
- **eye-detector** - This directory contains the *Eye Detector* benchmark application with suitable parallel implementations.
29+
- **image-processing** - This directory contains the *Image Processing* benchmark application with suitable parallel implementations.
30+
- **micro-bench** - This directory contains the *Micro-bench* benchmark application with suitable parallel implementations.
31+
- **libs** - This directory contains our *Rust-SSP* parallel programming API lib and *OpenCV* installation script for the _Eye Detector_ application.
32+
33+
34+
# How to Compile
35+
36+
Programs can be compiled using default Cargo Rust package manager.
37+
Inside each application directory, you may do so using:
38+
`$ cargo build --release`
39+
40+
# How to Execute
41+
42+
You can find information about how to compile and execute the applications in a `README.md` inside each folder.
43+
44+
Besides we provide the input workloads we used in our experimental evaluation. You can download them using the `get_inputs.sh` script that is within each application folder. Except Micro-bench, which does not require any input source.
45+
46+
# How to install OpenCV
47+
48+
You can install OpenCV version 4.5 and Rust wrapper following these steps:
49+
50+
`$ cd libs/`
51+
52+
`$ source setup_opencv_with_ffmpeg.sh`
53+
54+
`$ source config_opencv_vars.sh`
55+
56+
Remember to adjust the COMPILE_THREADS variable inside the `setup_opencv_with_ffmpeg.sh` script accordingly.
57+
Whenever you open a new session, you will need to set OpenCV enviromental variables with `config_opencv_vars.sh` script.

bzip2/Cargo.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
name = "bzip2"
3+
version = "0.1.0"
4+
edition = "2018"
5+
authors = ["Dalvan Griebler <[email protected]>",
6+
"Júnior Löff <[email protected]>",
7+
"Renato B. Hoffmann <[email protected]>"]
8+
license = "MIT"
9+
repository = "https://github.com/GMAP/RustStreamBench"
10+
readme = "README.md"
11+
12+
[dependencies]
13+
chrono = "0.4"
14+
libc = "0.2"
15+
bzip2-sys = { version = "0.1.7", path = "bzip2-sys" }
16+
17+
# Rust-SSP
18+
rust-spp = { path = "~/../../libs/rust-ssp" }
19+
20+
# Rust Standard Library + Crossbeam
21+
crossbeam-channel = "0.5"
22+
crossbeam-utils = "0.8"
23+
24+
# Tokio
25+
tokio = "0.1.19"
26+
futures = "0.1"
27+
tokio-core = "0.1.17"
28+
29+
# Rayon
30+
rayon = "1.5"
31+
32+
# Pipeliner
33+
pipeliner = "1.0.1"

bzip2/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Bzip2 #
2+
3+
Bzip2 application in RUST.
4+
5+
This application compresses and decompresses files using bzip2.
6+
7+
Bzip2 core routines contain binddings to libbz2. This library is provided by Bzip2 for Rust (https://crates.io/crates/bzip2).
8+
9+
# Inputs
10+
11+
Input is a directory of files that can be compressed and decompressed using Bzip2.
12+
13+
You may get the inputs using the `get_inputs.sh` shell script.
14+
15+
We provide workloads with different behaviours. You will find more information about the workload characteristics in our paper.
16+
17+
18+
# List of dependencies
19+
20+
llvm
21+
clang
22+
libclang-dev
23+
bzip2-sys
24+
Other dependencies in Cargo.toml file
25+
26+
# Basic commands for running
27+
cargo build --release
28+
./<path_to_binary> <runtime> <nthreads> <compress/decompress> <input_file>
29+
30+
Options for `runtime` are:
31+
"sequential", or "rust-ssp", or "pipeliner", or "tokio", or "rayon", or "std-threads"
32+
33+
Alternative `runtime` options are (see paper):
34+
"sequential-io", or "rust-ssp-io", or "tokio-io", or "std-threads-io"
35+
36+
Command example:
37+
38+
`$ ./target/release/bzip2 rust-ssp 4 compress iso_file.iso`

bzip2/bzip2-sys/Cargo.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[package]
2+
name = "bzip2-sys"
3+
version = "0.1.9+1.0.8"
4+
authors = ["Alex Crichton <[email protected]>"]
5+
links = "bzip2"
6+
build = "build.rs"
7+
license = "MIT/Apache-2.0"
8+
repository = "https://github.com/alexcrichton/bzip2-rs"
9+
homepage = "https://github.com/alexcrichton/bzip2-rs"
10+
documentation = "https://docs.rs/bzip2-sys"
11+
description = """
12+
Bindings to libbzip2 for bzip2 compression and decompression exposed as
13+
Reader/Writer streams.
14+
"""
15+
categories = ["external-ffi-bindings"]
16+
17+
[lib]
18+
name = "bzip2_sys"
19+
path = "lib.rs"
20+
21+
[dependencies]
22+
libc = "0.2"
23+
24+
[build-dependencies]
25+
pkg-config = "0.3.9"
26+
cc = "1.0"

bzip2/bzip2-sys/LICENSE-APACHE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE-APACHE

bzip2/bzip2-sys/LICENSE-MIT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE-MIT

bzip2/bzip2-sys/build.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
extern crate cc;
2+
extern crate pkg_config;
3+
4+
use std::path::PathBuf;
5+
use std::{env, fs};
6+
7+
fn main() {
8+
let mut cfg = cc::Build::new();
9+
let target = env::var("TARGET").unwrap();
10+
cfg.warnings(false);
11+
12+
if target.contains("windows") {
13+
cfg.define("_WIN32", None);
14+
cfg.define("BZ_EXPORT", None);
15+
} else {
16+
if pkg_config::Config::new()
17+
.cargo_metadata(true)
18+
.probe("bzip2")
19+
.is_ok()
20+
{
21+
return;
22+
}
23+
}
24+
25+
let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
26+
27+
cfg.include("bzip2-1.0.8")
28+
.define("_FILE_OFFSET_BITS", Some("64"))
29+
.define("BZ_NO_STDIO", None)
30+
.file("bzip2-1.0.8/blocksort.c")
31+
.file("bzip2-1.0.8/huffman.c")
32+
.file("bzip2-1.0.8/crctable.c")
33+
.file("bzip2-1.0.8/randtable.c")
34+
.file("bzip2-1.0.8/compress.c")
35+
.file("bzip2-1.0.8/decompress.c")
36+
.file("bzip2-1.0.8/bzlib.c")
37+
.out_dir(dst.join("lib"))
38+
.compile("libbz2.a");
39+
40+
let src = env::current_dir().unwrap().join("bzip2-1.0.8");
41+
let include = dst.join("include");
42+
fs::create_dir_all(&include).unwrap();
43+
fs::copy(src.join("bzlib.h"), dst.join("include/bzlib.h")).unwrap();
44+
println!("cargo:root={}", dst.display());
45+
println!("cargo:include={}", dst.join("include").display());
46+
}

0 commit comments

Comments
 (0)