This commit is contained in:
elvis
2023-08-26 20:07:00 +02:00
parent 20125fc29f
commit 8fcbdb788e
2 changed files with 5 additions and 3 deletions

View File

@ -311,6 +311,8 @@ The \texttt{Task} class can support matrixes of different element type rather th
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 rougly equal parts and distributes them to other workers.
%% - - - - - - - - - - - - - - - - - - %%
\subsection{Native C++ Threads}
@ -335,10 +337,10 @@ The structure of the implementation with native C++ threads is as follows:
\end{algorithmic}
\begin{algorithmic}[1]
\Procedure{lambda}{$l, \Delta$}\Comment \textit{$l$ is the thread number, $\Delta$ is the ammount of rows to process}
\Procedure{lambda}{$l, \Delta$}\Comment \textit{$l$ is the index of block of rows, $\Delta$ is the number of rows}
\For{$x \in \{l \cdot \Delta, \ldots, (l+1) \cdot \Delta - 1\}$}
\For{$y \in \{0, \ldots, Columns\}$}
\If $(x, y)$ not in the border
\If{$(x, y)$ not in the border}
\State calculate the neighborhood of $(x, y)$
\State $arena[x][y] = Stencil(neighborhood)$
\EndIf
@ -379,7 +381,7 @@ A custom emitter and collector would not have been faster and so the simpler app
\begin{algorithmic}[1]
\Procedure{lambda}{$x$}
\For{$y \in \{0, \ldots, Columns\}$}
\If $(x, y)$ not in the border
\If {$(x, y)$ not in the border}
\State calculate the neighborhood of $(x, y)$
\State $arena[x][y] = Stencil(neighborhood)$
\EndIf