libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
numa_traits.hpp
Go to the documentation of this file.
1 /******************************************************************************
2 **
3 ** Copyright © 2019 by J.M.McGuiness, coder@hussar.me.uk
4 **
5 ** This library is free software; you can redistribute it and/or
6 ** modify it under the terms of the GNU Lesser General Public
7 ** License as published by the Free Software Foundation; either
8 ** version 2.1 of the License, or (at your option) any later version.
9 **
10 ** This library is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ** Lesser General Public License for more details.
14 **
15 ** You should have received a copy of the GNU Lesser General Public
16 ** License along with this library; if not, write to the Free Software
17 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 // Auto-generated header file.
21 // DO NOT EDIT. IT WILL BE OVERWRITTEN.
22 // Version: release_567_1_gd08f7
23 
24 /**
25  \file The contents of this file may not be correct for your system. It may be wise to regenerate it using 'create_numa_traits_hdr.sh NUMA_TRAITS_HPP_FILE VERSION_NUMBER' in the installation location as a suitable user.
26 */
27 
28 #include "core/config.h"
29 
30 #include <array>
31 
32 namespace jmmcg { namespace LIBJMMCG_VER_NAMESPACE { namespace ppd {
33 
34  struct numa_cpu_traits {
35  enum : std::size_t {
36  total_cores=12
37  };
38  enum : bool {
39  is_numa=true
40  };
41  using element_type=std::array<std::array<unsigned short, 6>, 2>;
42  /// This provides a mapping of all sequentially-listed NUMA-nodes to the cores they contain and the mapping of those cores to to that returned by numactl and /proc/cpuinfo.
43  /**
44  So one can use this mapping to pin, set priority, etc physical OS-threads and assign tasks to them as appropriate to make more efficient use of the NUMA topology of the target system.
45  Note that kernel options such as CONFIG_NUMA, CONFIG_NUMA_BALANCING, CONFIG_NUMA_BALANCING_DEFAULT_ENABLED, etc may need to be enabled.
46  */
47  static inline constexpr element_type node_mapping{{{0, 1, 2, 3, 4, 5}, {6, 7, 8, 9, 10, 11}}};
48  };
49 
50 } } }