Skip to content

Commit

Permalink
threads: elastically scale-up (#418)
Browse files Browse the repository at this point in the history
* threads: elastically scale-up

* gh: bump code version

* threads: handle zero-sized requests and preload a la mpi

* omp: fix race conditions with elastic scaling
  • Loading branch information
csegarragonz authored May 13, 2024
1 parent 8b5bd8e commit 5497d05
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAABRIC_VERSION=0.19.0
FAABRIC_CLI_IMAGE=faasm.azurecr.io/faabric:0.19.0
FAABRIC_VERSION=0.20.0
FAABRIC_CLI_IMAGE=faasm.azurecr.io/faabric:0.20.0
COMPOSE_PROJECT_NAME=faabric-dev
CONAN_CACHE_MOUNT_SOURCE=./conan-cache/
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
env:
DEPLOYMENT_TYPE: gha-ci
steps:
Expand All @@ -34,7 +34,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
steps:
- name: "Check out code"
uses: actions/checkout@v4
Expand All @@ -45,7 +45,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
steps:
- name: "Check out code"
uses: actions/checkout@v4
Expand All @@ -65,7 +65,7 @@ jobs:
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
options: --privileged
services:
redis:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
options: --privileged
services:
redis:
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.19.0
image: faasm.azurecr.io/faabric:0.20.0
services:
redis:
image: redis
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.0
0.20.0
7 changes: 7 additions & 0 deletions src/batch-scheduler/BinPackScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ std::shared_ptr<SchedulingDecision> BinPackScheduler::makeSchedulingDecision(
auto decisionType = getDecisionType(inFlightReqs, req);
auto sortedHosts = getSortedHosts(hostMap, inFlightReqs, req, decisionType);

// For an OpenMP request with the single host hint, we only consider
// scheduling in one VM
bool isOmp = req->messages_size() > 0 && req->messages(0).isomp();
if (req->singlehosthint() && isOmp) {
sortedHosts.erase(sortedHosts.begin() + 1, sortedHosts.end());
}

// Assign slots from the list (i.e. bin-pack)
auto it = sortedHosts.begin();
int numLeftToSchedule = req->messages_size();
Expand Down
2 changes: 1 addition & 1 deletion src/batch-scheduler/SchedulingDecision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bool SchedulingDecision::isSingleHost() const

std::string thisHost = conf.endpointHost;
std::set<std::string> hostSet(hosts.begin(), hosts.end());
return hostSet.size() == 1;
return hostSet.size() <= 1;
}

void SchedulingDecision::addMessage(const std::string& host,
Expand Down
Loading

0 comments on commit 5497d05

Please sign in to comment.