emper merge requestshttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests2021-09-15T08:04:26Zhttps://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/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/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/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/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/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/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/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/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.phttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/239[build] Emit a message if liburing subproject is used2021-08-20T12:10:12ZFlorian Schmaus[build] Emit a message if liburing subproject is usedhttps://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/238Consume liburing as meson wrap if native is not recent enough2021-08-19T11:46:42ZFlorian FischerConsume liburing as meson wrap if native is not recent enoughThis was initially a part of !210 but I notices the old !190 would benefit from it as well.
So I decided the problems of !210 should not hold back those meson/liburing chages.This was initially a part of !210 but I notices the old !190 would benefit from it as well.
So I decided the problems of !210 should not hold back those meson/liburing chages.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/237[Future] Also log 'res' in LOGD of setCompletion(int32_t res)2021-08-19T11:40:32ZFlorian Schmaus[Future] Also log 'res' in LOGD of setCompletion(int32_t res)It can't hurt to provide more information in log messages, especially
'res' is a good candidate in this case.It can't hurt to provide more information in log messages, especially
'res' is a good candidate in this case.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/236[GlobalIoContext] Add CompleterSchedParam option2021-08-19T11:40:23ZFlorian Schmaus[GlobalIoContext] Add CompleterSchedParam optionThis adds an option to make the scheduling parameters of the completer
thread configurable via a meson option.This adds an option to make the scheduling parameters of the completer
thread configurable via a meson option.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/235[IoContext] Add missing error handling in submitPreparedSqesAndWait()2021-08-19T08:56:12ZFlorian Schmaus[IoContext] Add missing error handling in submitPreparedSqesAndWait()Within the
do { reapAndScheduleCompletions() } while (io_uring_submit() == -EBUSY)
loop, the return value of io_uring_submit could be a negative value other
than EBUSY. In that case, we did not DIE.
Looking at the SubmitActor, where w...Within the
do { reapAndScheduleCompletions() } while (io_uring_submit() == -EBUSY)
loop, the return value of io_uring_submit could be a negative value other
than EBUSY. In that case, we did not DIE.
Looking at the SubmitActor, where we have a very similar loop, the
error handling is correct. This changes the error handling in
IoContext to match the one of SubmitActor, even though it has a little
bit more overhead.https://gitlab.cs.fau.de/i4/manycore/emper/-/merge_requests/234Draft: Completer strategies2021-08-25T14:13:43ZFlorian SchmausDraft: Completer strategies