MPI include mpif h include nksize integer myrank

  • Slides: 9
Download presentation

MPIへの対応① -新しく追加- include 'mpif. h' include ‘nk-size’ の下に追加 integer myrank, tnode, error include ‘mpif.

MPIへの対応① -新しく追加- include 'mpif. h' include ‘nk-size’ の下に追加 integer myrank, tnode, error include ‘mpif. h’ の下に追加 call mpi_init(error) call mpi_comm_rank(MPI_COMM_WORLD, myrank, error) call mpi_comm_size(MPI_COMM_WORLD, tnode, error) 変数宣言の下に追加 call mpi_finalize(error) メインプログラムの stop の上に追加

MPIへの対応② -編集- do 20 i=1, nj メイン do ループの開始部分 lb = nj/tnode lc =

MPIへの対応② -編集- do 20 i=1, nj メイン do ループの開始部分 lb = nj/tnode lc = mod(nj, tnode) if(myrank+1. le. lc) then is = myrank*lb+myrank+1 ie = is + lb else is = myrank*lb+lc+1 ie = is + lb - 1 end if 計算回数をプロセス数に分割 doループで計算開始 Fortranソースファイル do 20 i=is, ie

MPI実行時のエラー -2プロセス- 167. 244732086528 T = 27. 9346881484990 3. 14159265358979 do 20 i, nj

MPI実行時のエラー -2プロセス- 167. 244732086528 T = 27. 9346881484990 3. 14159265358979 do 20 i, nj = 1 100 3. 14159265358979 do 20 i, nj = 51 100 back deigch nnv= 0 e(j)<0 , i , j = -1. 94576220049562 D-002 end of do 20 i, nj = 2 100 back deigch nnv= 0 end of do 20 i, nj = 52 100 back deigch nnv= 0 e(j)<0 , i , j = -1. 91680048132009 D-002 end of do 20 i, nj = 3 100 back deigch nnv= 0 end of do 20 1 1548 2 1548

MPI実行時のエラー -4プロセス- 167. 244732086528 T = 27. 9346881484990 3. 14159265358979 do 20 i, nj

MPI実行時のエラー -4プロセス- 167. 244732086528 T = 27. 9346881484990 3. 14159265358979 do 20 i, nj = 1 100 3. 14159265358979 do 20 i, nj = 26 100 3. 14159265358979 do 20 i, nj = 76 100 3. 14159265358979 do 20 i, nj = 51 100 back deigch nnv= 0 e(j)<0 , i , j = -1. 94576220049562 D-002 end of do 20 i, nj = 2 100 1 1548

エラーの比較 FORTRAN 77 での計算結果 mpif 77 での 計算結果 e(j)<0 , i , j =

エラーの比較 FORTRAN 77 での計算結果 mpif 77 での 計算結果 e(j)<0 , i , j = e(j)<0 , i , j = e(j)<0 , i , j = e(j)<0 , i , j = e(j)<0 , i , j = e(j)<0 , i , j = -1. 94576220049562 D-002 -1. 91680048132009 D-002 -1. 82991541008149 D-002 -1. 68510724552458 D-002 -1. 48237641860310 D-002 -1. 22172353223910 D-002 -9. 03149361193790 D-003 -5. 26654851925671 D-003 -9. 22411227420725 D-004 -2. 52867103 E-14 1 1545 -1. 90233719 E-13 1 1546 -3. 9641748 E-13 1 1547 -0. 019457622 1 1548 -0. 0191680048 2 1548 -0. 0182991541 3 1548 -0. 0168510725 4 1548 -0. 0148237642 5 1548 -0. 0122172353 6 1548 -0. 00903149361 7 1548 -0. 00526654852 8 1548 -0. 000922411227 9 1548 1 2 3 4 5 6 7 8 9 1548 1548 1548

プロセス数と計算時間の関係 np h m s 1 2 11 43 2 1 7 15 3

プロセス数と計算時間の関係 np h m s 1 2 11 43 2 1 7 15 3 0 45 4 4 0 33 19 5 0 26 42 6 0 23 33 7 0 19 7 8 0 18 56 9 0 22 45