Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T2.3 decission support tool #179

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
674d1a4
data backend access tracing
JBenda Feb 9, 2023
4644c07
Add traces for db and kv
JBenda Feb 9, 2023
e811c4c
Fix for unknown program name
JBenda Feb 9, 2023
b7ba030
sceletcton of replay tool
JBenda Feb 10, 2023
f7d2274
Working replay, but with segfault
JBenda Feb 10, 2023
e59a3ba
first reply example
JBenda Feb 10, 2023
3a9d3fe
Add complexity guess for db selectors
JBenda Feb 12, 2023
c1e7b02
Formatting
JBenda Feb 15, 2023
b79a64b
Adding documentation for decission support
JBenda Feb 15, 2023
6f59e4c
Add script
JBenda Feb 16, 2023
408ad8e
Add evalation script valiadation
JBenda Feb 16, 2023
10c30a8
Add plotting evaluation for decission support summary
JBenda Feb 17, 2023
effe650
start adding tables
JBenda Feb 17, 2023
4436e35
Adding plotting and table code in R script
JBenda Feb 20, 2023
cddc274
Report design changes
JBenda Feb 21, 2023
e63cc75
Changed decission support execution script to python
JBenda Feb 27, 2023
8a788bb
Update docu for <tmp> path part
JBenda Feb 27, 2023
0f61910
nicer pälots
JBenda Feb 27, 2023
863d35a
even nicer plotting
JBenda Feb 28, 2023
7feb441
better interaction
JBenda Mar 1, 2023
1f56386
More interactive plot
JBenda Mar 11, 2023
93f592d
start cleaning plotting script
JBenda Mar 14, 2023
77df281
Code formatting
JBenda Mar 14, 2023
72ab9c7
Format
JBenda Mar 14, 2023
3ef8ddb
Reduce warnings
JBenda Mar 14, 2023
2bd7ed4
use GString for frequently changing strings
JBenda Mar 20, 2023
6fbc3e5
Reduce magic numbers and repeating string constants
JBenda Mar 20, 2023
5f7230b
formating
JBenda Mar 20, 2023
2e9b446
Init replay_access memory chunk with random values
JBenda Mar 20, 2023
cea756c
format
JBenda Mar 20, 2023
3db27e3
Fix g_string usage
JBenda Mar 20, 2023
bf2c36f
fix docs
JBenda Mar 22, 2023
f8d8edb
Check if all R packages are installed
JBenda Mar 22, 2023
dfaf42d
enable traces in relase builds with option
JBenda Mar 22, 2023
8939000
auto format
JBenda Mar 22, 2023
c8ddc50
add option file
JBenda Mar 22, 2023
eed749d
add semantics to access trace
JBenda Mar 26, 2023
41c26c6
adapt csv headers and prints
JBenda Mar 26, 2023
6921602
auto format
JBenda Mar 28, 2023
ca04017
fixe meson.build
JBenda May 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions doc/decission-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Decission Support

JULEA can trace backend accesses granularly,
allowing further application analysis and object access pattern comparison across applications.

Furthermore, this can be used to provide a first rough estimate of which backend combination
is preferable for the application setup.

## Access Record

To create an `access-record`, which is simply a CSV file, execute `julea-server` with `JULEA_TRACE=access` and store the output (`stderr`) in a file.
Then run your applications and stop the server when finished.

```sh
JULEA_TRACE=access julea-server 2> access-record.csv
```

Tracing is per default only in debug builds enabled. To build a realease build
with trace funtcionality you need to set `julea_trace` to true

```sh
meson configure -Djulea_trace=ture --buildtype=release bld
```

## Replay

An `access-record` can be replayed with `julea-access-replay`, which takes only the `access-record` as input.
Replays will execute the same backend operations in the same order as listed in `access-record`.
This allows comparison of backend performance without running the complete application over and over.

Note that the backends must be in the same state, preferably empty, before every replay.
Also note that the performance of a replay can vary compared to the original run, depending on the device's load.

```sh
JULEA_TRACE=access julea-access-replay access-record.csv 2> replay-record.csv
```

## Setup Testing

The script `./scripts/decission-support.py` can help to select a good backend combination for a given workload.
It will test different backend configurations and creates a directory `evaluation` with the results.

Configurations that should be tested must be defined in a `config.json` file.
The expected structure is as follows (an example config can also be found at `example/decission-support-config.json`):

```json
{
"object": [{"backend": "posix", "path": "/tmp/<tmp>/posix"}],
"kv": [{"backend": "sqlite", "path": "/tmp/<tmp>/sqlite"}, {"backend": "sqlite", "path": "/mnt/slow/<tmp>/sqlite"}],
"db": [{"backend": "sqlite", "path": ":memory:"}],
}
```

Note that `<tmp>` inside of paths will be replaced with a temporary directory removed after execution.

The script will replay each access type with all corresponding backends (e.g., all KV accesses are tested on all specified KV configurations).
This will produce `summary.csv`.

The summary can be evaluated using `./scripts/decision-support.R`.
An example workflow is shown below.

```sh
JULEA_TRACE=access julea-server 2> access-record.csv
# run application
# stop julea-server (Ctrl+C)
./scripts/decission-support.py config.json acces-record.csv summary.csv
Rscript ./scripts/decission-support.R summary.csv html > summary.html
# or only ci output
Rscript ./scripts/decission-support.R summary.csv
```

Important remarks:
* The script assumes an empty backend state on start.
* A MySQL/MariaDB instance must be provided if specified as backend.
* User: `julea_user`
* PW: `julea_pw`
* Access to the existing (and empty) database `julea_db`
* These DB servers must be reset by hand for now. Resets on server startup will be available in the future and the resets will be automated by the script.


56 changes: 56 additions & 0 deletions example/decission-support-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"object": [
{
"backend": "posix",
"path": "/tmp/<tmp>/"
},
{
"backend": "posix",
"path": "/mnt/stick/<tmp>/"
},
{
"backend": "gio",
"path": "/tmp/<tmp>/"
}
],
"db": [
{
"backend": "sqlite",
"path": "/tmp/<tmp>/sqlite"
},
{
"backend": "sqlite",
"path": ":memory:"
},
{
"backend": "sqlite",
"path": "/mnt/stick/<tmp>/sqlite"
},
{
"backend": "mysql",
"path": "127.0.0.1:julea_db:julea_user:julea_pw"
}
],
"kv": [
{
"backend": "leveldb",
"path": "/tmp/<tmp>/"
},
{
"backend": "lmdb",
"path": "/tmp/<tmp>/"
},
{
"backend": "sqlite",
"path": "/tmp/<tmp>/sqlite"
},
{
"backend": "sqlite",
"path": ":memory:"
},
{
"backend": "rocksdb",
"path": "/tmp/<tmp>/"
}
]
}
1 change: 1 addition & 0 deletions include/core/jconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ guint32 j_configuration_get_max_connections(JConfiguration*);
guint64 j_configuration_get_stripe_size(JConfiguration*);

gchar const* j_configuration_get_checksum(JConfiguration*);
guint32 j_configuration_get_uid(JConfiguration*);

G_END_DECLS

Expand Down
30 changes: 29 additions & 1 deletion include/core/jsemantics.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,35 @@ void j_semantics_set(JSemantics* semantics, JSemanticsType key, gint value);
*
* \return The aspect's value.
**/
gint j_semantics_get(JSemantics* semantics, JSemanticsType key);
gint j_semantics_get(const JSemantics* semantics, JSemanticsType key);

/**
* Encodes semantics in a guint32
*
* \code
* JSemantics* semantics;
* ...
* guint32 serial_semantics = j_semantics_serialize(semantics);
* JSemantics* simular_semantics = j_semantics_deserialize(serial_semantics);
* \encode
*
* \param semnatics The Semantics
*
* \return serialized semantics as LE encoded guint32
* \retval 0 if no semantics are given eg (semantics == NULL)
**/
guint32 j_semantics_serialize(const JSemantics* semantics);

/**
* Decode serialized semantics, and create new Semantics
*
* For a example see j_semantics_serialize()
*
* \param serial_semantics serialized semantics, created with j_semantics_serialize()
*
* \return new created JSemantics
**/
JSemantics* j_semantics_deserialize(guint32 serial_semantics);

/**
* @}
Expand Down
2 changes: 1 addition & 1 deletion include/core/jtrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void j_trace_leave(JTrace* trace);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(JTrace, j_trace_leave)

#ifdef JULEA_DEBUG
#ifdef JULEA_TRACE
#ifdef __COUNTER__
#define J_TRACE(name, ...) g_autoptr(JTrace) G_PASTE(j_trace, __COUNTER__) G_GNUC_UNUSED = j_trace_enter(name, __VA_ARGS__)
#define J_TRACE_FUNCTION(...) g_autoptr(JTrace) G_PASTE(j_trace_function, __COUNTER__) G_GNUC_UNUSED = j_trace_enter(G_STRFUNC, __VA_ARGS__)
Expand Down
Loading