Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cores detection for multiple single-core CPUs
Systems with multiple physical CPUs where each CPU only has one core doesn't return the same structure as a system with one CPU and multiple cores in that CPU. This fixes that case. The original code expected this structure: 1> erlang:system_info(cpu_topology). [{processor,[{core,[{thread,{logical,0}}, {thread,{logical,1}}]}, {core,[{thread,{logical,2}},{thread,{logical,3}}]}, {core,[{thread,{logical,4}},{thread,{logical,5}}]}, {core,[{thread,{logical,6}},{thread,{logical,7}}]}]}] ...while on some single-core (yet with multiple physical CPUs), the result of the same function looks like: 1> erlang:system_info(cpu_topology). [{processor,{logical,0}},{processor,{logical,1}}]
- Loading branch information