LLVM OpenMP 20.0.0git
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
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 1258 of file kmp_affinity.h.

Member Enumeration Documentation

◆ init_status

Enumerator
initialized 
not_initialized 
initializing 

Definition at line 1277 of file kmp_affinity.h.

Constructor & Destructor Documentation

◆ hierarchy_info()

hierarchy_info::hierarchy_info ( )
inline

Definition at line 1296 of file kmp_affinity.h.

Member Function Documentation

◆ deriveLevels()

void hierarchy_info::deriveLevels ( )
inline

Definition at line 1289 of file kmp_affinity.h.

References __kmp_topology, kmp_topology_t::get_depth(), kmp_topology_t::get_ratio(), i, level, and numPerLevel.

Referenced by init().

◆ fini()

void hierarchy_info::fini ( )
inline

Definition at line 1299 of file kmp_affinity.h.

References __kmp_free, not_initialized, numPerLevel, and uninitialized.

Referenced by __kmp_cleanup_hierarchy().

◆ init()

void hierarchy_info::init ( int  num_addrs)
inline

◆ resize()

void hierarchy_info::resize ( kmp_uint32  nproc)
inline

Member Data Documentation

◆ base_num_threads

kmp_uint32 hierarchy_info::base_num_threads = 0

Definition at line 1276 of file kmp_affinity.h.

Referenced by __kmp_get_hierarchy(), 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 1275 of file kmp_affinity.h.

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

◆ maxLeaves

const kmp_uint32 hierarchy_info::maxLeaves = 4
static

Definition at line 1262 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 1269 of file kmp_affinity.h.

Referenced by init(), and resize().

◆ minBranch

const kmp_uint32 hierarchy_info::minBranch = 4
static

Definition at line 1263 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 1286 of file kmp_affinity.h.

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

◆ resizing

volatile kmp_int8 hierarchy_info::resizing

Definition at line 1280 of file kmp_affinity.h.

Referenced by init(), and resize().

◆ skipPerLevel

kmp_uint32* hierarchy_info::skipPerLevel = nullptr

Definition at line 1287 of file kmp_affinity.h.

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

◆ uninitialized

volatile kmp_int8 hierarchy_info::uninitialized

Definition at line 1278 of file kmp_affinity.h.

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


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