Commit c1bed7b
committed
--report-bindings on whole machine, plus numa markers
I combined a few related features here:
1. --report-bindings on whole machine
2. mark unallowed (eg cgroup) parts of the whole machine with ~
3. numa markers
4. allow hwloc tree to not have sockets/cores
1. whole machine:
The incoming topology to the pretty-print functions probably didn't use
the WHOLE_SYSTEM flag. In general we don't want WHOLE_SYSTEM, but for
pretty printing I think it makes more sense. So I'm caching a WHOLE_SYSTEM
load of the current machine and using it if the incoming topology also
identifies as the current machine.
Examples of what pretty-printing looks like with/without whole system:
Suppose the machine is
[..../..../..../....][..../..../..../....]
0 4 8 12 16 20 24 28
and we run with
cgset -r cpuset.cpus=24,25,28,29 mycgroup1
cgset -r cpuset.cpus=26,27,30,31 mycgroup2
to leave only these hardware threads active:
mycgroup1: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/..~~/..~~]
mycgroup2: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/~~../~~..]
Without whole-system the printout (for both of the above) would be
(-np 2)
MCW rank 0 bound to socket 1[core 0[hwt 0-1]]: [][BB/..]
MCW rank 1 bound to socket 1[core 1[hwt 0-1]]: [][../BB]
With whole-system the output is this, which I think is more informative
mycgroup1 (-np 2):
MCW rank 0 bound to socket 1[core 6[hwt 0-1]]: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/BB~~/..~~]
MCW rank 1 bound to socket 1[core 7[hwt 0-1]]: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/..~~/BB~~]
mycgroup2 (-np 2):
MCW rank 0 bound to socket 1[core 6[hwt 2-3]]: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/~~BB/~~..]
MCW rank 1 bound to socket 1[core 7[hwt 2-3]]: [~~~~/~~~~/~~~~/~~~~][~~~~/~~~~/~~../~~BB]
2. mark unallowed (~)
When using the whole-machine option there's a bitmask available to identify
the allowed PUs, eg omitting PUs not in our cgroup. To distinguish those
PUs I'm using "~"
3. numa markers (<>)
I like having numa markers as well as the existing separators between
sockets and cores. They're a little harder since the numas are more fluid,
eg sockets always contain cores not vice versa, so you can hard code a loop
over sockets follwed by a loop over cores. But numas might be be above or
below sockets in the tree.
This code identifies which level should be considered the child of the
numas, and has each of the hard coded loops capable of adding numa markers.
Currently I don't have any tunable to turn off the numa markers. A lot of
machines have fairly simple numa output where each socket contains one numa,
and that ends up looking like this:
[<..../..../..../....>][<..../..../..../....>]
If others feel that's too cluttered I'm okay with having some tunable so
people have to ask for numa markers.
4. allow hwloc tree to not have sockets/cores
I may be behind the times on hwloc development, but as far as I know
hwloc trees aren't guaranteed to have sockets and cores, just a MACHINE
at the top and PU at the bottom. So I added a little code to the loops
so it would still print the PUs on a hypothetical machine that lacked any
structuring of the PUs into cores/sockets.
Signed-off-by: Mark Allen <[email protected]>1 parent 7c3aeb3 commit c1bed7b
1 file changed
+228
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1704 | 1704 | | |
1705 | 1705 | | |
1706 | 1706 | | |
| 1707 | + | |
| 1708 | + | |
1707 | 1709 | | |
1708 | 1710 | | |
1709 | 1711 | | |
| |||
1720 | 1722 | | |
1721 | 1723 | | |
1722 | 1724 | | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1723 | 1734 | | |
1724 | 1735 | | |
1725 | 1736 | | |
| |||
1769 | 1780 | | |
1770 | 1781 | | |
1771 | 1782 | | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
1772 | 1870 | | |
1773 | 1871 | | |
1774 | 1872 | | |
1775 | 1873 | | |
| 1874 | + | |
1776 | 1875 | | |
1777 | 1876 | | |
1778 | 1877 | | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
1779 | 1884 | | |
1780 | 1885 | | |
1781 | 1886 | | |
| |||
1787 | 1892 | | |
1788 | 1893 | | |
1789 | 1894 | | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
1790 | 1916 | | |
1791 | 1917 | | |
1792 | 1918 | | |
| |||
1807 | 1933 | | |
1808 | 1934 | | |
1809 | 1935 | | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
1810 | 1947 | | |
| 1948 | + | |
1811 | 1949 | | |
1812 | | - | |
| 1950 | + | |
1813 | 1951 | | |
1814 | | - | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
1815 | 1974 | | |
1816 | 1975 | | |
| 1976 | + | |
1817 | 1977 | | |
1818 | 1978 | | |
1819 | | - | |
| 1979 | + | |
1820 | 1980 | | |
1821 | | - | |
| 1981 | + | |
1822 | 1982 | | |
1823 | | - | |
| 1983 | + | |
1824 | 1984 | | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
1825 | 2002 | | |
1826 | 2003 | | |
1827 | 2004 | | |
1828 | 2005 | | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
1829 | 2012 | | |
1830 | 2013 | | |
1831 | 2014 | | |
1832 | | - | |
| 2015 | + | |
1833 | 2016 | | |
1834 | 2017 | | |
1835 | 2018 | | |
1836 | | - | |
| 2019 | + | |
1837 | 2020 | | |
1838 | 2021 | | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
1839 | 2036 | | |
1840 | 2037 | | |
1841 | 2038 | | |
1842 | 2039 | | |
1843 | | - | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
1844 | 2051 | | |
1845 | 2052 | | |
1846 | 2053 | | |
1847 | | - | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
1848 | 2067 | | |
1849 | 2068 | | |
1850 | 2069 | | |
| |||
0 commit comments