Displaying 1 result from an estimated 1 matches for "is_aborted".
2012 Feb 23
0
RcppProgress: progress monitoring and interrupting c++ code, request for comments
...tatET
console.
* I tried to write a small documentation, included in the package, but
basically you use it like this:
The main loop:
Progress p(max, display_progress); // create the progress monitor
#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < max; ++i) {
if ( ! p.is_aborted() ) { // the only way to exit an OpenMP loop
long_computation(nb);
p.increment(); // update the progress
}
}
and in your computation intensive function:
void long_computation(int nb) {
double sum = 0;
for (int i = 0; i < nb; ++i) {
if ( Progr...