Skip to content

Commit bff0f24

Browse files
claudeChrisRackauckas
authored andcommitted
Fix Hwloc CPU core detection returning 0 in CI environments
Apply the same fix from ModelingToolkit.jl (d7f7ed0) to handle cases where Hwloc.num_physical_cores() and Hwloc.num_virtual_cores() return 0 in certain CI environments. This prevents the "input string is empty" parse error by ensuring we always have at least 1 core. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4c46de0 commit bff0f24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ const RETESTITEMS_NWORKERS = if GROUP == "wrappers"
2323
else
2424
parse(
2525
Int, get(ENV, "RETESTITEMS_NWORKERS",
26-
string(min(ifelse(Sys.iswindows(), 0, Hwloc.num_physical_cores()), 4))
26+
string(min(ifelse(Sys.iswindows(), 0, max(Hwloc.num_physical_cores(), 1)), 4))
2727
)
2828
)
2929
end
3030
const RETESTITEMS_NWORKER_THREADS = parse(Int,
3131
get(
3232
ENV, "RETESTITEMS_NWORKER_THREADS",
33-
string(max(Hwloc.num_virtual_cores() ÷ max(RETESTITEMS_NWORKERS, 1), 1))
33+
string(max(max(Hwloc.num_virtual_cores(), 1) ÷ max(RETESTITEMS_NWORKERS, 1), 1))
3434
)
3535
)
3636

0 commit comments

Comments
 (0)