Skip to content

Commit e2064b6

Browse files
committed
libdistributed version 0.0.8
Bug Fix: Previously the wrong type was passed for the cancellation request, and the master could incorrectly attempt to complete a cancellation request twice
1 parent eaf6571 commit e2064b6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.12)
2-
project(libdistributed VERSION "0.0.6" LANGUAGES CXX)
2+
project(libdistributed VERSION "0.0.8" LANGUAGES CXX)
33

44
#correct was to set a default build type
55
# https://blog.kitware.com/cmake-and-the-default-build-type/

include/libdistributed_work_queue_impl.h

+8-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class WorkerTaskManager : public TaskManager<RequestType>
6565
}
6666

6767
void request_stop() override {
68-
int done = 1;
68+
ResponseType done{};
6969
comm::send(done, ROOT, (int)worker_status::cancel, comm);
7070
}
7171

@@ -107,10 +107,13 @@ class MasterTaskManager : public TaskManager<RequestType>
107107
}
108108

109109
void request_stop() override {
110-
MPI_Request request;
111-
is_stop_requested = 1;
112-
MPI_Ibcast(&is_stop_requested, 1, MPI_INT, ROOT, comm, &request);
113-
MPI_Wait(&request, MPI_STATUS_IGNORE);
110+
if(is_stop_requested == 0)
111+
{
112+
MPI_Request request;
113+
is_stop_requested = 1;
114+
MPI_Ibcast(&is_stop_requested, 1, MPI_INT, ROOT, comm, &request);
115+
MPI_Wait(&request, MPI_STATUS_IGNORE);
116+
}
114117
}
115118

116119
void push(RequestType const& request) override {

0 commit comments

Comments
 (0)