# HG changeset patch # User wenzelm # Date 1678126407 -3600 # Node ID 6339c3a3720b942c9f822633b534f5d818387e01 # Parent 28b94fe1c00fc34ad8b2e094f5a3e8f28dce5522 tuned structure; diff -r 28b94fe1c00f -r 6339c3a3720b src/Pure/System/host.scala --- a/src/Pure/System/host.scala Mon Mar 06 19:09:17 2023 +0100 +++ b/src/Pure/System/host.scala Mon Mar 06 19:13:27 2023 +0100 @@ -12,6 +12,19 @@ object Host { + /* process policy via numactl tool */ + + def numactl(node: Int): String = "numactl -m" + node + " -N" + node + def numactl_ok(node: Int): Boolean = Isabelle_System.bash(numactl(node) + " true").ok + + def process_policy(options: Options, numa_node: Option[Int]): Options = + numa_node match { + case None => options + case Some(node) => + options.string("process_policy") = if (numactl_ok(node)) numactl(node) else "" + } + + /* allocated resources */ object Node_Info { def none: Node_Info = Node_Info("", None) } @@ -57,19 +70,6 @@ - /* process policy via numactl tool */ - - def numactl(node: Int): String = "numactl -m" + node + " -N" + node - def numactl_ok(node: Int): Boolean = Isabelle_System.bash(numactl(node) + " true").ok - - def process_policy(options: Options, numa_node: Option[Int]): Options = - numa_node match { - case None => options - case Some(node) => - options.string("process_policy") = if (numactl_ok(node)) numactl(node) else "" - } - - /* shuffling of NUMA nodes */ def numa_check(progress: Progress, enabled: Boolean): Boolean = {