diff --git a/README.md b/README.md index aa7414bd86b7e9ad76b60b080d5feba92d80703f..2ecabcae07fa407e0ea96c7d1d613198ad3512f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EMPER -The Extensible Massive-Parallelism Execution Realm (EMPER) is a concurrency platform to develop and execute parallel applications. +The Efficient Massive-Parallelism Execution Realm (EMPER) is a concurrency platform to develop and execute parallel applications. EMPER's primary objective is to support the research of different aspects of parallel execution of a potentially massive amount of concurrent strands of execution on current and future many-core systems. Those aspects include, for example, scheduling strategies, synchronization primitives, and ultimately the overall coordination of concurrent strands of execution concerning optimal resource usage, including locality and energy efficiency. diff --git a/emper/Emper.cpp b/emper/Emper.cpp index c696d9a2b8dc3ad8e43bea28bcfe9e114408d8fd..9b8e29cfcddf1fb7255561c1c1727e16258a36a5 100644 --- a/emper/Emper.cpp +++ b/emper/Emper.cpp @@ -117,7 +117,7 @@ auto operator>>(std::istream& in, ContinuationStealingMadviseStack& cont_stealin void printInfo(std::ostream& strm) { // clang-format off - strm << std::boolalpha << "Extensible Massive-Parallelism Execution Realm (EMPER)" << std::endl + strm << std::boolalpha << "Efficient Massive-Parallelism Execution Realm (EMPER)" << std::endl << "Version: " << getFullVersion() << std::endl << "Debug: " << DEBUG << std::endl << "IO: " << IO << std::endl diff --git a/emper/Fibril.hpp b/emper/Fibril.hpp index 2be6c341da98978db544e6bfb31600aa30fa96b7..de43069eebf9733215fe989b228e740db5ae3fa8 100644 --- a/emper/Fibril.hpp +++ b/emper/Fibril.hpp @@ -227,7 +227,7 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { LOGD("constructed " << *this); } - ~Fibril() override { join(); } + ~Fibril() override { sync(); } auto asFibrilIfPossible() -> Fibril* override { return this; } @@ -252,7 +252,7 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { // ContextManager::start() invokes tryResumeFibril(uint32_t), let's be friends. friend void ContextManager::start(); - __attribute__((noinline, hot, optimize(3))) void doJoin() { + __attribute__((noinline, hot, optimize(3))) void doSync() { cont.ip = __builtin_return_address(0); toResume = this; @@ -296,8 +296,8 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { public: template <class RET, class... PARs, class... ARGs> - inline __attribute__((always_inline)) void fork(RET* ret, RET (*fun)(PARs...), ARGs... args) { - auto fork_func = [](ARGs... args, Fibril * fr, RET * ret, RET(*fun)(PARs...)) + inline __attribute__((always_inline)) void spawn(RET* ret, RET (*fun)(PARs...), ARGs... args) { + auto spawn_func = [](ARGs... args, Fibril * fr, RET * ret, RET(*fun)(PARs...)) __attribute__((noinline, hot, optimize(3))) { fr->cont.ip = __builtin_return_address(0); bool pushed = fr->runtime.scheduler.pushBottom(*fr); @@ -306,12 +306,12 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { return; fr->checkContinuationState(); }; - membar(fork_func(args..., this, ret, fun)); + membar(spawn_func(args..., this, ret, fun)); } template <class... PARs, class... ARGs> - inline __attribute__((always_inline)) void fork(void (*fun)(PARs...), ARGs... args) { - auto fork_func = [](ARGs... args, Fibril * fr, void (*fun)(PARs...)) + inline __attribute__((always_inline)) void spawn(void (*fun)(PARs...), ARGs... args) { + auto spawn_func = [](ARGs... args, Fibril * fr, void (*fun)(PARs...)) __attribute__((noinline, hot, optimize(3))) { fr->cont.ip = __builtin_return_address(0); bool pushed = fr->runtime.scheduler.pushBottom(*fr); @@ -320,12 +320,12 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { return; fr->checkContinuationState(); }; - membar(fork_func(args..., this, fun)); + membar(spawn_func(args..., this, fun)); } template <class T, class... ARGs> - inline __attribute__((always_inline)) void fork(std::function<T> fun, ARGs... args) { - auto fork_func = [](Fibril * fr, std::function<T> fun, ARGs... args) + inline __attribute__((always_inline)) void spawn(std::function<T> fun, ARGs... args) { + auto spawn_func = [](Fibril * fr, std::function<T> fun, ARGs... args) __attribute__((noinline, hot, optimize(3))) { fr->cont.ip = __builtin_return_address(0); bool pushed = fr->runtime.scheduler.pushBottom(*fr); @@ -334,28 +334,28 @@ class Fibril : public AbstractFiber, public Logger<LogSubsystem::FIBRIL> { return; fr->checkContinuationState(); }; - membar(fork_func(this, fun, args...)); + membar(spawn_func(this, fun, args...)); } - inline __attribute__((always_inline)) void join() { + inline __attribute__((always_inline)) void sync() { if constexpr (LOCKED_CONTINUATION_STEALING) { - joinLocked(); + syncLocked(); } else { - joinWaitFree(); + syncWaitFree(); } } private: - inline __attribute__((always_inline)) void joinLocked() { + inline __attribute__((always_inline)) void syncLocked() { if (activeChildrenCount == 0) return; - membar(doJoin()); + membar(doSync()); } - inline __attribute__((always_inline)) void joinWaitFree() { + inline __attribute__((always_inline)) void syncWaitFree() { if (reverseStealCount == 0) return; - membar(doJoin()); + membar(doSync()); reverseStealCount = 0; if constexpr (UNMAP_STACKS) { diff --git a/emper/io/io.cpp b/emper/io/io.cpp index a58a29fb5a1429bb9da0afc7787e1458694c2e89..a0ea6b48c45b5b83e5eaefc75230dccc9fd3eab7 100644 --- a/emper/io/io.cpp +++ b/emper/io/io.cpp @@ -72,11 +72,11 @@ emper_fibril void fibril_recursive_directory_walk( // become invalid at the end of the iteration. const fs::directory_entry path = pathRef; if (filter(path)) { - fibril.fork(fn, path); + fibril.spawn(fn, path); } if (pathRef.is_directory()) { - fibril.fork(fibril_recursive_directory_walk, path, filter, fn); + fibril.spawn(fibril_recursive_directory_walk, path, filter, fn); } } } diff --git a/tests/continuation-stealing/ContinuationStealingAndPrivateSemaphoreTest.cpp b/tests/continuation-stealing/ContinuationStealingAndPrivateSemaphoreTest.cpp index 982b64bb52e7b88804c831e681247aec9b677299..a9e136ce99cdbdc2c3bc684fd6d598b48a3118a3 100644 --- a/tests/continuation-stealing/ContinuationStealingAndPrivateSemaphoreTest.cpp +++ b/tests/continuation-stealing/ContinuationStealingAndPrivateSemaphoreTest.cpp @@ -9,35 +9,35 @@ emper_fibril static void waitOnBps(BPS* bps) { bps->wait(); } // NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) -emper_fibril static void forkFirstThenSignal() { +emper_fibril static void spawnFirstThenSignal() { Fibril fibril; BPS bps; - fibril.fork(waitOnBps, &bps); + fibril.spawn(waitOnBps, &bps); bps.signal(); - fibril.join(); + fibril.sync(); } // NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) -emper_fibril static void signalFirstThenFork() { +emper_fibril static void signalFirstThenSpawn() { Fibril fibril; BPS bps; bps.signal(); - fibril.fork(waitOnBps, &bps); + fibril.spawn(waitOnBps, &bps); - fibril.join(); + fibril.sync(); } void emperTest() { - std::cout << "#### Fork first, then signal\n"; - forkFirstThenSignal(); + std::cout << "#### Spawn first, then signal\n"; + spawnFirstThenSignal(); - std::cout << "#### Signal first, then fork\n"; - signalFirstThenFork(); + std::cout << "#### Signal first, then spawn\n"; + signalFirstThenSpawn(); std::cout << "#### Return from emperTest()\n"; } diff --git a/tests/continuation-stealing/CppContinuationApiTest.cpp b/tests/continuation-stealing/CppContinuationApiTest.cpp index c4826dfc189c69cb930580f7bf4df708d2666486..a6ad47a474989796b939f5607a858ab5027c4289 100644 --- a/tests/continuation-stealing/CppContinuationApiTest.cpp +++ b/tests/continuation-stealing/CppContinuationApiTest.cpp @@ -15,10 +15,10 @@ emper_fibril void emperTest() { Fibril fibril; for (unsigned int i = 0; i < COUNT; ++i) { - fibril.fork(increaseCounterByOne); + fibril.spawn(increaseCounterByOne); } - fibril.join(); + fibril.sync(); if (counter != COUNT) { exit(EXIT_FAILURE); diff --git a/tests/continuation-stealing/FibFibrilTest.cpp b/tests/continuation-stealing/FibFibrilTest.cpp index 665e3764b3c5cebcbefa7c32da8146a4d78a33c4..81ae91d9d4141c6aa473cdd312def0dfa22e94a3 100644 --- a/tests/continuation-stealing/FibFibrilTest.cpp +++ b/tests/continuation-stealing/FibFibrilTest.cpp @@ -27,11 +27,11 @@ emper_fibril static auto fib(uint64_t n) -> uint64_t { Fibril fibril; uint64_t a, b; - fibril.fork(&a, fib, n - 1); + fibril.spawn(&a, fib, n - 1); b = fib(n - 2); - fibril.join(); + fibril.sync(); return a + b; }