AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

prtconf and sysconf produce different numbers of processors

  • 1.  prtconf and sysconf produce different numbers of processors

    Posted Mon May 11, 2009 01:24 AM

    Originally posted by: SystemAdmin


    // --- OS ---
    AIX ep5710g 3 5

    // --- Compiler ---
    IBM XL C/C++ Enterprise Edition V8.0 for AIX
    Version: 08.00.0000.0014

    // --- Calling the prtconf command
    > prtconf | grep Processors
    Number Of Processors: 16

    // --- User program foo.cpp ----
    #include <iostream>
    #include <unistd.h>
    #include <sys/systemcfg.h>

    int main()
    {

    //
    // SC_NPROCESSORS_CONF Number of processors configured.
    std::cout << "_SC_NPROCESSORS_CONF\t ="
    << sysconf(_SC_NPROCESSORS_CONF)
    << std::endl;

    //
    // _SC_NPROCESSORS_ONLN Number of processors online
    std::cout << "_SC_NPROCESSORS_ONLN\t ="
    << sysconf(_SC_NPROCESSORS_ONLN)
    << std::endl;

    //
    // ncpus Identifies the number of CPUs active on a machine.
    // Uniprocessor (UP) machines are identified by a 1.
    // Values greater than 1 indicate multiprocessor (MP) machines.
    std::cout << "_system_configuration.ncpus\t ="
    << _system_configuration.ncpus
    << std::endl;
    return 0;
    }
    //
    > xlC_r foo.cpp

    > ./a.out
    _SC_NPROCESSORS_CONF =*32*
    _SC_NPROCESSORS_ONLN =*32*
    _system_configuration.ncpus =*32*
    It seems that number of proceesors produced by prtconf and sysconf() are inconsistent.

    Thanks,

    Alex Vinokur
    #AIX-Forum


  • 2.  Re: prtconf and sysconf produce different numbers of processors

    Posted Mon May 11, 2009 07:27 AM

    Originally posted by: flodstrom


    Although I still find it somewhat confusing with regards to IBM and their definition of processors, CPU's, etc., but the numbers you see are most likely correct. This is due to the fact that SMT most likely is enabled, which in your case means that AIX see's 32 CPU's (2 SMT threads/processor).

    For example, you can check if SMT is enabled with this command:

    lsattr -E -l proc0
    #AIX-Forum