diff --git a/report/document.pdf b/report/document.pdf index 2d4e9af..1f5e949 100644 Binary files a/report/document.pdf and b/report/document.pdf differ diff --git a/report/document.tex b/report/document.tex index 7031c00..6faf77e 100644 --- a/report/document.tex +++ b/report/document.tex @@ -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}