Skip to content

FandosA/Simple_Parallelization_Exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Simple Parallelization Exercises

The cpp files consist of simple exercises implemented in C++ to parallelize tasks. This way, it is possible to perform these tasks faster using a certain number of threads of your processor.

The file find_prime_nums.cpp is an algorithm that finds the prime numbers, larger than a given value, in an array. Setting the parameters, an array is randomly initialized with integer values within a range. Then, each thread looks for the prime numbers larger than the given value in its corresponding set of numbers, and finally they're printed.

On the other hand, the file pi_taylor.cpp approximates pi using the taylor series shown in the figure. As we increase the number of steps, i.e. the number of terms in the series, pi will be more accurate. The parameter to increase the number of terms in the series is the variable steps.