Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

How to get Number of Processors

chrisquan
Beginner
833 Views
I was told that in Compaq Visual Fortran, the internal function "Number_of_Processors" is always returned to 1 on Windows even for multi-processor machines. Does anybody know if there are the third party software to get around this?
0 Kudos
2 Replies
james1
Beginner
833 Views
Don't know why that intrinsic wouldn't work but it is easy enough to replace:
use kernel32
type (T_SYSTEM_INFO) si
call GetSystemInfo (si)
! number of processors is in si%dwNumberOfProcessors

James
0 Kudos
Steven_L_Intel1
Employee
833 Views
NUMBER_OF_PROCESSORS is an intrinsic that's part of HPF (High-Performance Fortran), a feature provided by Compaq only on Tru64 UNIX. Our implementation is to return a 1 on all platforms other than Tru64 UNIX, as that's the only platform where we support multiprocessing directly in the compiler.

The documentation is misleading about this and we'll fix it. Sure, we could change the intrinsic to ask the OS how many processors are present, but it's really meant to inquire about HPF parallelism capability.

Steve
0 Kudos
Reply