/invisible

Data Challenge for Invisible AI

Primary LanguageMakefile

/******************************************************************************/

QUICK START:

1. Inside the directory src/ execute in shell: make all

2. Run the executable, Nilakantha_Series followed by a single positive integer input

/******************************************************************************/

Author: Daniel Wooten
Email: danieldavidwooten@gmail.com
Version: 1.0
Release Date: 11/28/2022

Welcome to the Nilakantha series calculator! 

Documentation for all constructs may be found inside the docs/ directory.

This README has 3 sections...

1. Installation

2. Usage

3. Considerations 

Section 1: Installation
/******************************************************************************/

The parent directory, perceptronics, contains two sub-directories, src/ and
docs/. Setting src/ as the current directory, enter the command "make all" into
a terminal. Upon successful compilation you will see the message
"Nilakantha_Series compiled OK". You now have a functioning executable!

Section 2: Usage
/******************************************************************************/

To use the Nilakantha series calculator, from the terminal call the executable 
Nilakantha_Series followed by a single positive integer value, such as '3' for
example, and the program Will proceed to calculate and print out the first
3 terms of the Nilakantha series or however many terms were represented by the
input integer following program invocation.

Any other input will cause the program to error out.

Section 3: Considerations 
/******************************************************************************/

Largely, considerations of efficiency and maintainability do not conflict with
one another. One area of this project in which they did was the exclusion of any
temporary variable for computations - rather computations are executed monolithically.
This is done prevent any intermediate memory usage or register shift - the compiler
is encouraged to use fast-math as much as possible.

The other major area of conflict between efficiency and maintainability, even
readability in this case, was the choice to have the threads loop over themselves
following thread computation and value collection. While this looping is more
complicated and takes more cycles than storing the thread computations
and having a single thread manage value collection this method uses less memory,
and more importantly no dynamically allocated memory.

In environments of compute rather than memory bound, it would be advisable to
forgo the thread loop ( j loop in nilakantha_series::calculate ) in exchange for
each thread saving their value to an intermediate array from which the master
thread would manage value agglomeration.