emper merge requestshttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests2021-09-24T10:52:19Zhttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/256[CI] enable IO in the now buster based CI2021-09-24T10:52:19ZFlorian Fischer[CI] enable IO in the now buster based CIhttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/263disable throttle test in CI and add more debug messages.2021-09-24T10:46:35ZFlorian Fischerdisable throttle test in CI and add more debug messages.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/258[IoContext] replace fancy CQ locking with a mutex and CQ emptiness check2021-09-24T10:43:10ZFlorian Fischer[IoContext] replace fancy CQ locking with a mutex and CQ emptiness checkhttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/254[WakeupStrategy] introduce a new class to model our wakeup strategies2021-09-23T14:28:41ZFlorian Fischer[WakeupStrategy] introduce a new class to model our wakeup strategiesAdd new 'throttle' wakeup strategy inspired by the algorithm used
by zap, go and tokio. This tries to prevent a possible thundering herd
problem and reduce contention on the scheduler by only waking a single
worker at a time. It further ...Add new 'throttle' wakeup strategy inspired by the algorithm used
by zap, go and tokio. This tries to prevent a possible thundering herd
problem and reduce contention on the scheduler by only waking a single
worker at a time. It further ensures that the next worker is only notified
if the previous successfully found work.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/257[tools/prepare-build-dir] fail if unknown meson option is set2021-09-21T11:30:56ZFlorian Fischer[tools/prepare-build-dir] fail if unknown meson option is sethttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/255Fix repeated ConcurrentNetworkEchoTest and SimpleNetworkTest2021-09-20T13:44:02ZFlorian FischerFix repeated ConcurrentNetworkEchoTest and SimpleNetworkTestBoth test fail when repeated because the listener can not bind to the
tcp tuple again. This is fixed by using SO_REUSEPORT instead of SO_REUSEADDR.
TIL: SO_REUSEADDR is about address wildcards and SO_REUSEPORT allows
rapid binding to th...Both test fail when repeated because the listener can not bind to the
tcp tuple again. This is fixed by using SO_REUSEPORT instead of SO_REUSEADDR.
TIL: SO_REUSEADDR is about address wildcards and SO_REUSEPORT allows
rapid binding to the same tcp tuple.
https://stackoverflow.com/questions/14388706/how-do-so-reuseaddr-and-so-reuseport-differ
Add a generic way to specify socket options when creating a listen socket
with tcp_listener.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/243introduce generic thread_local sleep strategy stats2021-09-20T13:19:59ZFlorian Fischerintroduce generic thread_local sleep strategy statshttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/253[apps/qsort] implement quicksort benchmark used by kprotty2021-09-15T08:04:26ZFlorian Fischer[apps/qsort] implement quicksort benchmark used by kprottyBenchmark results:
Measured on my AMD Ryzen 7 4800H laptop with 8 cores 16 hwthreads and 16GiB RAM
go tokio rayon emper
1. 384ms 527ms 193ms 218ms
2. 370ms 526ms 202ms 226ms
3. 412ms 529ms 187ms 25...Benchmark results:
Measured on my AMD Ryzen 7 4800H laptop with 8 cores 16 hwthreads and 16GiB RAM
go tokio rayon emper
1. 384ms 527ms 193ms 218ms
2. 370ms 526ms 202ms 226ms
3. 412ms 529ms 187ms 251ms
4. 378ms 525ms 149ms 222ms
5. 396ms 531ms 144ms 251ms
avg: 388ms 527ms 175ms 233mshttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/252[lib/LinuxVersion] multiple fixes2021-09-15T07:37:59ZFlorian Fischer[lib/LinuxVersion] multiple fixes* remove fancy but broken `static LinuxVersion` object.
This means each usage of a `EMPER_LINUX_*` macro results in a syscall.
But I think this is worth it when the result is a sound program.
Users of those macros should stor...* remove fancy but broken `static LinuxVersion` object.
This means each usage of a `EMPER_LINUX_*` macro results in a syscall.
But I think this is worth it when the result is a sound program.
Users of those macros should store the result of the comparison anyway.
* fix that we skipped parsing the last part of a version string
* add a test for `LinuxVersion`
* `IO_MUST_INVALIDATE_BROKEN_CHAIN` can still be `const`https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/248Deprecate IoContext submit broken chain logic2021-09-14T06:32:29ZFlorian FischerDeprecate IoContext submit broken chain logicThe manual invalidation of sqes after a submission of a broken chain is not needed anymore with linux 5.15
and https://lore.kernel.org/io-uring/180ec124-79b1-2274-4570-9b0d6620d512@linux.alibaba.com/T/#t.
This also allows `SQPOLL` to pr...The manual invalidation of sqes after a submission of a broken chain is not needed anymore with linux 5.15
and https://lore.kernel.org/io-uring/180ec124-79b1-2274-4570-9b0d6620d512@linux.alibaba.com/T/#t.
This also allows `SQPOLL` to properly function with broken links.
The changes between v1 and v2 were not trivial!
Notable changes:
* Use a static `LinuxVersion` object `emper::lib::LinuxVersion`.
This reduces the overhead of multiple `LINUX_VERSION_*` macro calls to a single syscall.
* Don't initialize a `static` variable using `LINUX_VERSION_*` macros. Because this results in n comparisons one for each object file including the header with the static variable.
**NOTE:**
There is still the possibility that the comparision now done during library initialization of the `Emper` object file crashed because it may write warnings to a not yet initialized `std::stderr`. But I think this always can happen when printing messages using the iostreams during library initialization.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/250[apps/Coordinator] return SUCCESS when exiting successful not FAILURE2021-09-14T06:32:19ZFlorian Fischer[apps/Coordinator] return SUCCESS when exiting successful not FAILUREI am wondering why the python code I use in emper-io-eval to start a Coordinator synchronizing Clients did not fail.I am wondering why the python code I use in emper-io-eval to start a Coordinator synchronizing Clients did not fail.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/251[io/tests] use our own ASSERT macro unaffected by NDEBUG2021-09-13T19:14:17ZFlorian Fischer[io/tests] use our own ASSERT macro unaffected by NDEBUGThis allows use to remove the current hack that the test are always
build without `NDEBUG` regardless of the meson buildtype.
Which is fact fixes the failing io tests in release builds.
Because `Future.hpp` and `Future.cpp` now see the ...This allows use to remove the current hack that the test are always
build without `NDEBUG` regardless of the meson buildtype.
Which is fact fixes the failing io tests in release builds.
Because `Future.hpp` and `Future.cpp` now see the same version of `NDEBUG`.
Fixes #11.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/244[Debug] implement logging to a memory-mapped log file2021-09-13T17:21:14ZFlorian Fischer[Debug] implement logging to a memory-mapped log fileWhen setting the environment variable `EMPER_LOG_FILE=<logfile>` EMPER
will write its log messages to `<logfile>` instead of stderr.
This removes the need for the mutex protecting `std::cerr` as well as
multiple write calls to flush `std...When setting the environment variable `EMPER_LOG_FILE=<logfile>` EMPER
will write its log messages to `<logfile>` instead of stderr.
This removes the need for the mutex protecting `std::cerr` as well as
multiple write calls to flush `std:cerr`.
To efficiently write log messages to the log file
the algorithm uses three memory mapped views into <logfile> to store
the log messages.
One buffer is active, one is new, and one is old.
The next buffer ensures that threads can write log messages even if the
active buffer would overflows.
The old buffer allows slower threads to still write safely while everyone
else uses the active buffer.
When a thread changes from the active buffer to the new buffer it
is responsible to renew the current old buffer and changing the semantic
of the buffers:
* active -> old
* next -> active
* old -> next
This buffer scheme allows wait-free logging.
But the approach is **NOT** sound because delayed thread may still use the
old buffer which gets renewed by the first thread touching the next buffer.
But the likeliness for this situation decreases with bigger sizes of the
buffers.
**ATTENTION:** Using SCHED_IDLE for the completer may break this likeliness
assumption.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/249[PipeSleepStrategy] prevent the still present race to cqes with the completer2021-09-13T14:10:56ZFlorian Fischer[PipeSleepStrategy] prevent the still present race to cqes with the completerThe previous race which I tried but in fact can not be fixed alone with the `waitInflight` flag
is now described in the code comment in `PipeSleepStrategy::sleep()`.
To completely prevent the completer and the worker racing to the
new w...The previous race which I tried but in fact can not be fixed alone with the `waitInflight` flag
is now described in the code comment in `PipeSleepStrategy::sleep()`.
To completely prevent the completer and the worker racing to the
new work notifications cqes we repurpose the `cq_lock` to ensure the
completer is always observing and honoring the `waitInflight` flag.
Also add an `onNewWorkNotification` callback to keep most sleep related
code and logic in `PipeSleepStrategy`.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/247[Make] use tidy make target instead of the meson generated clang-tidy target2021-09-07T13:25:03ZFlorian Fischer[Make] use tidy make target instead of the meson generated clang-tidy targetThe meson generated clang-tidy target uses compile_commands including
all code from subprojects and therefore fails due to code not in our control.
The gitlab CI also uses the tidy make target.The meson generated clang-tidy target uses compile_commands including
all code from subprojects and therefore fails due to code not in our control.
The gitlab CI also uses the tidy make target.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/246[meson/liburing] switch to the official liburing wrap from meson wrapdb2021-09-07T13:24:39ZFlorian Fischer[meson/liburing] switch to the official liburing wrap from meson wrapdbhttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/245[IoContext] die when the completer threads reaps new work notifications2021-09-07T13:24:13ZFlorian Fischer[IoContext] die when the completer threads reaps new work notificationsThe PipeSleepStrategy uses the invariant that the completer thread
is not reaping IoContext of workers which have a read of the
sleep/notification pipe in flight.
This means that it can not reap CQEs resulting from such reads.
To esnure ...The PipeSleepStrategy uses the invariant that the completer thread
is not reaping IoContext of workers which have a read of the
sleep/notification pipe in flight.
This means that it can not reap CQEs resulting from such reads.
To esnure this invariant we DIE if the completer encounters completions
for such notifications.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/242[Debug] fix nanos in log timestamp2021-08-24T13:19:14ZFlorian Fischer[Debug] fix nanos in log timestampThe timestamp consists of <hour><minutes>.<nanos> but the calculation of
the nanos in the current minute was broken.
A minute are 60 * 10^9 nanoseconds and not 10^9.
This allows a log to be sorted using
`sed 's/\./ /' <log-file> | sort ...The timestamp consists of <hour><minutes>.<nanos> but the calculation of
the nanos in the current minute was broken.
A minute are 60 * 10^9 nanoseconds and not 10^9.
This allows a log to be sorted using
`sed 's/\./ /' <log-file> | sort --key=2 --key=3 -n -o <sorted-log-file>`https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/241[liburing] bump the used wrap2021-08-23T09:47:10ZFlorian Fischer[liburing] bump the used wrapNow EMPER builds using the liburing wrap succeed because they no longer
include liburing/src which contains a custom syscall header.Now EMPER builds using the liburing wrap succeed because they no longer
include liburing/src which contains a custom syscall header.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/240[Makefile] Make static-analysis depend on iwyu2021-08-20T12:26:54ZFlorian Schmaus[Makefile] Make static-analysis depend on iwyuThe ninja 'iwyu' target does not depend nor generates
compile_commands_wo_subprojects/compile_commands.json. Hence iwyu
would fail if the database is not yet generated or run with an
outdated compile_commands.json.
Instead of iwyu being...The ninja 'iwyu' target does not depend nor generates
compile_commands_wo_subprojects/compile_commands.json. Hence iwyu
would fail if the database is not yet generated or run with an
outdated compile_commands.json.
Instead of iwyu being added to STATIC_ANALYSIS_NINJA_TARGETS, we now
have the static-analysis make target depend on iwyu. This ensures that
compile_commands_wo_subprojects/compile_commands.json is generated or
updated (if required) before iwyu is run.p