src/Pure/System/host.scala
changeset 77547 1d8a12d1c2e9
parent 77543 97b5547f2b17
child 77548 28b94fe1c00f
--- a/src/Pure/System/host.scala	Mon Mar 06 17:29:00 2023 +0100
+++ b/src/Pure/System/host.scala	Mon Mar 06 18:58:48 2023 +0100
@@ -52,15 +52,14 @@
   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(node: Int): String = if (numactl_ok(node)) numactl(node) else ""
-
-  def process_policy_options(options: Options, numa_node: Option[Int]): Options =
+  def process_policy(options: Options, numa_node: Option[Int]): Options =
     numa_node match {
       case None => options
-      case Some(n) => options.string("process_policy") = process_policy(n)
+      case Some(node) =>
+        options.string("process_policy") = if (numactl_ok(node)) numactl(node) else ""
     }
 
-  def perhaps_process_policy_options(options: Options): Options = {
+  def perhaps_process_policy(options: Options): Options = {
     val numa_node =
       try {
         numa_nodes() match {
@@ -69,7 +68,7 @@
         }
       }
       catch { case ERROR(_) => None }
-    process_policy_options(options, numa_node)
+    process_policy(options, numa_node)
   }