def numa_options(options: Options, numa_node: Option[Int]): Options =
numa_node match { case None => options case Some(node) =>
options.string.update("process_policy", if (numactl_ok(node)) numactl(node) else"")
}
def node_options(options: Options, node: Node_Info): Options = { val threads_options = if (node.rel_cpus.isEmpty) options else options.int.update("threads", node.rel_cpus.length)
node.numa_node match { case None if node.rel_cpus.isEmpty =>
threads_options case Some(numa_node) =>
threads_options.string.update("process_policy", if (numactl_ok(numa_node, node.rel_cpus)) numactl(numa_node, node.rel_cpus) else"") case _ =>
// FIXME threads_options.string.update("process_policy",
// if (taskset_ok(node.rel_cpus)) taskset(node.rel_cpus) else"")
threads_options
}
}
def parse_numa_info(numa_info: String): List[Int] =
numa_info match { case Range(nodes) => nodes case s => error("Cannot parse CPU NUMA node specification: " + quote(s))
}
def numa_nodes(enabled: Boolean = true, ssh: SSH.System = SSH.Local): List[Int] = { val numa_info = if (ssh.isabelle_platform.is_linux) Some(numa_info_linux) else None for {
path <- numa_info.toList if enabled && ssh.is_file(path)
n <- parse_numa_info(ssh.read(path).trim)
} yield n
}
def numa_node0(): Option[Int] = try {
numa_nodes() match { case ns if ns.length >= 2 && numactl_ok(ns.head) => Some(ns.head) case _ => None
}
} catch { case ERROR(_) => None }
object Info { val hostname = SQL.Column.string("hostname").make_primary_key val numa_info = SQL.Column.string("numa_info") val num_cpus = SQL.Column.int("num_cpus") val benchmark_score = SQL.Column.double("benchmark_score")
val table =
make_table(List(hostname, numa_info, num_cpus, benchmark_score), name = "info")
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.