Skip to contents

Identifies the CPU model, logical core count, and total RAM of the machine running the current R process. Each field falls back to NA if it can't be determined.

Usage

host_cpu_info()

Value

A list with elements model (character), n_logical (integer), and ram_bytes (numeric).

Details

Implementation by platform:

  • Linux: reads /proc/cpuinfo (model name) and /proc/meminfo (MemTotal).

  • macOS (Darwin): sysctl -n machdep.cpu.brand_string for the CPU model, sysctl -n hw.memsize for RAM.

  • Windows: PROCESSOR_IDENTIFIER environment variable for the CPU model, wmic ComputerSystem get TotalPhysicalMemory for RAM.

  • Logical core count uses parallel::detectCores() on every platform.

Used by landis_run_docker() and landis_run_local() to append host context to each rep's resource log so downstream provenance tooling can identify what host produced any given replicate's outputs.