Take Down Multi-threading Sum of 1/i

Syntax
ok = harmonic_takedown(sum) 
Purpose
This routine does the takedown for splitting the summation that defines the harmonic series $$s = 1 + 1/2 + 1/3 + ... + 1/n$$ into separate parts for each thread; see harmonic_setup .

It is assumed that this function is called by thread zero, and all the other threads have completed their work and are blocked (waiting).

sum
This argument has prototype       double& sum  The input value of the argument does not matter. Upon return it is the value of the summation; i.e. $s$.

Source

namespace {
bool harmonic_takedown(double& sum)
{     // sum = 1/num_sum + 1/(num_sum-1) + ... + 1
bool ok            = true;
sum                = 0.;
//
// go down so that free memory for other threads before memory for master
{     // check that this tread was ok with the work it did
//
//
// delete problem specific information
void* v_ptr = static_cast<void*>( work_all_[thread_num] );
}