Prev | Next | multi_chkpoint_one_run |
ok = multi_chkpoint_one_run(y_squared, square_root)
const vector<double>& y_squared
and its size is equal to the number of threads.
It is the values that we are computing the square root of.
vector<double>& square_root
The input value of
square_root
does not matter.
Upon return,
it has the same size and
is the element by element square root of
y_squared
.
bool ok
If it is false,
multi_chkpoint_one_run
detected an error.
namespace { bool multi_chkpoint_one_run( const vector<double>& y_squared , vector<double>& square_root ) { bool ok = true; ok &= thread_alloc::thread_num() == 0; // setup the work for multi-threading ok &= multi_chkpoint_one_setup(y_squared); // now do the work for each thread if( num_threads_ > 0 ) team_work( multi_chkpoint_one_worker ); else multi_chkpoint_one_worker(); // combine the result for each thread and takedown the multi-threading. ok &= multi_chkpoint_one_takedown(square_root); return ok; } }