Class Locality

Class Documentation

class Locality

A Locality of the system.

The Locality abstraction represents a block of the computing system that contains memory and processors. The abstraction can serve to model different systems with different granularity. For example on a cluster, the concept can be used to model a node of the cluster or a NUMA domain.

Typical Usage:

shad::rt::Locality & thisLocality = shad::rt::thisLocality();
if (thisLocality == Locality(0)) {
...
} else {
...
}

Public Functions

Locality()

Constructor.

Initialize the newly created object to a Locality::kNullLocality.

constexpr Locality(const uint32_t id)

Constructor.

Initialize the newly created object with a specific locality ID.

Parameters
  • id: The locality ID to be assigned.

Locality(const Locality &rhs)

Copy-Constructor.

Locality &operator=(const Locality &rhs)

Copy-Assigment.

Locality(Locality &&rhs)

Move-Constructor.

Locality &operator=(Locality &&rhs)

Move-Assignment.

operator uint32_t() const

Explicit conversion to uint32_t.

bool IsNull() const

Null Test.

Return
true if the Handle is null, false otherwise.

Locality &operator++()
Locality &operator--()
Locality &operator+=(std::size_t n)
Locality &operator-=(std::size_t n)
Locality operator-(std::size_t n)
Locality operator+(std::size_t n)
bool operator!=(const Locality &lhs, const Locality &rhs)

Operator not equal.

Return
true when lhs and rhs are not equal.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

bool operator>(const Locality &lhs, const Locality &rhs)

Operator greater than.

Return
true when the lhs ID is greater than the rhs ID.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

bool operator<=(const Locality &lhs, const Locality &rhs)

Operator less than or equal.

Return
true when the lhs ID is less than or equal to the rhs ID.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

bool operator>=(const Locality &lhs, const Locality &rhs)

Operator greater than or equal.

Return
true when the lhs ID is greater than or equal to the rhs ID.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

Friends

bool operator<(const Locality &lhs, const Locality &rhs)

Operator less than.

Return
true when lhs is less than rhs.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

bool operator==(const Locality &lhs, const Locality &rhs)

Operator equal.

Return
true when lhs and rhs are equal.
Parameters
  • lhs: The left-hand side of the operator.
  • rhs: The right-hand side of the operator.

std::ostream &operator<<(std::ostream &os, const Locality &rhs)

Stream insertion operator.

Return
A reference to the output stream used.
Parameters
  • os: The output stream to be used.
  • rhs: The right-hand side of the operator.