SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::utils::parallel Namespace Reference

Namespaces

namespace  detail
 

Functions

int worker_count () noexcept
 Workers an element loop may use: OpenMP's thread limit (OMP_NUM_THREADS), or 1 without OpenMP or inside an enclosing parallel region.
 
template<typename BodyT>
void for_each_index (const int count, BodyT &&body)
 Call body(index, worker) once for every index in [0, count), possibly concurrently.
 
void element_transformation (const ::mfem::Mesh &mesh, int element, ::mfem::IsoparametricTransformation &transformation)
 Mesh::GetElementTransformation(element, transformation), safe in concurrent element loops.
 

Function Documentation

◆ element_transformation()

void serif::utils::parallel::element_transformation ( const ::mfem::Mesh & mesh,
int element,
::mfem::IsoparametricTransformation & transformation )

Mesh::GetElementTransformation(element, transformation), safe in concurrent element loops.

Note
MFEM's version gathers curved-mesh nodes through FiniteElementSpace::GetElementVDofs(int, Array&), which writes the space's shared mutable DofTransformation. This copy performs the same steps with a local DofTransformation, so the transformation and every value derived from it are identical.

◆ for_each_index()

template<typename BodyT>
void serif::utils::parallel::for_each_index ( const int count,
BodyT && body )

Call body(index, worker) once for every index in [0, count), possibly concurrently.

Note
Results do not depend on the thread count when each call writes only index-owned results and scratch owned by its worker (0 <= worker < 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.

◆ worker_count()

int serif::utils::parallel::worker_count ( )
nodiscardnoexcept

Workers an element loop may use: OpenMP's thread limit (OMP_NUM_THREADS), or 1 without OpenMP or inside an enclosing parallel region.