gomp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gomp-discuss] Number of CPU's


From: Lars Segerlund
Subject: Re: [Gomp-discuss] Number of CPU's
Date: Mon, 17 Feb 2003 11:08:52 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9


 Cool, I'm all for it, I thought we might have a problem :-) .

 / Lars

Steven Bosscher wrote:
Op ma 17-02-2003, om 10:58 schreef Steven Bosscher:

Op ma 17-02-2003, om 10:43 schreef Lars Segerlund:

I am fairly sure that POSIX doesn't provide a way to determine the number of physical CPU's in the system, this has to be done in a system dependent manner.

Well, like I said: You can get the number of configured and online CPUs
with:

    long N_CPUs_configured = sysconf (_SC_NPROCESSORS_CONF);
    long N_CPUs_online = sysconf (_SC_NPROCESSORS_ONLN);

This works on Solaris, HPUX and Linux, I'm not sure if it's POSIX but if
it isn't then it's sort-of the de facto standard.



UNICOS and AIX support this, too.



_______________________________________________
Gomp-discuss mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/gomp-discuss






reply via email to

[Prev in Thread] Current Thread [Next in Thread]