--- a/src/Pure/System/host.scala Wed Feb 14 15:29:52 2024 +0100
+++ b/src/Pure/System/host.scala Wed Feb 14 16:30:27 2024 +0100
@@ -122,24 +122,12 @@
}
catch { case ERROR(_) => None }
- def num_cpus(ssh: SSH.System = SSH.Local): Int =
- if (ssh.is_local) Runtime.getRuntime.availableProcessors
- else {
- val command =
- if (ssh.isabelle_platform.is_macos) "sysctl -n hw.ncpu" else "nproc"
- val result = ssh.execute(command).check
- Library.trim_line(result.out) match {
- case Value.Int(n) => n
- case _ => 1
- }
- }
-
object Info {
def init(
hostname: String = SSH.LOCAL,
ssh: SSH.System = SSH.Local,
score: Option[Double] = None
- ): Info = Info(hostname, numa_nodes(ssh = ssh), num_cpus(ssh = ssh), score)
+ ): Info = Info(hostname, numa_nodes(ssh = ssh), Multithreading.num_processors(ssh = ssh), score)
}
sealed case class Info(