#include "system_topology.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdarg.h>#include <unistd.h>Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | BG_GREEN "\033[42m" |
| #define | BG_RED "\033[41m" |
| #define | BG_YELLOW "\033[43m" |
| #define | BLUE "\033[34m" |
| #define | BOLD "\033[1m" |
| #define | C(color) (use_colors ? color : "") |
| #define | CYAN "\033[36m" |
| #define | DIM "\033[2m" |
| #define | GREEN "\033[32m" |
| #define | MAGENTA "\033[35m" |
| #define | RED "\033[31m" |
| #define | RESET "\033[0m" |
| #define | WHITE "\033[37m" |
| #define | YELLOW "\033[33m" |
Functions | |
| static const char * | format_bandwidth (float bw_gbs, char *buf, size_t buf_size) |
| static const char * | format_size (uint64_t size_mb, char *buf, size_t buf_size) |
| int | main (int argc, char *argv[]) |
| static void | print_header (const char *title) |
| static void | print_ok (const char *msg) |
| static void | print_section (const char *title) |
| static void | print_tree_item (int level, int is_last, const char *fmt,...) |
| static void | print_warning (const char *msg) |
| void | topology_print_affinity (const AffinityInfo *aff) |
| void | topology_print_cache (const CacheTopology *cache, int logical_cores) |
| void | topology_print_cpu (const CPUInfo *cpu) |
| void | topology_print_distributed_potential (const SystemTopology *topo) |
| void | topology_print_memory (const MemoryInfo *mem) |
| void | topology_print_network (const NetworkTopology *net) |
| void | topology_print_numa (const NUMATopology *numa, int sockets) |
| void | topology_print_pcie (const PCIeTopology *pcie) |
| void | topology_print_recommendations (const RecommendationList *recs) |
| void | topology_print_summary (const SystemTopology *topo) |
Variables | |
| static int | use_colors = 1 |
| #define _GNU_SOURCE |
Definition at line 8 of file show_config.c.
| #define BG_GREEN "\033[42m" |
Definition at line 33 of file show_config.c.
| #define BG_RED "\033[41m" |
Definition at line 32 of file show_config.c.
| #define BG_YELLOW "\033[43m" |
Definition at line 34 of file show_config.c.
| #define BLUE "\033[34m" |
Definition at line 27 of file show_config.c.
| #define BOLD "\033[1m" |
Definition at line 21 of file show_config.c.
| #define C | ( | color | ) | (use_colors ? color : "") |
Definition at line 39 of file show_config.c.
| #define CYAN "\033[36m" |
Definition at line 29 of file show_config.c.
| #define DIM "\033[2m" |
Definition at line 22 of file show_config.c.
| #define GREEN "\033[32m" |
Definition at line 25 of file show_config.c.
| #define MAGENTA "\033[35m" |
Definition at line 28 of file show_config.c.
| #define RED "\033[31m" |
Definition at line 24 of file show_config.c.
| #define RESET "\033[0m" |
Definition at line 20 of file show_config.c.
| #define WHITE "\033[37m" |
Definition at line 30 of file show_config.c.
| #define YELLOW "\033[33m" |
Definition at line 26 of file show_config.c.
|
static |
Definition at line 56 of file show_config.c.
Referenced by topology_print_distributed_potential(), topology_print_memory(), topology_print_network(), and topology_print_pcie().
|
static |
Definition at line 45 of file show_config.c.
Referenced by topology_print_distributed_potential(), topology_print_memory(), and topology_print_numa().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 680 of file show_config.c.
References topology_discover(), topology_print_summary(), and use_colors.
|
static |
Definition at line 65 of file show_config.c.
References BOLD, C, and RESET.
Referenced by topology_print_summary().
|
static |
Definition at line 95 of file show_config.c.
References C, GREEN, and RESET.
Referenced by topology_print_network(), and topology_print_recommendations().
|
static |
Definition at line 73 of file show_config.c.
References C, CYAN, and RESET.
Referenced by 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(), and topology_print_recommendations().
|
static |
Definition at line 78 of file show_config.c.
Referenced by topology_print_affinity(), topology_print_cache(), topology_print_cpu(), topology_print_distributed_potential(), topology_print_memory(), and topology_print_numa().
|
static |
Definition at line 91 of file show_config.c.
References C, RESET, and YELLOW.
Referenced by topology_print_affinity(), topology_print_cpu(), topology_print_memory(), and topology_print_network().
| 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().
|
static |
Definition at line 37 of file show_config.c.
Referenced by main().