added reasons for current implementation

This commit is contained in:
elvis
2023-08-29 17:26:23 +02:00
parent 5d8348b42a
commit cb2a139b4f
2 changed files with 9 additions and 1 deletions

Binary file not shown.

View File

@ -274,6 +274,9 @@ prefixes-as-symbols=false,
%% - - - - - - - - - - - - - - - - - %%
\thispagestyle{empty}
\addtocounter{page}{-1}
\tableofcontents
\newpage
@ -306,11 +309,16 @@ The class \texttt{Stencil} holds both the parallel implementation using the Fast
The class \texttt{Reader} reads a binary file composed of 4 bytes representing the number of rows, 4 bytes representing the number of columns and then the raw matrix data. Each element is a \texttt{char} in all the test cases. The result is stored in the class \texttt{Task} which will be passed to the next node. If instead the operator \texttt{()} is called, only the data will be returned as a pointer.
The \texttt{Task} class can support matrices of different element type rather than \texttt{char}.
The \texttt{Task} class can support matrices of different element type other than \texttt{char}.
The \texttt{Writer} instead writes to disk the task to the same folder, overwriting existing files if present.
The \texttt{Stencil} class divides the matrix in roughly equal parts and distributes them to other workers.
Since the ammount of work for simple stencil functions is roughly equal between blocks of columns, the matrix is split into equal blocks and each block is processed by a different worker.
The result is stored in a copy of the original matrix and the pointers swapped at the end of each iteration.
Since a neighbourhood of columns is needed for the next iteration, the simplest solution of waiting for all workers has been implemented.
A countiguous block of columns reduces the probability of false sharing.
The loops of the workers thread cannot be vectorized by the compiler since the stencil function may be calling library functions or use conditional statements.
%% - - - - - - - - - - - - - - - - - - %%
\subsection{Native C++ Threads}