Common Variables Used by Multi-threading Sum of 1/i

Purpose
This source code defines the common include files, defines, and variables that are used by the summation that defines the harmonic series $$1 + 1/2 + 1/3 + ... + 1/n$$

Source


# include "harmonic.hpp"

namespace {

// Number of threads, set by previous call to harmonic_time

// value of mega_sum, set by previous call to harmonic_time.
size_t mega_sum_;

// structure with information for one thread
typedef struct {
// index to start summation at (worker input)
// set by previous call to harmonic_setup
size_t start;
// index to end summation at (worker input)
// set by previous call to harmonic_setup
size_t stop;
}