File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class Team {
3030 SignedT stride = 0 ;
3131
3232 bool valid = false ;
33+ kmp_uint32 numDone = 0 ;
3334
3435 Mutex mutex;
3536 };
@@ -57,10 +58,6 @@ class Team {
5758
5859 inline auto getCopyPrivateData () const { return copyPrivateData; }
5960
60- inline void invalidateSchedule () {
61- std::get<DynamicSchedule<kmp_int32>>(this ->dynamicSchedule ).valid = false ;
62- }
63-
6461 inline void run () {
6562 for (kmp_uint32 i = 0 ; i < numThreads; i++) {
6663 runtime::threads[i].setCurrentTeam (this );
@@ -199,6 +196,11 @@ class Team {
199196
200197 if (dynamicSchedule.lowerNext > dynamicSchedule.upper ) {
201198 DEBUG_PRINT (" Dynamic loop done\n " );
199+ if (++dynamicSchedule.numDone == numThreads) {
200+ dynamicSchedule.valid = false ;
201+ dynamicSchedule.numDone = 0 ;
202+ }
203+
202204 return false ;
203205 }
204206
You can’t perform that action at this time.
0 commit comments