LLVM OpenMP 22.0.0git
hierarchy_info Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/openmp/runtime/src/kmp_affinity.h"

Public Types

enum  init_status { initialized = 0 , not_initialized = 1 , initializing = 2 }

Public Member Functions

void deriveLevels ()
 hierarchy_info ()
void fini ()
void init (int num_addrs)
void resize (kmp_uint32 nproc)

Public Attributes

kmp_uint32 maxLevels
 Number of levels in the hierarchy.
kmp_uint32 depth
 This is specifically the depth of the machine configuration hierarchy, in terms of the number of levels along the longest path from root to any leaf.
kmp_uint32 base_num_threads = 0
volatile kmp_int8 uninitialized
volatile kmp_int8 resizing
kmp_uint32numPerLevel = nullptr
 Level 0 corresponds to leaves.
kmp_uint32skipPerLevel = nullptr

Static Public Attributes

static const kmp_uint32 maxLeaves = 4
static const kmp_uint32 minBranch = 4

Detailed Description

Definition at line 1269 of file kmp_affinity.h.

Member Enumeration Documentation

◆ init_status

Enumerator
initialized 
not_initialized 
initializing 

Definition at line 1288 of file kmp_affinity.h.

Constructor & Destructor Documentation

◆ hierarchy_info()

hierarchy_info::hierarchy_info ( )
inline

Definition at line 1307 of file kmp_affinity.h.

References depth, maxLevels, not_initialized, resizing, and uninitialized.

Member Function Documentation

◆ deriveLevels()

void hierarchy_info::deriveLevels ( )
inline

Definition at line 1300 of file kmp_affinity.h.

References __kmp_topology, i, level, and numPerLevel.

Referenced by init().

◆ fini()

void hierarchy_info::fini ( )
inline

Definition at line 1310 of file kmp_affinity.h.

References __kmp_free, not_initialized, numPerLevel, and uninitialized.

◆ init()

◆ resize()

Member Data Documentation

◆ base_num_threads

kmp_uint32 hierarchy_info::base_num_threads = 0

Definition at line 1287 of file kmp_affinity.h.

Referenced by init(), and resize().

◆ depth

kmp_uint32 hierarchy_info::depth

This is specifically the depth of the machine configuration hierarchy, in terms of the number of levels along the longest path from root to any leaf.

It corresponds to the number of entries in numPerLevel if we exclude all but one trailing 1.

Definition at line 1286 of file kmp_affinity.h.

Referenced by hierarchy_info(), init(), and resize().

◆ maxLeaves

const kmp_uint32 hierarchy_info::maxLeaves = 4
static

Definition at line 1273 of file kmp_affinity.h.

Referenced by init().

◆ maxLevels

kmp_uint32 hierarchy_info::maxLevels

Number of levels in the hierarchy.

Typical levels are threads/core, cores/package or socket, packages/node, nodes/machine, etc. We don't want to get specific with nomenclature. When the machine is oversubscribed we add levels to duplicate the hierarchy, doubling the thread capacity of the hierarchy each time we add a level.

Definition at line 1280 of file kmp_affinity.h.

Referenced by hierarchy_info(), init(), and resize().

◆ minBranch

const kmp_uint32 hierarchy_info::minBranch = 4
static

Definition at line 1274 of file kmp_affinity.h.

Referenced by init().

◆ numPerLevel

kmp_uint32* hierarchy_info::numPerLevel = nullptr

Level 0 corresponds to leaves.

numPerLevel[i] is the number of children the parent of a node at level i has. For example, if we have a machine with 4 packages, 4 cores/package and 2 HT per core, then numPerLevel = {2, 4, 4, 1, 1}. All empty levels are set to 1.

Definition at line 1297 of file kmp_affinity.h.

Referenced by deriveLevels(), fini(), init(), and resize().

◆ resizing

volatile kmp_int8 hierarchy_info::resizing

Definition at line 1291 of file kmp_affinity.h.

Referenced by hierarchy_info(), init(), and resize().

◆ skipPerLevel

kmp_uint32* hierarchy_info::skipPerLevel = nullptr

Definition at line 1298 of file kmp_affinity.h.

Referenced by init(), and resize().

◆ uninitialized

volatile kmp_int8 hierarchy_info::uninitialized

Definition at line 1289 of file kmp_affinity.h.

Referenced by fini(), hierarchy_info(), and init().


The documentation for this class was generated from the following file: