Using PTHREAD to Calculate the geometric mean of M numbers
DOI:
https://doi.org/10.65204/bgav3n56Keywords:
Parallel program, PTHREAD,Mutex Shared memory.Abstract
Analyze the possibilities of implementing a parallel algorithm for calculating the geometric mean of M numbers. Design and implement (in C/C++) a solution based on memory sharing between individual "threads" of the program. Consider using the "PThread" library. Use the file to dump auxiliary information about the execution of individual threads, with at most one writing to the file at any time. Determine the speedup when executing on N processors if consider the PRAM model. Document the design as well as the implementation in detail.
If the solution requires it, use files for the input and output of matrices (and vectors) where the row of the matrix corresponds to the row of the file and the values of the columns are separated by spaces or tabs. Unless otherwise stated, work with real numbers.