Skip to content

Commit 121ed8e

Browse files
committed
libdistributed version 0.0.2
Bug Fix + Previously, the wrong condition was used in WorkerStopToken that prevented early termination from working as intended to stop workers early. This was resolved by using the correct condition.
1 parent 5fc64bf commit 121ed8e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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.1" LANGUAGES CXX)
2+
project(libdistributed VERSION "0.0.2" LANGUAGES CXX)
33

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

include/work_queue_impl.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class WorkerStopToken : public StopToken
5555
{}
5656

5757
bool stop_requested() override {
58-
if(flag) {
58+
if(!flag) {
5959
MPI_Test(&stop_request, &flag, MPI_STATUS_IGNORE);
6060
}
6161
return flag;
@@ -265,7 +265,10 @@ void worker(MPI_Comm comm, MPI_Datatype request_dtype, MPI_Datatype response_dty
265265
break;
266266
}
267267
}
268-
MPI_Wait(&stop_request, MPI_STATUS_IGNORE);
268+
269+
if(!stop_token.stop_requested()) {
270+
MPI_Wait(&stop_request, MPI_STATUS_IGNORE);
271+
}
269272
}
270273

271274
}

0 commit comments

Comments
 (0)