Results 1 to 5 of 5

Thread: Bug in cpu detection

  1. #1
    Join Date
    Jun 2008
    Posts
    13

    Default Bug in cpu detection

    PTS 1.0.0 incorrectly reports the number of available cpus on one of my test machines. What is strange is that the number of cores is ok.

    I get:
    Processor: 5 x Quad-Core AMD Opteron 8356 @ 2.30GHz (Total Cores: 16)
    While I should have:
    Processor: 4 x Quad-Core AMD Opteron 8356 @ 2.30GHz (Total Cores: 16)

    It looks like PTS is using more than one method for cpu detection and that one of them reports bad data.

  2. #2

    Default

    All the CPU detection is done through /proc/cpuinfo. Can you post the full output of cat /proc/cpuinfo ?

  3. #3
    Join Date
    Jun 2008
    Posts
    13

    Default

    Here is a link to my cpuinfo

    cpuinfo.txt

    It seems that the physical ids are starting from 1 instead of 0. The PTS code in pts-core/functions/pts-functions_system_cpu.php -> processor_string is taking the last physical id + 1.

    I don't know if this kind of setup happens a lot of times, but a fix would be to count the number of unique physical ids. It is probably the safest method.

  4. #4

    Default

    I thought that might have been what the problem was. Check out git to see if it's fixed, or just try:

    Code:
            $physical_cpu_count = count(array_unique($physical_cpu_ids));

  5. #5
    Join Date
    Jun 2008
    Posts
    13

    Default

    it's fixed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •