SourceForge has been redesigned. Learn more.
Close

#1079 omp_get_num_procs() is not working properly on Windows 2000

component_package
closed-fixed
gcc (462)
2007-09-23
2007-09-08
jmyc
No

Windows 2000
gcc version 4.2.1-sjlj (mingw32-2)
GNU ld version 2.17.50 20060824
gomp and pthread-win32 library

Followng program:

#include <omp.h>
#include <stdio.h>

int main (int argc, char *argv[]) {
int iCPU;
{
iCPU = omp_get_num_procs();
printf("Number of processors: %d\n", iCPU);
printf("There are %d threads\n",nthreads);
getchar();
return 0;
}

raports one processor when used with AMD X2 2000.

When I am compiling programs with several threads both cores are used.

Discussion

  • Danny Smith

    Danny Smith - 2007-09-08

    libgomp with win32-aware get_num_procs

     
  • Danny Smith

    Danny Smith - 2007-09-08

    Logged In: YES
    user_id=11494
    Originator: NO

    Hi,
    The attached contains a patch that I will submit to gcc sortly. Can you confirm that it works for you.
    Danny
    File Added: libgomp.a.gz

     
  • Danny Smith

    Danny Smith - 2007-09-10

    Logged In: YES
    user_id=11494
    Originator: NO

    Fixed on trunk.
    omp_get_num_procs now returns the number of CPUs available to the process
    (not necessarily the same as the number of CPUS in system).

    Danny

     
  • Danny Smith

    Danny Smith - 2007-09-23
    • status: open --> closed-fixed
     

Log in to post a comment.