[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gomp-discuss] Number of CPU's
From: |
Steven Bosscher |
Subject: |
Re: [Gomp-discuss] Number of CPU's |
Date: |
17 Feb 2003 11:05:05 +0100 |
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.
RE: [Gomp-discuss] Number of CPU's, Scott Robert Ladd, 2003/02/17