From 98dd0ec7333c58788f83b3f18a60389fa55db3aa Mon Sep 17 00:00:00 2001 From: Jakub Szewczyk Date: Thu, 9 Dec 2021 15:26:09 +0000 Subject: [PATCH] Scheduler: restore a couple of missing pieces from the last merge --- .clang-tidy | 22 +++++++++++++--------- src/scheduler/Scheduler.cpp | 9 +++++++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index c2cdbad93..fa12ff219 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,13 +1,17 @@ --- Checks: > - clang-analyzer-*, - -clang-diagnostic-unknown-attributes, - -clang-diagnostic-return-type - modernize-*, - -modernize-use-trailing-return-type, - readability-*, - -readability-magic-numbers, - -readability-redundant-string-cstr, - -readability-implicit-bool-conversion + clang-analyzer-*, + -clang-diagnostic-unknown-attributes, + -clang-diagnostic-return-type + modernize-*, + -modernize-use-trailing-return-type, + readability-*, + -readability-magic-numbers, + -readability-redundant-string-cstr, + -readability-implicit-bool-conversion, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-identifier-length, + -readability-else-after-return diff --git a/src/scheduler/Scheduler.cpp b/src/scheduler/Scheduler.cpp index fff66a93c..c4f609bc3 100644 --- a/src/scheduler/Scheduler.cpp +++ b/src/scheduler/Scheduler.cpp @@ -442,11 +442,11 @@ faabric::util::SchedulingDecision Scheduler::makeSchedulingDecision( if (remainder > 0) { std::vector unregisteredHosts; if (hostKindDifferent) { - unregisteredHosts = getUnregisteredHosts(funcStr); - } else { for (auto&& h : getAvailableHostsForFunction(firstMsg)) { unregisteredHosts.push_back(std::move(h)); } + } else { + unregisteredHosts = getUnregisteredHosts(funcStr); } for (const auto& h : unregisteredHosts) { @@ -737,6 +737,11 @@ faabric::util::SchedulingDecision Scheduler::doCallFunctions( auto* newMsg = hostRequest->add_messages(); *newMsg = req->messages().at(msgIdx); newMsg->set_executeslocally(false); + if (!newMsg->directresulthost().empty()) { + faabric::util::UniqueLock resultsLock(localResultsMutex); + localResults.insert( + { newMsg->id(), std::make_shared() }); + } } // Dispatch the calls