Skip to content

Commit

Permalink
OMP_CANCELLATION
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed Mar 23, 2019
1 parent 418d8c7 commit 46606f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tyrant_optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ class Process
sim->set_decks(this->your_decks, this->enemy_decks);
#pragma omp for reduction(VecPlus:results) schedule(runtime)
for(unsigned i =0; i < thread_num_iterations;++i) {
#pragma omp cancellation point for
if(!compare_stop){
if(results.size()==0)
results =sim->evaluate(); //calculate single sim
Expand Down Expand Up @@ -1126,6 +1127,10 @@ class Process
}
compare_stop = (boost::math::binomial_distribution<>::find_upper_bound_on_p(ttrials, ssuccesses, prob) * max_possible <
thread_best_results->points + min_increment_of_score);
if(compare_stop)
{
#pragma omp cancel for
}

}
}
Expand Down

0 comments on commit 46606f3

Please sign in to comment.