Skip to content

Commit eea0813

Browse files
committed
Updating SPBench to version 0.3-alpha
1 parent d52accb commit eea0813

File tree

416 files changed

+22472
-3871
lines changed

Some content is hidden

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

416 files changed

+22472
-3871
lines changed

INSTRUCTIONS.md

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Here we give some how-to-use instructions and tips.
44

5-
## Command-Line Interface:
5+
Notice that these are basic, simplified instructions. For more details and the complete documentation, go to: [https://spbench-doc.rtfd.io](https://spbench-doc.rtfd.io)
6+
7+
## Command-Line Interface:
68

79
The framework works with a command-line interface (CLI).
810

@@ -14,42 +16,49 @@ For each command there is also a "help" guide. You can access it using:
1416

1517
`./spbench [command] -h`
1618

17-
## Framework commands:
19+
## Basic concepts:
20+
21+
- **Benchmark**: In this context, it means any application version registered in SPBench. Benchmarks can be the sequential applications, the parallel versions pre-available within SPBench, or any new custom implementations registered latter by users.
22+
- **PPI**: It stands for Parallel Programming Interface, which means any library, framework, language, etc. that leverages parallelism.
23+
24+
## Main command-line commands:
25+
26+
The table bellow shows all commands that can be used through the CLI
27+
| Command | Description | Subcommands |
28+
|---|---|---|
29+
| **install** | It installs the dependencies for the SPBench benchmarks. | `-app <some_application>` |
30+
| **register** | It automatically sets the paths and generates new makefiles for all benchmarks. | None |
31+
| **new** | It allows for creating a new benchmark based on a SPBench application.<br /> This command will create a fresh copy of the selected application. | `-name <new_benchmark_id>`(any name)<br /> `-app <some_SPBench_application>`<br /> `-ppi <some_ppi>` (any name)<br /> `-replicate <other_benchmark_id>`(Optional) |
32+
| **edit** | It opens a choosen benchmark for code editing. | `-bench <benchmark_id>`<br /> `-editor <editor_name>`(Optional)(Default: nano) |
33+
| **configure** | It allows users to add compiling dependencies for a benchmark.<br /> It opens a JSON configuration file for you to write the required dependencies. | `-bench <benchmark_id>`<br /> `-editor <editor_name>`(Optional)(Default: nano) |
34+
| **compile** | It compiles a selected benchmark. | `-bench <benchmark_id>` |
35+
| **exec** | It runs a selected benchmark. | `-bench <benchmark_id>`<br /> `-input <input_id>`<br /> `-batch <batch_size>`(optional)<br /> `-frequency <item_delay>`(microsecond)(optional)<br /> `-nthreads <number_of_threads>`(optional)<br /> `-in-memory`(optional)<br /> `-latency`(optional)<br /> `-throughput`(optional)<br /> `-resource_usage`(optional)<br /> `-monitor <time_interval>`(millisecond)(optional)<br /> `-latency_monitor`(optional)<br /> `-user_arg <user_custom_argument>`(optional) |
36+
| **list** | This command lists all SPBench benchmarks. Users' new benchmark versions are added to this list. | None |
37+
| **delete** | It completely deletes the given benchmark. | `-bench <benchmark_id>` |
38+
| **new_input** | It allows for adding an alias for a custom input. | `-input_id <new_input_id>`<br /> `-app <SPBench_application>`<br /> `-input <"input info/string">` |
39+
| **list_input** | It lists all inputs registered for a given application and their respective alias.<br /> (Attention: You can only use pre-registered alias after downloading the respective inputs.<br /> See the section about inputs below). | `-app <SPBench_application>`(optional) |
40+
1841

19-
- **install**: It install the dependencies for the SPBench applications and parallel implementations.
20-
- **register**: It automatically generates makefiles for all benchmark versions available within the framework (You must install the dependencies first).
21-
- **new**: You use it to create new version of a given application from the framework. This command will create a fresh copy of the selected application for you to work on. See the 'help' option for this command to check the required arguments.
22-
- **edit**: You can use this comand to edit a given application version. See the 'help' option for this command to check the required arguments.
23-
- **configure**: You can use this command to configure the compiling dependencies of an application version. It opens a JSON configuration file for you to write the required dependencies. See the 'help' option for this command to check the required arguments.
24-
- **compile**: Use this command to compile a given version. See the 'help' option for this command to check the required arguments.
25-
- **exec**: Use this command to run an application version. See the 'help' option for this command to check the required arguments.
26-
- **list**: This command lists all applications versions of the framework. Your new versions will be added to this list.
27-
- **delete**: It completely deletes a given application version.
28-
- **new_input**: It allows you to add an alias for a custom input. See the 'help' option for this command to check the required arguments.
29-
- **list_inputs**: List all inputs registered for a given application and their respective alias. (Attention: You can only use these alias after downloading the respective inputs. See the section about inputs below).
3042

3143
## How to use
3244

3345
In this framework you can simply run the benchmarks that are already provided or implement your own specific benchmark.
3446

3547
To run a given benchmark version, you can follow these steps:
3648
- Run: `./spbench install` (you can use `-app <some application>` to install only a specific application)
37-
- Run: `./spbench register`
3849
- Run: `./spbench list` (this shows the list of available benchmarks)
39-
- Run: `./spbench compile -version [version_name]`
40-
- Run: `./spbench exec -version [version_name] -input [some_input] [other_args]`
50+
- Run: `./spbench compile -benchmark <benchmark_id>`
51+
- Run: `./spbench exec -benchmark <benchmark_id> -input <input_id> ... <optional_args>`
4152

4253
To implement your own benchmark version, you must run **new -> edit -> configure**
4354

4455
## Inputs
4556

4657
In the **exec** step you must choose a given input for the benchmark.
4758

48-
These inputs can be found and downloaded in the inputs/ directory.
49-
50-
You can run the 'get_inputs.sh' script to automatically download them.
59+
To automatically download them you can run:
5160

52-
`cd inputs/ && bash get_inputs.sh`
61+
`./spbench download-inputs`
5362

5463
You can use your own input or choose a given one.
5564

@@ -58,11 +67,11 @@ These alias are linked to the inputs provided by SPBench and you can see them ru
5867
`./spbench list_inputs`
5968

6069
SPBench also allows you to create an alias for your custom inputs.
61-
`./spbench new_input -input_id <input_alias> -app <spbench_application> -input "<full_path_to_your_new_input>"`
70+
`./spbench new_input -id <input_alias> -app <spbench_application> -input "<full_path_to_your_new_input>"`
6271

6372
## How to run example:
6473

65-
- `./spbench exec -version [version_name] -input [small, medium, large]`
74+
- `./spbench exec -benchmark [benchmark_name] -input [small, medium, large]`
6675

6776
## Performance metrics
6877

@@ -72,7 +81,9 @@ With SPBench you can evaluate four performance metrics in different ways.
7281
- CPU usage (%)
7382
- Memory usage (KB)
7483

75-
There are four OPTIONAL arguments you can select when running the 'exec' command:
84+
There are some OPTIONAL arguments you can select when running the 'exec' command:
85+
86+
## For metrics:
7687

7788
- `-monitor <time interval>`
7889

@@ -94,11 +105,11 @@ There are four OPTIONAL arguments you can select when running the 'exec' command
94105

95106
It prints the global memory and CPU usage for the selected application.
96107

97-
## Other configuration arguments
108+
## Other optional management arguments
98109

99110
All of these are also OPTIONAL arguments that you can use within the 'exec' command.
100111

101-
- `-in_memory`
112+
- `-in-memory`
102113

103114
It runs the application in-memory, which means that all the input is first loaded into the memory before start processing it. The opposite is true for the writing phase, where the result stays in memory and is only writen to the disk after all the input is proccessed.
104115

@@ -109,23 +120,15 @@ All of these are also OPTIONAL arguments that you can use within the 'exec' comm
109120
- `-batch <batch_size>`
110121

111122
Here you can change the size of the batches, so each item can carry more data. By default, the size of each batch is 1.
112-
113-
- `-frequency <time_in_microseconds>`
114123

115-
Here you can change the frequency of itens generated by source operator. The minimum frequency is limited by the memory access speed in your system.
124+
- `-frequency <time-delay_per_item_in_us>`
125+
126+
Here you can set the frequency in which the sources of the benchmarks will produce new items. To increase or decrese the frequency, you can decrease or increase the time-delay between items generation. You must insert a time-delay in microseconds (e.g. 500000 = 500 ms).
116127

117128
- `-d`
118129

119130
This a specific argument for bzip2. You can use it to run this application in decompress mode. Observe that for de decompression mode it is required a compressed file as input (e.g. my_compressed_file.tar.bz2).
120131

121-
## Global attributes
122-
123-
SPBench implements some global variables that can be used and modified by users at execution time in custom implementations. Some useful are:
124-
125-
- nthreads
126-
- batch_size
127-
- items_reading_frequency
128-
129132
## Important
130133

131134
You must run `source setup_vars.sh` to load the libraries.

README.md

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,91 @@
11
# SPBench
22

3-
![SPBench_logo](https://user-images.githubusercontent.com/11809226/121076611-fbef5300-c7ac-11eb-9213-5a30a284bec1.png)
3+
[![SPBench_logo](https://user-images.githubusercontent.com/11809226/121076611-fbef5300-c7ac-11eb-9213-5a30a284bec1.png)](https://spbench-doc.readthedocs.io/en/latest/)
44

5-
SPBench is a new Framework for Benchmarking Stream Processing Applications.
6-
It allows users to easily use parallel libraries to explore stream parallelism with different applications.
7-
SPBench manages the application execution and performance evaluation aspects, which allows the user to focus exclusively on the parallelism aspects.
5+
[SPBench](https://spbench-doc.readthedocs.io/en/latest/) (Stream Processing Benchmark) is a framework for benchmarking C++ stream processing applications.
6+
The main goal of SPBench is to enable users to easily create custom benchmarks from real-world stream processing applications and evaluate multiple PPIs.
87

9-
The applications set comprises the following stream processing applications and will be more in the future:
8+
**The SPbench documentation is available at https://spbench-doc.rtfd.io**
9+
10+
## How to cite
11+
12+
- GARCIA, A. M.; SCHEPKE, C. ; GRIEBLER, D. J. ; FERNANDES, L. G. . SPBench: A Framework for Creating Benchmarks of Stream Processing Applications. COMPUTING, v. 1, p. 1, 2021, doi: 10.1007/s00607-021-01025-6. \[[link](https://doi.org/10.1007/s00607-021-01025-6)\]
13+
14+
### Other papers using SPBench
15+
16+
- A. M. Garcia, D. Griebler, C. Schepke and L. G. L. Fernandes, Evaluating Micro-batch and Data Frequency for Stream Processing Applications on Multi-cores. In: 2022 30th Euromicro International Conference on Parallel, Distributed and NetworkBased Processing (PDP), 2022, Valladolid. 2022 30th Euromicro International Conference on Parallel, Distributed and Network-based Processing (PDP), 2022. p. 10-17, doi: 10.1109/PDP55904.2022.00011. \[[link](https://doi.org/10.1109/PDP55904.2022.00011)\]
17+
18+
- A. M. Garcia, D. Griebler, L. G. L. Fernandes and C. Schepke, "Introducing a Stream Processing Framework for Assessing Parallel Programming Interfaces", 2021 29th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP), 2021, pp. 84-88, doi: 10.1109/PDP52278.2021.00021. \[[link](https://doi.org/10.1109/PDP52278.2021.00021)\]
19+
20+
## The SPBench is intended for three main audiences:
21+
- Users who want to run performance tests with the SPBench benchmarks. It implements different real-world stream processing applications using different parallel programming interfaces (PPIs) and parallelism patterns, and makes available the main metrics used in this domain. The framework also enables users to create custom benchmarks with new PPIs.
22+
- Researchers and developers who want to test and evaluate new technologies and solutions. The SPBench benchmarks are also highly parameterizable and its API allows for easy and fast code reuse across all applications.
23+
- Students and teachers who want to learn/teach stream parallelism. The benchmarks implemented with the SPBench API abstract the low-level code and expose to users only the stream core of each application (in a few lines of code). Therefore, it allows users to easily identify each individual operator and data dependencies, to understand what the stream flow looks like. Then users can build parallelism on top of this highly simplified code.
24+
25+
### The SPBench suite comprises the following stream processing applications and will be more in the future:
1026
- Ferret (PARSEC)
1127
- Lane Detection
1228
- Bzip2
13-
- Person Recognition (Temporarily removed due to license constraint)
29+
- Person Recognition
1430

15-
For each of them there are parallel versions implemented using the following parallel programming interfaces and will be more in the future:
31+
### For each of them there are parallel versions implemented using the following parallel programming interfaces and will be more in the future:
1632
- Intel TBB
1733
- FastFlow
1834
- SPar
1935
- GrPPI (forthcoming)
2036
- Standard C++ Threads (forthcoming)
2137

22-
## How to cite
38+
# SPBench Framework
39+
40+
One of the aspects that most differentiates SPBench from related solutions is how users interact with it.
41+
The kernel of SPBench is its API that allows users to access simplified versions of the applications included in our suite. Based on the sequential versions, users can implement parallelism, create new custom benchmarks with different parallelism strategies, or even explore new parallel PPIs.
42+
Users can also configure and modify parameters, such as build dependencies and metrics, through a command-line interface (CLI).
43+
This CLI accesses a database containing all benchmarks from the SPBench suite.
44+
Other secondary parameters can be tuned via the CLI with simple commands.
45+
This allows users to entirely focus on writing and tuning the parallelism rather than spending time with the non-relevant low-level aspects of each application. The figure bellow illustrates the SPBench framework.
2346

24-
- A. M. Garcia, D. Griebler, L. G. L. Fernandes and C. Schepke, "Introducing a Stream Processing Framework for Assessing Parallel Programming Interfaces," 2021 29th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP), 2021, pp. 84-88, doi: 10.1109/PDP52278.2021.00021.
47+
![SPBench_framework](https://gmap.pucrs.br/public_data/spbench/img/spbench_framework.png)
2548

2649
## How to install
2750

2851
The folowing packages are required to install SPBench:
2952

30-
- build-essential
53+
- build-essential
54+
- pkg-config
3155
- cmake
3256
- yasm
3357
- python (tested on python3 and python2.7)
3458

3559
You can run the command bellow to install theses packages or ask a system admin.
3660

37-
`sudo apt-get install -y build-essential cmake yasm python3`
61+
`sudo apt-get install -y build-essential pkg-config cmake yasm python3`
3862

39-
To install SPBench you can choose full installation (all applications):
63+
To install SPBench you can run:
4064

4165
`./spbench install`
4266

43-
Or choose a specific application:
67+
The command above will install the dependencies for all supported applications.
68+
For installing dependencies for a single application you can run:
4469

4570
`./spbench install -app <application name>`
4671

4772
Run `./spbench install -h` for more info.
4873

49-
For custom installations, see libs/README.md or ppis/README.md.
74+
For custom and manual installations, see libs/README.md or ppis/README.md.
5075

5176
## How to run:
5277

5378
`./spbench [command] <arguments>`
5479

5580
or
5681

57-
`./spbench [command] <arguments>`
82+
`python[2.7 or 3] spbench [command] <arguments>`
5883

59-
Try: `./spbench -h`
84+
Try: `./spbench -h` or `python[2.7 or 3] spbench -h `
6085

61-
See INSTRUCTIONS.md for more info about all SPBench commands.
62-
63-
## COPYING
64-
65-
SPBench is under GNU General Public License version 3 (see COPYING file for more details).
66-
Each application included by SPBench is also under their original license.
67-
The diagram bellow illustrates how the licenses are assigned.
68-
69-
![SPBench-LICENSE](https://user-images.githubusercontent.com/31757740/125243394-6cb1ef80-e2c4-11eb-882e-fe2bd27f7a46.png)
70-
86+
See the [documentation](https://spbench-doc.readthedocs.io/en/latest/) for more info about SPBench.
7187

7288
This is an ongoing project and you may face some bugs or other problems.
7389
Feel free to open an issue or contact me for any problem regarding the SPBench.
74-
90+
7591

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#ifndef BZIP2_H
2+
#define BZIP2_H
3+
4+
#include <bzip2_utils.hpp>
5+
6+
namespace spb{
7+
8+
class Compress;
9+
class Decompress;
10+
11+
class Compress{
12+
private:
13+
static inline void compress_op(spb::item_data &item);
14+
public:
15+
static void op(spb::Item &item);
16+
Compress(spb::Item &item){
17+
op(item);
18+
}
19+
Compress(){};
20+
21+
virtual ~Compress(){}
22+
};
23+
24+
class Decompress{
25+
private:
26+
static inline void decompress_op(spb::item_data &item);
27+
public:
28+
static void op(spb::Item &item);
29+
Decompress(spb::Item &item){
30+
op(item);
31+
}
32+
Decompress(){};
33+
virtual ~Decompress(){}
34+
};
35+
36+
} // end of namespace spb
37+
#endif

0 commit comments

Comments
 (0)