Files
MeanField_SERiF/docs/latex/namespaceserif_1_1utils_1_1parallel.tex
Emily Boudreaux 6b57738330 docs(docs): built docs
Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
2026-11-09 14:09:44 -05:00

57 lines
4.7 KiB
TeX

\doxysection{serif\+::utils\+::parallel Namespace Reference}
\hypertarget{namespaceserif_1_1utils_1_1parallel}{}\label{namespaceserif_1_1utils_1_1parallel}\index{serif::utils::parallel@{serif::utils::parallel}}
\doxysubsubsection*{Namespaces}
\begin{DoxyCompactItemize}
\item
namespace \mbox{\hyperlink{namespaceserif_1_1utils_1_1parallel_1_1detail}{detail}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item
int \mbox{\hyperlink{namespaceserif_1_1utils_1_1parallel_a845c655da35a46d0be87880f0e4fa2d9}{worker\+\_\+count}} () noexcept
\begin{DoxyCompactList}\small\item\em Workers an element loop may use\+: Open\+MP\textquotesingle{}s thread limit (OMP\+\_\+\+NUM\+\_\+\+THREADS), or 1 without Open\+MP or inside an enclosing parallel region. \end{DoxyCompactList}\item
{\footnotesize template$<$typename BodyT$>$ }\\void \mbox{\hyperlink{namespaceserif_1_1utils_1_1parallel_a453320d288c9e42300bdc59ee8dccd2d}{for\+\_\+each\+\_\+index}} (const int count, BodyT \&\&body)
\begin{DoxyCompactList}\small\item\em Call body(index, worker) once for every index in \mbox{[}0, count), possibly concurrently. \end{DoxyCompactList}\item
void \mbox{\hyperlink{namespaceserif_1_1utils_1_1parallel_a8e0e78d02ab6c49ae588644e579bed79}{element\+\_\+transformation}} (const \+::mfem\+::\+Mesh \&mesh, int element, \+::mfem\+::\+Isoparametric\+Transformation \&transformation)
\begin{DoxyCompactList}\small\item\em Mesh\+::\+Get\+Element\+Transformation(element, transformation), safe in concurrent element loops. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection{Function Documentation}
\Hypertarget{namespaceserif_1_1utils_1_1parallel_a8e0e78d02ab6c49ae588644e579bed79}\index{serif::utils::parallel@{serif::utils::parallel}!element\_transformation@{element\_transformation}}
\index{element\_transformation@{element\_transformation}!serif::utils::parallel@{serif::utils::parallel}}
\doxysubsubsection{\texorpdfstring{element\_transformation()}{element\_transformation()}}
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1parallel_a8e0e78d02ab6c49ae588644e579bed79}
void serif\+::utils\+::parallel\+::element\+\_\+transformation (\begin{DoxyParamCaption}\item[{const \+::mfem\+::\+Mesh \&}]{mesh}{, }\item[{int}]{element}{, }\item[{\+::mfem\+::\+Isoparametric\+Transformation \&}]{transformation}{}\end{DoxyParamCaption})}
Mesh\+::\+Get\+Element\+Transformation(element, transformation), safe in concurrent element loops.
\begin{DoxyNote}{Note}
MFEM\textquotesingle{}s version gathers curved-\/mesh nodes through Finite\+Element\+Space\+::\+Get\+Element\+VDofs(int, Array\&), which writes the space\textquotesingle{}s shared mutable Dof\+Transformation. This copy performs the same steps with a local Dof\+Transformation, so the transformation and every value derived from it are identical.
\end{DoxyNote}
\Hypertarget{namespaceserif_1_1utils_1_1parallel_a453320d288c9e42300bdc59ee8dccd2d}\index{serif::utils::parallel@{serif::utils::parallel}!for\_each\_index@{for\_each\_index}}
\index{for\_each\_index@{for\_each\_index}!serif::utils::parallel@{serif::utils::parallel}}
\doxysubsubsection{\texorpdfstring{for\_each\_index()}{for\_each\_index()}}
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1parallel_a453320d288c9e42300bdc59ee8dccd2d}
template$<$typename BodyT$>$ \\
void serif\+::utils\+::parallel\+::for\+\_\+each\+\_\+index (\begin{DoxyParamCaption}\item[{const int}]{count}{, }\item[{BodyT \&\&}]{body}{}\end{DoxyParamCaption})}
Call body(index, worker) once for every index in \mbox{[}0, count), possibly concurrently.
\begin{DoxyNote}{Note}
Results do not depend on the thread count when each call writes only index-\/owned results and scratch owned by its worker (0 \texorpdfstring{$<$}{<}= worker \texorpdfstring{$<$}{<} \doxylink{namespaceserif_1_1utils_1_1parallel_a845c655da35a46d0be87880f0e4fa2d9}{worker\+\_\+count()}). Every index runs; the exception of the lowest throwing index is then rethrown, which is the one a serial loop would have raised.
\end{DoxyNote}
\Hypertarget{namespaceserif_1_1utils_1_1parallel_a845c655da35a46d0be87880f0e4fa2d9}\index{serif::utils::parallel@{serif::utils::parallel}!worker\_count@{worker\_count}}
\index{worker\_count@{worker\_count}!serif::utils::parallel@{serif::utils::parallel}}
\doxysubsubsection{\texorpdfstring{worker\_count()}{worker\_count()}}
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1parallel_a845c655da35a46d0be87880f0e4fa2d9}
int serif\+::utils\+::parallel\+::worker\+\_\+count (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [noexcept]}}
Workers an element loop may use\+: Open\+MP\textquotesingle{}s thread limit (OMP\+\_\+\+NUM\+\_\+\+THREADS), or 1 without Open\+MP or inside an enclosing parallel region.