CPU Isolation and Execution
To ensure stable real-time performance, use scripts/isolate_cpus.py (or the thin wrapper scripts/isolate_cpus.bash) to constrain system services (system.slice, user.slice, init.scope) away from critical OpenISAC cores.
All setup/run commands require root privileges (sudo):
cd ~/OpenISACchmod +x scripts/isolate_cpus.py scripts/isolate_cpus.bashsudo ./scripts/isolate_cpus.py --helpDefault isolation policy (YAML-driven)
cd build# Ensure BS.yaml / UE.yaml exist (copy from config/ as needed)sudo ../scripts/isolate_cpus.pyThe script first asks which role this machine has:
- BS only — reads
BS.yaml - UE only — reads
UE.yaml - BS + UE — reads both (same-host dual stack)
It then reserves only the most scheduling-sensitive cores from YAML:
- USRP sample TX/RX threads (e.g. BS TX, UE
rx_proc, uplink TX/RX ingest) main_cpu_core- BS monostatic sensing
rx_cpu_core(sample ingest only)
OFDM modulation/demodulation, LDPC, UDP, sensing processing, and workers are not reserved by default so they can share noisier system cores.
Non-interactive / scripted:
sudo ../scripts/isolate_cpus.py --role bssudo ../scripts/isolate_cpus.py --role uesudo ../scripts/isolate_cpus.py --role bothsudo ../scripts/isolate_cpus.py show-plan --role bs # dry-runCustom application CPU set (manual override)
sudo ./scripts/isolate_cpus.py 4 # App uses 0-3sudo ./scripts/isolate_cpus.py 8-15 # App uses 8-15sudo ./scripts/isolate_cpus.py 0,2,4,6 # App uses explicit core listState is saved to /tmp/isolate_cpus_app.conf (reserved cores) and /tmp/isolate_cpus_state.json (full plan).
CPU binding priority when cores are limited
- Reserve one dedicated core for the main thread first.
- Then prioritize the TX/RX real-time threads.
- Then OFDM modulation/demodulation threads.
- Leave LDPC / UDP / sensing-processing on system cores when possible.
Run application (process may use all CPUs)
cd buildsudo ../scripts/isolate_cpus.py run ./BSsudo ../scripts/isolate_cpus.py run ./UErunsets processAllowedCPUsto all logical CPUs (reserved ∪ system).- Critical threads stay on reserved cores via YAML affinity; non-critical threads may schedule on system cores.
- Use
run --app-only ./BSonly if you want the old whole-process reserved-only behavior.
Note: Always launch via
sudo ../scripts/isolate_cpus.py run ...after isolation is set. Direct execution from a restricted user slice may fail to use reserved cores.
Reset configuration (optional)
sudo ./scripts/isolate_cpus.py resetThis removes the isolation settings and restores system slices to all CPUs.