core 1.5.0
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::detail Namespace Reference

Functions

int affinityCpus ()
 CPUs in this process's affinity mask, or 0 if that cannot be determined.
 
std::string readFirstLine (const std::string &path)
 First whitespace-separated fields of a file, or an empty string if it cannot be read.
 
std::string cgroupPath (const std::string &procSelfCgroup, const std::string &controller)
 The cgroup path of this process for controller ("" = the v2 unified hierarchy), e.g.
 
int quotaFromCpuMax (const std::string &file)
 CPUs allowed by one cgroup-v2 cpu.max file ("max 100000" or "200000 100000"), rounded UP so a fractional budget still gets one thread.
 
int quotaFromCfs (const std::string &dir)
 The same for cgroup v1's pair of files in dir. 0 = no limit here.
 
int cgroupQuota (const std::string &cgroupRoot, const std::string &procSelfCgroup)
 The tightest CPU quota binding this process, walking from its own cgroup up to the root.
 
template<class Real >
PECLET_HD Real hdSqrt (Real v)
 
template<class Real >
PECLET_HD Real hdAbs (Real v)
 
template<class Real >
PECLET_HD Real hdMax (Real a, Real b)
 
template<class Real >
PECLET_HD Real hdMin (Real a, Real b)
 
template<class Real >
PECLET_HD Real hdPow (Real a, Real b)
 
template<class Real >
PECLET_HD Real hdNearbyint (Real v)
 
template<class Real >
PECLET_HD Real hdFloor (Real v)
 
template<class Real >
PECLET_HD Real hdFma (Real a, Real b, Real c)
 
template<class Real >
PECLET_HD Real cmpMax (Real a, Real b)
 Comparison-based max, <-ordered (ties keep the earlier operand) — std::max semantics, NOT fmax's NaN-swallowing ones.
 

Function Documentation

◆ affinityCpus()

int peclet::core::detail::affinityCpus ( )
inline

CPUs in this process's affinity mask, or 0 if that cannot be determined.

Definition at line 40 of file cpu_budget.hpp.

Referenced by peclet::core::defaultHostThreads(), and peclet::core::usableCpus().

◆ readFirstLine()

std::string peclet::core::detail::readFirstLine ( const std::string &  path)
inline

First whitespace-separated fields of a file, or an empty string if it cannot be read.

Definition at line 51 of file cpu_budget.hpp.

Referenced by quotaFromCfs(), and quotaFromCpuMax().

◆ cgroupPath()

std::string peclet::core::detail::cgroupPath ( const std::string &  procSelfCgroup,
const std::string &  controller 
)
inline

The cgroup path of this process for controller ("" = the v2 unified hierarchy), e.g.

"/user.slice/user-1000.slice/session-3.scope". Empty if absent.

Definition at line 61 of file cpu_budget.hpp.

Referenced by cgroupQuota().

◆ quotaFromCpuMax()

int peclet::core::detail::quotaFromCpuMax ( const std::string &  file)
inline

CPUs allowed by one cgroup-v2 cpu.max file ("max 100000" or "200000 100000"), rounded UP so a fractional budget still gets one thread.

0 = no limit here (or no such file).

Definition at line 86 of file cpu_budget.hpp.

References readFirstLine().

Referenced by cgroupQuota().

◆ quotaFromCfs()

int peclet::core::detail::quotaFromCfs ( const std::string &  dir)
inline

The same for cgroup v1's pair of files in dir. 0 = no limit here.

Definition at line 97 of file cpu_budget.hpp.

References readFirstLine().

Referenced by cgroupQuota().

◆ cgroupQuota()

int peclet::core::detail::cgroupQuota ( const std::string &  cgroupRoot,
const std::string &  procSelfCgroup 
)
inline

The tightest CPU quota binding this process, walking from its own cgroup up to the root.

0 = no quota anywhere. Split out from usableCpus() so a test can point it at a fixture tree.

Definition at line 107 of file cpu_budget.hpp.

References cgroupPath(), quotaFromCfs(), and quotaFromCpuMax().

Referenced by peclet::core::usableCpus().

◆ hdSqrt()

◆ hdAbs()

◆ hdMax()

◆ hdMin()

◆ hdPow()

template<class Real >
PECLET_HD Real peclet::core::detail::hdPow ( Real  a,
Real  b 
)

Definition at line 159 of file portable.hpp.

Referenced by peclet::core::geom::prim::Superquadric< Real >::eval().

◆ hdNearbyint()

template<class Real >
PECLET_HD Real peclet::core::detail::hdNearbyint ( Real  v)

Definition at line 163 of file portable.hpp.

◆ hdFloor()

template<class Real >
PECLET_HD Real peclet::core::detail::hdFloor ( Real  v)

◆ hdFma()

template<class Real >
PECLET_HD Real peclet::core::detail::hdFma ( Real  a,
Real  b,
Real  c 
)

Definition at line 171 of file portable.hpp.

◆ cmpMax()

template<class Real >
PECLET_HD Real peclet::core::detail::cmpMax ( Real  a,
Real  b 
)

Comparison-based max, <-ordered (ties keep the earlier operand) — std::max semantics, NOT fmax's NaN-swallowing ones.

HollowCylinderShell needs exactly this to stay bit-faithful to core's std::max({...}) and voro's chained ternaries; everything ported from dem uses hdMax.

Definition at line 180 of file portable.hpp.

Referenced by peclet::core::geom::prim::HollowCylinderShell< Real >::evalRZ().