Computation Experiment - Automatic Parallelization on Rohan Kris Stewart (with help from Ron Nash, SysAdmin Rohan, SDSU) ------------------------------------------------------------ After a very productive meeting Tuesday 12Nov02 with Ron Nash, SysAdmin of Rohan, I was able to correctly change some of the specific examples from our textbook in Chapter 11: Programming Shared-Memory Multiprocessors, p. 223, to produce experiments that demonstrated the enhanced performance gained from automatic parallelization by the f95 compiler. /bin/time was used at the command line to get user, system and real timings top was used to examine the load on Rohan and verify the number of threads my job "p223" was allocated Notice: 1 CPU requested: real 24.1 user 23.9 sys 0.0 2 CPUs requested: real 12.0 user 23.7 sys 0.1 4 CPUs requested: real 6.4 user 24.8 sys 0.2 ----------------------------------------------------- Script started on Wed Nov 13 07:47:29 2002 rohan.stewart:~/cs575/fall02/diffusion> cat p223.f c High Performance Computing by Dowd and Severance c Chapter 11 - Programming Shared-Memory Multiprocessors c c on Sun Solaris with the f95 compiler flags c xautopar c c along with the request for a listing c c f95 -O3 -autopar -loopinfo -Xlist -o p223 p223.f c c you can see how the compiler recognizes the parallel possibilities in c the following code PARAMETER (NITER=300, N=1000000) REAL*8 A(N), X(N), B(N), C DO ITIME = 1,NITER DO I=1,N A(I) = X(I) + B(I) * C END DO CALL WHATEVER (A,X,B,C,N) ENDDO END SUBROUTINE WHATEVER (A,X,B,C,N) REAL*8 A(N), X(N), B(N), C c c doing "nothing" c RETURN END rohan.stewart:~/cs575/fall02/diffusion> ======================== requesting 1 CPU ========================== rohan.stewart:~/cs575/fall02/diffusion> setenv PARALLEL 1 rohan.stewart:~/cs575/fall02/diffusion> f95 -xautopar -O3 -Xlist -o p223 p223.f rohan.stewart:~/cs575/fall02/diffusion> /bin/time p223& [1] 27446 rohan.stewart:~/cs575/fall02/diffusion> top load averages: 1.67, 0.96, 0.6607:48:47 494 processes: 448 sleeping, 32 zombie, 11 stopped, 3 on cpu CPU states: % idle, % user, % kernel, % iowait, % swap Memory: 8192M real, 5351M free, 1426M swap in use, 22G swap free PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND 26062 masc0461 1 0 10 2848K 2176K cpu/19 2:50 12.45% sim68000 27447 stewart 3 20 0 33M 25M cpu/16 0:01 0.79% p223 27426 masc0324 1 48 0 24M 14M sleep 0:00 0.31% kdeinit 27419 masc0324 1 58 0 29M 20M sleep 0:00 0.20% kdeinit 5661 root 1 0 0 21M 19M sleep 1:45 0.17% mailscanner 27148 malouf 1 58 0 15M 12M sleep 0:01 0.16% xemacs-20.4 27415 masc0324 1 58 0 22M 11M sleep 0:00 0.13% kdeinit 26043 dhou 1 28 10 27M 20M sleep 0:14 0.11% netscape 27410 masc0324 1 58 0 15M 10M sleep 0:00 0.10% ksmserver 20013 stremler 1 58 0 3872K 3056K sleep 24:27 0.09% top 27450 stewart 1 8 0 2656K 1440K cpu/9 0:00 0.08% top 27409 masc0324 1 51 0 4224K 3648K sleep 0:00 0.07% xscreensaver 27440 masc0324 1 58 0 22M 11M sleep 0:00 0.06% alarmd 27389 masc0324 1 58 0 22M 10M sleep 0:00 0.06% kdeinit 27406 masc0324 1 58 0 20M 10M sleep 0:00 0.05% knotify rohan.stewart:~/cs575/fall02/diffusion> real 24.1 user 23.9 sys 0.0 [1] Done /bin/time p223 =========== requesting 2 CPUs ================================== rohan.stewart:~/cs575/fall02/diffusion> setenv PARALLEL 2 rohan.stewart:~/cs575/fall02/diffusion> /bin/time p223 & [1] 27692 rohan.stewart:~/cs575/fall02/diffusion> top load averages: 1.69, 1.12, 0.7307:49:48 495 processes: 450 sleeping, 32 zombie, 11 stopped, 2 on cpu CPU states: % idle, % user, % kernel, % iowait, % swap Memory: 8192M real, 5347M free, 1432M swap in use, 22G swap free PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND 26062 masc0461 1 0 10 2848K 2176K sleep 3:42 9.12% sim68000 27693 stewart 4 30 0 33M 25M cpu/18 0:02 1.38% p223 27474 masc0324 1 2 10 24M 17M sleep 0:03 0.47% netscape 5661 root 1 21 0 21M 19M sleep 1:47 0.25% mailscanner 26043 dhou 1 28 10 27M 20M sleep 0:14 0.10% netscape 20013 stremler 1 48 0 3872K 3056K sleep 24:28 0.09% top 27697 stewart 1 8 0 2656K 1408K cpu/9 0:00 0.07% top 25655 dhou 1 58 0 6136K 2448K sleep 0:03 0.04% sshd 26061 masc0461 1 28 10 0K 0K sleep 0:01 0.03% wish8.3 27696 acabrera 1 28 0 2096K 1656K sleep 0:00 0.03% popper 25635 dhou 1 58 0 3784K 3256K sleep 0:02 0.02% ssh 27577 dfuentes 1 58 0 2464K 2104K sleep 0:00 0.02% popper 27426 masc0324 1 58 0 24M 14M sleep 0:00 0.02% kdeinit 27633 root 1 0 0 3768K 3224K sleep 0:00 0.02% sendmail 24429 nghiem 1 58 0 6456K 5120K sleep 0:01 0.01% pine rohan.stewart:~/cs575/fall02/diffusion> real 12.0 user 23.7 sys 0.1 [1] Done /bin/time p223 ================== requesting 4 cpus =========================== rohan.stewart:~/cs575/fall02/diffusion> setenv PARALLEL 4 rohan.stewart:~/cs575/fall02/diffusion> /bin/time p223& [1] 29743 rohan.stewart:~/cs575/fall02/diffusion> top load averages: 1.75, 1.20, 0.7807:50:30 512 processes: 464 sleeping, 1 running, 33 zombie, 11 stopped, 3 on cpu CPU states: % idle, % user, % kernel, % iowait, % swap Memory: 8192M real, 5329M free, 1455M swap in use, 22G swap free PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND 27474 masc0324 1 10 10 26M 19M sleep 0:14 4.21% netscape 29744 stewart 6 0 0 33M 25M cpu/11 0:04 2.53% p223 27836 nguyenh 1 0 1 0K 0K run 0:04 1.91% touch.tcl 26062 masc0461 1 0 10 2848K 2176K sleep 3:42 0.98% sim68000 26043 dhou 1 0 10 28M 21M sleep 0:15 0.35% netscape 27821 bigstan 1 58 0 7736K 6808K sleep 0:00 0.13% tin 5661 root 1 0 0 21M 19M sleep 1:48 0.13% mailscanner 28266 masc0518 1 28 0 7032K 3712K sleep 0:00 0.09% nep 20013 stremler 1 48 0 3872K 3056K sleep 24:28 0.09% top 25635 dhou 1 48 0 3784K 3256K sleep 0:03 0.09% ssh 25655 dhou 1 48 0 6136K 2448K sleep 0:03 0.08% sshd 29819 stewart 1 18 0 2672K 1448K cpu/18 0:00 0.08% top 27723 root 1 58 0 3784K 2256K sleep 0:00 0.06% sendmail 27719 root 1 38 0 3792K 2256K sleep 0:00 0.05% sendmail 27931 gtang 1 58 0 5584K 3800K sleep 0:00 0.05% pine rohan.stewart:~/cs575/fall02/diffusion> real 6.4 user 24.8 sys 0.2 [1] Done /bin/time p223 rohan.stewart:~/cs575/fall02/diffusion> exit rohan.stewart:~/cs575/fall02/diffusion> script done on Wed Nov 13 07:50:43 2002