#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | AffinityInfo |
| struct | CacheInfo |
| struct | CacheTopology |
| struct | CPUInfo |
| struct | MemoryInfo |
| struct | MemorySlot |
| struct | NetworkInterface |
| struct | NetworkTopology |
| struct | NUMANode |
| struct | NUMATopology |
| struct | PCIeDevice |
| struct | PCIeTopology |
| struct | Recommendation |
| struct | RecommendationList |
| struct | SystemTopology |
Macros | |
| #define | MAX_CACHE_LEVELS 4 |
| #define | MAX_CPUS 256 |
| #define | MAX_MEMORY_SLOTS 16 |
| #define | MAX_NICS 8 |
| #define | MAX_NUMA_NODES 8 |
| #define | MAX_PCIE_DEVICES 32 |
| #define | MAX_RECOMMENDATIONS 32 |
| #define | MAX_STR_LEN 256 |
Enumerations | |
| enum | RecommendationCategory { REC_CATEGORY_MEMORY , REC_CATEGORY_CPU , REC_CATEGORY_NETWORK , REC_CATEGORY_AFFINITY , REC_CATEGORY_PCIE } |
| enum | RecommendationPriority { REC_PRIORITY_LOW , REC_PRIORITY_MEDIUM , REC_PRIORITY_HIGH , REC_PRIORITY_CRITICAL } |
| #define MAX_CACHE_LEVELS 4 |
Definition at line 24 of file system_topology.h.
| #define MAX_CPUS 256 |
Definition at line 23 of file system_topology.h.
| #define MAX_MEMORY_SLOTS 16 |
Definition at line 27 of file system_topology.h.
| #define MAX_NICS 8 |
Definition at line 25 of file system_topology.h.
| #define MAX_NUMA_NODES 8 |
Definition at line 22 of file system_topology.h.
| #define MAX_PCIE_DEVICES 32 |
Definition at line 26 of file system_topology.h.
| #define MAX_RECOMMENDATIONS 32 |
Definition at line 280 of file system_topology.h.
| #define MAX_STR_LEN 256 |
Definition at line 28 of file system_topology.h.
| Enumerator | |
|---|---|
| REC_CATEGORY_MEMORY | |
| REC_CATEGORY_CPU | |
| REC_CATEGORY_NETWORK | |
| REC_CATEGORY_AFFINITY | |
| REC_CATEGORY_PCIE | |
Definition at line 272 of file system_topology.h.
| Enumerator | |
|---|---|
| REC_PRIORITY_LOW | |
| REC_PRIORITY_MEDIUM | |
| REC_PRIORITY_HIGH | |
| REC_PRIORITY_CRITICAL | |
Definition at line 265 of file system_topology.h.
| int topology_discover | ( | SystemTopology * | topo | ) |
Definition at line 979 of file system_topology.c.
References SystemTopology::affinity, SystemTopology::cache, SystemTopology::cpu, SystemTopology::has_root_access, SystemTopology::hostname, SystemTopology::kernel_version, SystemTopology::memory, SystemTopology::network, SystemTopology::numa, SystemTopology::pcie, topology_discover_affinity(), topology_discover_cache(), topology_discover_cpu(), topology_discover_memory(), topology_discover_network(), topology_discover_numa(), and topology_discover_pcie().
Referenced by main().
| int topology_discover_affinity | ( | AffinityInfo * | aff | ) |
Definition at line 936 of file system_topology.c.
References AffinityInfo::affinity_cpus, AffinityInfo::affinity_set, mask, MAX_CPUS, AffinityInfo::num_affinity_cpus, AffinityInfo::omp_num_threads, AffinityInfo::omp_places, and AffinityInfo::omp_proc_bind.
Referenced by topology_discover().
| int topology_discover_cache | ( | CacheTopology * | cache | ) |
Definition at line 246 of file system_topology.c.
References cache_compare(), count_set_bits(), CacheTopology::l3_total_kb, CacheInfo::level, CacheTopology::levels, CacheInfo::line_size_bytes, MAX_CACHE_LEVELS, CacheTopology::num_levels, read_file_int(), read_file_string(), CacheInfo::shared_by_cores, CacheInfo::size_kb, CacheInfo::type, and CacheInfo::ways_of_associativity.
Referenced by topology_discover().
| int topology_discover_cpu | ( | CPUInfo * | cpu | ) |
Definition at line 112 of file system_topology.c.
References CPUInfo::base_freq_mhz, CPUInfo::cores_per_socket, CPUInfo::family, CPUInfo::has_amx, CPUInfo::has_amx_bf16, CPUInfo::has_amx_int8, CPUInfo::has_amx_tile, CPUInfo::has_avx, CPUInfo::has_avx2, CPUInfo::has_avx512_bf16, CPUInfo::has_avx512bw, CPUInfo::has_avx512f, CPUInfo::has_avx512vl, has_cpu_flag(), CPUInfo::has_sse4_2, CPUInfo::has_vnni, id, CPUInfo::logical_cores, MAX_CPUS, CPUInfo::max_freq_mhz, CPUInfo::model, CPUInfo::model_name, CPUInfo::pcie_generation, CPUInfo::pcie_lanes_total, CPUInfo::physical_cores, read_file_int(), CPUInfo::sockets, CPUInfo::stepping, CPUInfo::threads_per_core, trim_string(), and CPUInfo::vendor.
Referenced by topology_discover().
| int topology_discover_memory | ( | MemoryInfo * | mem | ) |
Definition at line 553 of file system_topology.c.
References MemoryInfo::available_mb, MemoryInfo::bw_test_num_threads, MemoryInfo::bw_test_numa_node, MemoryInfo::cached_mb, MemoryInfo::channel_config, MemoryInfo::channels_populated, MemorySlot::data_width_bits, MemoryInfo::estimated_channels, MemorySlot::locator, MAX_MEMORY_SLOTS, MemoryInfo::measured_bandwidth_gbs, MemoryInfo::memory_speed_mhz, MemoryInfo::memory_type, MemoryInfo::num_channels, MemoryInfo::num_slots, MemorySlot::populated, MemorySlot::rank, run_command(), MemorySlot::size_mb, MemorySlot::slot_number, MemoryInfo::slots, MemoryInfo::slots_populated, MemorySlot::speed_mhz, MemoryInfo::theoretical_bandwidth_gbs, topology_estimate_channels_from_bandwidth(), topology_measure_memory_bandwidth_ex(), MemoryInfo::total_mb, trim_string(), and MemorySlot::type.
Referenced by topology_discover().
| int topology_discover_network | ( | NetworkTopology * | net | ) |
Definition at line 832 of file system_topology.c.
References NetworkTopology::best_interface_idx, NetworkInterface::driver, NetworkInterface::has_link, NetworkTopology::has_rdma, NetworkTopology::interfaces, NetworkInterface::is_infiniband, NetworkInterface::is_up, NetworkInterface::mac_address, NetworkTopology::max_bandwidth_gbs, MAX_NICS, NetworkInterface::mtu, NetworkInterface::name, NetworkTopology::num_interfaces, NetworkInterface::pci_address, read_file_int(), read_file_string(), NetworkInterface::speed_mbps, NetworkInterface::supports_rdma, and NetworkInterface::supports_roce.
Referenced by topology_discover().
| int topology_discover_numa | ( | NUMATopology * | numa | ) |
Definition at line 303 of file system_topology.c.
References NUMANode::cpu_list, NUMATopology::distances, end, MAX_CPUS, MAX_NUMA_NODES, NUMANode::memory_free_mb, NUMANode::memory_total_mb, NUMANode::node_id, NUMATopology::nodes, NUMANode::num_cpus, NUMATopology::num_nodes, read_file_string(), start, and token.
Referenced by topology_discover().
| int topology_discover_pcie | ( | PCIeTopology * | pcie | ) |
Definition at line 730 of file system_topology.c.
References PCIeDevice::bandwidth_gbs, PCIeDevice::bandwidth_max_gbs, PCIeDevice::bus, PCIeDevice::device, PCIeDevice::device_name, PCIeTopology::devices, PCIeDevice::function, PCIeDevice::is_gpu, PCIeDevice::is_nic, PCIeDevice::is_nvme, PCIeDevice::link_speed, PCIeDevice::link_speed_max, PCIeDevice::link_width, PCIeDevice::link_width_max, MAX_PCIE_DEVICES, PCIeTopology::num_devices, pcie_bandwidth_gbs(), run_command(), and PCIeTopology::total_lanes_used.
Referenced by topology_discover().
| float topology_estimate_memory_bandwidth | ( | const MemoryInfo * | mem | ) |
Definition at line 1116 of file system_topology.c.
References MemoryInfo::theoretical_bandwidth_gbs.
| float topology_estimate_network_training_time | ( | const NetworkTopology * | net, |
| uint64_t | model_size_mb | ||
| ) |
Definition at line 1120 of file system_topology.c.
References NetworkTopology::max_bandwidth_gbs.
Referenced by topology_print_distributed_potential().
| int topology_generate_recommendations | ( | const SystemTopology * | topo, |
| RecommendationList * | recs | ||
| ) |
Definition at line 1010 of file system_topology.c.
References Recommendation::action, SystemTopology::affinity, AffinityInfo::affinity_set, Recommendation::category, MemoryInfo::channels_populated, SystemTopology::cpu, Recommendation::description, CPUInfo::has_avx2, NetworkTopology::has_rdma, NetworkTopology::max_bandwidth_gbs, SystemTopology::memory, SystemTopology::network, NetworkTopology::num_interfaces, NUMATopology::num_nodes, RecommendationList::num_recommendations, MemoryInfo::num_slots, SystemTopology::numa, Recommendation::priority, REC_CATEGORY_AFFINITY, REC_CATEGORY_CPU, REC_CATEGORY_MEMORY, REC_CATEGORY_NETWORK, REC_PRIORITY_HIGH, REC_PRIORITY_LOW, REC_PRIORITY_MEDIUM, RecommendationList::recommendations, MemoryInfo::slots_populated, and Recommendation::title.
Referenced by topology_print_summary().
| void topology_print_affinity | ( | const AffinityInfo * | aff | ) |
Definition at line 528 of file show_config.c.
References AffinityInfo::affinity_set, C, CYAN, GREEN, AffinityInfo::omp_num_threads, AffinityInfo::omp_places, AffinityInfo::omp_proc_bind, print_section(), print_tree_item(), print_warning(), RESET, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_cache | ( | const CacheTopology * | cache, |
| int | logical_cores | ||
| ) |
Definition at line 169 of file show_config.c.
References C, DIM, CacheInfo::level, CacheTopology::levels, CacheTopology::num_levels, print_section(), print_tree_item(), RESET, CacheInfo::shared_by_cores, CacheInfo::size_kb, and CacheInfo::type.
Referenced by topology_print_summary().
| void topology_print_cpu | ( | const CPUInfo * | cpu | ) |
Definition at line 103 of file show_config.c.
References CPUInfo::base_freq_mhz, BOLD, C, GREEN, CPUInfo::has_amx, CPUInfo::has_amx_bf16, CPUInfo::has_amx_int8, CPUInfo::has_avx, CPUInfo::has_avx2, CPUInfo::has_avx512_bf16, CPUInfo::has_avx512bw, CPUInfo::has_avx512f, CPUInfo::has_avx512vl, CPUInfo::has_sse4_2, CPUInfo::has_vnni, CPUInfo::logical_cores, CPUInfo::max_freq_mhz, CPUInfo::model_name, CPUInfo::pcie_generation, CPUInfo::pcie_lanes_total, CPUInfo::physical_cores, print_section(), print_tree_item(), print_warning(), RESET, CPUInfo::sockets, CPUInfo::threads_per_core, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_distributed_potential | ( | const SystemTopology * | topo | ) |
Definition at line 584 of file show_config.c.
References C, SystemTopology::cpu, CYAN, format_bandwidth(), format_size(), GREEN, CPUInfo::has_avx2, CPUInfo::has_avx512f, NetworkTopology::max_bandwidth_gbs, SystemTopology::memory, SystemTopology::network, CPUInfo::physical_cores, print_section(), print_tree_item(), RED, RESET, MemoryInfo::theoretical_bandwidth_gbs, topology_estimate_network_training_time(), MemoryInfo::total_mb, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_memory | ( | const MemoryInfo * | mem | ) |
Definition at line 292 of file show_config.c.
References MemoryInfo::available_mb, BOLD, MemoryInfo::bw_test_num_threads, MemoryInfo::bw_test_numa_node, C, MemoryInfo::channel_config, MemoryInfo::channels_populated, CYAN, DIM, format_bandwidth(), format_size(), GREEN, MemorySlot::locator, MemoryInfo::measured_bandwidth_gbs, MemoryInfo::memory_speed_mhz, MemoryInfo::memory_type, MemoryInfo::num_slots, MemorySlot::populated, print_section(), print_tree_item(), print_warning(), RESET, MemorySlot::size_mb, MemoryInfo::slots, MemoryInfo::slots_populated, MemorySlot::speed_mhz, MemoryInfo::theoretical_bandwidth_gbs, MemoryInfo::total_mb, MemorySlot::type, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_network | ( | const NetworkTopology * | net | ) |
Definition at line 458 of file show_config.c.
References BOLD, C, DIM, NetworkInterface::driver, format_bandwidth(), GREEN, NetworkInterface::has_link, NetworkTopology::has_rdma, NetworkTopology::interfaces, NetworkInterface::is_infiniband, NetworkInterface::is_up, MAGENTA, NetworkTopology::max_bandwidth_gbs, NetworkInterface::name, NetworkTopology::num_interfaces, print_ok(), print_section(), print_warning(), RED, RESET, NetworkInterface::speed_mbps, NetworkInterface::supports_rdma, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_numa | ( | const NUMATopology * | numa, |
| int | sockets | ||
| ) |
Definition at line 213 of file show_config.c.
References C, NUMANode::cpu_list, CYAN, DIM, NUMATopology::distances, format_size(), GREEN, NUMANode::memory_total_mb, NUMANode::node_id, NUMATopology::nodes, NUMANode::num_cpus, NUMATopology::num_nodes, print_section(), print_tree_item(), RESET, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_pcie | ( | const PCIeTopology * | pcie | ) |
Definition at line 395 of file show_config.c.
References PCIeDevice::bandwidth_gbs, BOLD, C, CYAN, PCIeDevice::device_name, PCIeTopology::devices, DIM, format_bandwidth(), GREEN, PCIeDevice::is_gpu, PCIeDevice::is_nic, PCIeDevice::is_nvme, PCIeDevice::link_speed, PCIeDevice::link_speed_max, PCIeDevice::link_width, PCIeDevice::link_width_max, MAGENTA, PCIeTopology::num_devices, print_section(), RESET, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_recommendations | ( | const RecommendationList * | recs | ) |
Definition at line 545 of file show_config.c.
References Recommendation::action, C, CYAN, Recommendation::description, GREEN, RecommendationList::num_recommendations, print_ok(), print_section(), Recommendation::priority, REC_PRIORITY_CRITICAL, REC_PRIORITY_HIGH, REC_PRIORITY_LOW, REC_PRIORITY_MEDIUM, RecommendationList::recommendations, RED, RESET, Recommendation::title, and YELLOW.
Referenced by topology_print_summary().
| void topology_print_summary | ( | const SystemTopology * | topo | ) |
Definition at line 649 of file show_config.c.
References SystemTopology::affinity, C, SystemTopology::cache, SystemTopology::cpu, DIM, SystemTopology::has_root_access, SystemTopology::hostname, SystemTopology::kernel_version, CPUInfo::logical_cores, SystemTopology::memory, SystemTopology::network, SystemTopology::numa, SystemTopology::pcie, print_header(), RESET, CPUInfo::sockets, topology_generate_recommendations(), topology_print_affinity(), topology_print_cache(), topology_print_cpu(), topology_print_distributed_potential(), topology_print_memory(), topology_print_network(), topology_print_numa(), topology_print_pcie(), topology_print_recommendations(), and YELLOW.
Referenced by main().