B.4 numCPU.c

     
 

 #  cat numCPU.c  #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <sys/mpctl.h> main(argc,argv) int argc; char *argv[]; {         spu_t new_processor;         printf("Number of locality domains = %d\n", mpctl(MPC_GETNUMLDOMS_SYS,0,0));         printf("Number of processors = %d\n",mpctl(MPC_GETNUMSPUS_SYS,0,0)); } # #  make numCPU  cc -O numCPU.c  -o numCPU (Bundled) cc: warning 480: The -O option is available only with the C/ANSI C product; ignored. /usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (numCPU.o) was detected. The linked output may not run on a PA 1.x system. #  ./numCPU  Number of locality domains = 1 Number of processors = 4 # 



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net