shadow_rs::core

Module cpu

source

Structs§

Functions§

  • Get the core ID from /sys/devices/system/cpu/cpu{cpu}/topology/core_id.
  • Count the number of physical cores available. Uses sched_getaffinity so should take into account CPU affinity and cgroups.
  • Get the CPUs in a node from /sys/devices/system/node/node{node}/cpulist.
  • Get the nodes from /sys/devices/system/node/possible.
  • Get the online CPUs from /sys/devices/system/cpu/online.
  • Take an input of a list of ranges like ‘1-3,5,7-10’ and return an iterator of integers like [1,2,3,5,7,8,9,10].