2 /83

Size: px
Start display at page:

Download "2 /83"

Transcription

1 1 /83

2 2 /83

3 3 /83,

4 4 /83 ( ) myrank ), FX10, Blue Gene, Anton : MPI. : ( ).

5 MPICH, OpenMPI ( ) MPI 1 MPI NIC memory CPU 0 (myrank=0) 5 nprocs=2 /83 NIC memory CPU 1 (myrank=1)

6 6 /83 hello_mpi.f: include mpif.h MPI, CALL MPI_INIT(ierr) MPI CALL MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr) CALL MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr) WRITE(*,*) Hello, myrank (nprocs) (myrank) 0 CALL MPI_FINALIZE(ierr) MPI STOP END > mpirun np 4./a.out > mpif90 hello_mpi.f Hello 0 Hello 1 Hello 2 Hello 3

7 7 /83 call MPI_SENDRECV ( sendbuf,scount,stype,dest,stag, recvbuf,rcount,rtype,source,rtag,comm,status,ierr) mpi_send + mpi_recv sendbuf : scount : stype : dest : (rank) stag : recvbuf : rcount : rtype : source : rtag : comm : status : ierr : dest=1 source=3 rank0 rank1 rank2 rank3 s 3 d 1 dest=2 source=0 s 0 d 2 dest=3 source=1 s 1 d 3 myrank dest=0 source=2 s 2 d 0 comm.. destination : source : myrank, call mpi_sendrecv() rank.

8 8 /83 2 +x rank12 rank13 rank14 rank15 s d rank8 rank9 rank10 rank11 s 11 d 9 s 12 s 8 d 14 d 10 s 13 s 9 d 15 d 11 s 14 s 10 d 12 d 8 y rank4 rank5 rank6 rank7 s d s d s d s d myrank x rank0 rank1 rank2 rank3 s 3 d 1 s 0 d 2 s 1 d 3 s 2 d 0

9 9 /83 2 +y rank12 rank13 rank14 rank15 d0 s8 d1 s9 d2 s10 d3 s11 rank8 rank9 rank10 rank11 d12 d13 d14 d15 s4 s5 s6 s7 rank4 rank5 rank6 rank7 y d8 s0 d9 s1 d10 s2 d11 s3 x rank0 rank1 rank2 rank3 d4 d5 d6 d7 s12 s13 s14 s15

10 10 /83 (1 / ) M2L +4-5 myrank +4 M2M y -5 x M2M, M2L ( )

11 MPI 並列化技術①: 通信衝突の回避 CMSI配信講義B 第15回 11/83 例) 多極子の通信 (1スーパーセル/プロセス) 古い通信コード コーディングイメージ iy=+4, ix=-5~+4 do iy=-5,+4 do ix=-5,+4 ip_dest =送信先プロセス番号 ip_src =受信元プロセス番号 IF( (ix, iy) が白抜き部分 ) cycle call mpi_sendrecv(..,ip_dest,..,ip_src,..) iy=-2, ix=-5~+4 iy=-5, ix=-5~+4 y x M2M, M2L演算に必要な データ範囲 (白抜き部分は除く) このままだと(103-53)+(23-1) =882 回の プロセス間通信 [3次元]

12 12 /83 (1 / ) myrank 8 6 do iy=-5,+4 do ix=-5,+4 ip_dest = ip_src = IF( (ix, iy) ) cycle call mpi_sendrecv(..,ip_dest,..,ip_src,..) : ( )+(2 3-1) =882 (1) 882

13 13 /83 (1 / ) other rank myrank 8 6 do iy=-5,+4 do ix=-5,+4 ip_dest = ip_src = IF( (ix, iy) ) cycle call mpi_sendrecv(..,ip_dest,..,ip_src,..) : ( )+(2 3-1) =882 (1) 882 (2) =

14 14 /83 (1 / ) other rank myrank 8 1) ± x (1) 882 (2)

15 15 /83 (1 / ) other rank myrank 8 2) ± y (1) 882 (2)

16 16 /83 (1 / ) other rank myrank 8 9+9= (1) 882 (2) (1) (2)

17 17 /83 x ipx_dest = (-x) ipx_src = (-x) do ix= -1, -4, -1 call mpi_sendrecv(..,ipx_dest,..,ipx_src,..) +x ix=-1 myrank ) call mpi_sendrecv(), myrank -x +x ix=-2 : (-x) ix=-3 ix=-4

18 18 /83 x ipx_dest = (-x) ipx_src = (-x) do ix= -1, -4, -1 call mpi_sendrecv(..,ipx_dest,..,ipx_src,..) +x ix=-1 myrank ipx_dest = (+x) ipx_src = (+x) do ix= +1, +5, +1 call mpi_sendrecv(..,ipx_dest,..,ipx_src,..) ix=+1 ix=+2 +x : (+x) ix=-2 : (-x) ix=+3 ix=-3 ix=+4 ix=-4 ix=+5

19 19 /83 y ipy_dest = (-y) ipy_src = (-y) do iy= -1, -4, -1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) +y iy=-1 iy=-2 myrank +x : (-y)

20 20 /83 y ipy_dest = (-y) ipy_src = (-y) do iy= -1, -4, -1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) +y iy=-3 iy=-4 +x

21 +x : (+y) 21 /83 y +y ipy_dest = (-y) ipy_src = (-y) do iy= -1, -4, -1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) ipy_dest = (+y) ipy_src = (+y) do iy= +1, +5, +1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) iy=+1

22 +x : (+y) 22 /83 +y y iy=+2 ipy_dest = (+y) ipy_src = (+y) do iy= +1, +5, +1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) iy=+3

23 +y y iy=+4 23 /83 iy=+5 +x : (+y)

24 24 /83 ipx_dest = (-x) ipx_src = (-x) do ix= -1, -4, -1 call mpi_sendrecv(..,ipx_dest,..,ipx_src,..) ipx_dest = (+x) ipx_src = (+x) do ix= +1, +5, +1 call mpi_sendrecv(..,ipx_dest,..,ipx_src,..) ipy_dest = (-y) ipy_src = (-y) do iy=-1, -4, -1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) -x +x -y myrank 9+9=18 27 ipy_dest = (+y) ipy_src = (+y) do iy=+1, +5, +1 call mpi_sendrecv(..,ipy_dest,..,ipy_src,..) z -z +z +y

25 25 /83 wk_x meta_x trans_x meta_x wk_x meta_x

26 26 /83 -x [ ] ipx_mdest = (-x) ipx_msrc = (-x) do ix=-1,-2,-1 c icbufm( ) = na_per_cell( 3, 3 ) call mpi_sendrecv(icbufm,...,ipx_mdest,..., ircbufm,..., ipx_msrc,...) na_per_cell( 4, 3 )=ircbufm( ) tag(4,3) c buffm( ) = meta_x( ) call mpi_sendrecv(buffm,..,ipx_mdest,.., rbuffm,...,ipx_msrc,..) meta_x( ) = rbuffm( ) Y ix=-1 myrank (3,3) (4,3) meta_x(n) ) myrank -x +x na1cell : (-x) meta_x(1) X

27 27 /83 -x [ ] ipx_mdest = (-x) ipx_msrc = (-x) do ix=-1,-2,-1 c icbufm( ) = na_per_cell( 4, 3 ) call mpi_sendrecv(icbufm,...,ipx_mdest,..., ircbufm,..., ipx_msrc,...) na_per_cell( 5, 3 )=ircbufm( ) tag(5,3) c buffm( ) = meta_x( ) call mpi_sendrecv(buffm,..,ipx_mdest,.., rbuffm,...,ipx_msrc,..) meta_x( ) = rbuffm( ) Y ix=-2 myrank (4,3) (5,3) meta_x(n) ) myrank -x +x na1cell : (-x) meta_x(1) X

28 28 /83 +x [ ] ipx_pdest = (+x) ipx_psrc = (+x) do ix=+1,+2,+1 c icbufp( ) = na_per_cell( 3, 3 ) call mpi_sendrecv(icbufp,...,ipx_pdest,..., ircbufp,..., ipx_psrc,...) na_per_cell( 2, 3 )=ircbufp( ) tag(2,3) c buffp( ) = meta_x( ) call mpi_sendrecv(buffp,..,ipx_pdest,.., rbuffp,...,ipx_psrc,..) meta_x( ) = rbuffp( ) Y ix=+1 myrank (2,3) (3,3) meta_x(n) ) myrank +x x na1cell : (+x) meta_x(1) X

29 29 /83 +x [ ] ipx_pdest = (+x) ipx_psrc = (+x) do ix=+1,+2,+1 c icbufp( ) = na_per_cell( 2, 3 ) call mpi_sendrecv(icbufp,...,ipx_pdest,..., ircbufp,..., ipx_psrc,...) na_per_cell( 1, 3 )=ircbufp( ) tag(1,3) c buffp( ) = meta_x( ) call mpi_sendrecv(buffp,..,ipx_pdest,.., rbuffp,...,ipx_psrc,..) meta_x( ) = rbuffp( ) Y ix=+2 (1,3) (2,3) myrank meta_x(n) ) myrank +x x na1cell : (+x) meta_x(1) X

30 30 /83 -y [ ] ipy_mdest = (-y) ipy_msrc = (-y) do iy=-1,-2,-1 c Y iy=-1 meta_x(n) call mpi_sendrecv(na_per_cell(1,3),5,...,ipy_mdest,..., na_per_cell(1,4),5,..., ipy_msrc,...) tag(1:5,4) c call mpi_sendrecv(meta_x( ),naline,..,ipy_mdest,.., meta_x( ),naline,...,ipy_msrc,..) (1,4) (1,3) (3,3) ) myrank -y +y na1cell naline=5*na1cell meta_x(1) : (-y) X

31 31 /83 -y [ ] ipy_mdest = (-y) ipy_msrc = (-y) do iy=-1,-2,-1 c Y iy=-2 (1,5) meta_x(n) call mpi_sendrecv(na_per_cell(1,4),5,...,ipy_mdest,..., na_per_cell(1,5),5,..., ipy_msrc,...) tag(1:5,5) c call mpi_sendrecv(meta_x( ),naline,..,ipy_mdest,.., meta_x( ),naline,...,ipy_msrc,..) (1,4) (3,3) ) myrank -y +y naline=5*na1cell meta_x(1) : (-y) X

32 32 /83 +y [ ] ipy_pdest = (+y) ipy_psrc = (+y) do iy=+1,+2,+1 c Y iy=+1 meta_x(n) call mpi_sendrecv(na_per_cell(1,3),5,...,ipy_pdest,..., na_per_cell(1,2),5,..., ipy_psrc,...) tag(1:5,2) c call mpi_sendrecv(meta_x( ),naline,..,ipy_pdest,.., meta_x( ),naline,...,ipy_psrc,..) (1,3) (3,3) (1,2) ) myrank +y -y naline=5*na1cell meta_x(1) : (+y) X

33 33 /83 +y [ ] ipy_pdest = (+y) ipy_psrc = (+y) do iy=+1,+2,+1 c Y iy=+2 meta_x(n) call mpi_sendrecv(na_per_cell(1,2),5,...,ipy_pdest,..., na_per_cell(1,1),5,..., ipy_psrc,...) tag(1:5,1) c call mpi_sendrecv(meta_x( ),naline,..,ipy_pdest,.., meta_x( ),naline,...,ipy_psrc,..) (3,3) (1,2) ) myrank +y -y (1,1) meta_x(1) naline=5*na1cell X : (+y)

34 34 /83 ipz_mdest = (-z) ipz_msrc = (-z) do iz=-1,-2,-1 c -z call mpi_sendrecv(na_per_cell( ),25,...,ipz_mdest,..., na_per_cell( ),25,..., ipz_msrc,...) tag c call mpi_sendrecv(meta_x( ),narea,..,ipz_mdest,.., meta_x( ),narea,...,ipz_msrc,..) z [ ] (1,5,5) (5,5,5) (1,1,5) (5,1,5) (1,5,4) (5,5,4) (1,1,4) (5,1,4) (1,5,3) (5,5,3) myrank (1,1,3) (1,5,2) (5,1,3) (5,5,2) ) myrank -z +z (1,1,2) narea=25*na1cell (1,5,1) (5,1,2) (5,5,1) (1,1,1) (5,1,1) x

35 35 /83 ipz_mdest = (-z) ipz_msrc = (-z) do iz=-1,-2,-1 c call mpi_sendrecv(na_per_cell(1,1,3),25,...,ipz_mdest,..., na_per_cell(1,1,4),25,..., ipz_msrc,...) tag(1:5,1:5,4) c -z call mpi_sendrecv(meta_x( ),narea,..,ipz_mdest,.., meta_x( ),narea,...,ipz_msrc,..) z [ ] (1,5,5) (5,5,5) (1,1,5) (5,1,5) (1,5,4) (5,5,4) (1,1,4) (5,1,4) (1,5,3) (5,5,3) iz=-1 (1,1,3) (1,5,2) (5,1,3) (5,5,2) : (-z) ) myrank -z +z (1,1,2) narea=25*na1cell (1,5,1) (5,1,2) (5,5,1) (1,1,1) (5,1,1) x

36 36 /83 ipz_mdest = (-z) ipz_msrc = (-z) do iz=-1,-2,-1 c call mpi_sendrecv(na_per_cell(1,1,4),25,...,ipz_mdest,..., na_per_cell(1,1,5),25,..., ipz_msrc,...) tag(1:5,1:5,5) c -z call mpi_sendrecv(meta_x( ),narea,..,ipz_mdest,.., meta_x( ),narea,...,ipz_msrc,..) z [ ] (1,5,5) (1,1,5) (1,5,4) (1,1,4) (5,5,5) (5,1,5) (5,5,4) (5,1,4) : (-z) (1,5,3) (5,5,3) iz=-2 (1,1,3) (1,5,2) (5,1,3) (5,5,2) ) myrank -z +z (1,1,2) narea=25*na1cell (1,5,1) (5,1,2) (5,5,1) (1,1,1) (5,1,1) x

37 37 /83 ipz_mdest = (-z) ipz_msrc = (-z) do iz=-1,-2,-1 c call mpi_sendrecv(na_per_cell(1,1,3),25,...,ipz_mdest,..., na_per_cell(1,1,2),25,..., ipz_msrc,...) tag(1:5,1:5,2) c -z call mpi_sendrecv(meta_x( ),narea,..,ipz_mdest,.., meta_x( ),narea,...,ipz_msrc,..) z [ ] (1,5,5) (5,5,5) (1,1,5) (5,1,5) (1,5,4) (5,5,4) (1,1,4) (5,1,4) (1,5,3) (5,5,3) iz=+1 (1,1,3) (1,5,2) (5,1,3) (5,5,2) : (+z) ) myrank +z -z (1,1,2) narea=25*na1cell (1,5,1) (5,1,2) (5,5,1) (1,1,1) (5,1,1) x

38 38 /83 ipz_mdest = (-z) ipz_msrc = (-z) do iz=-1,-2,-1 c call mpi_sendrecv(na_per_cell(1,1,2),25,...,ipz_mdest,..., na_per_cell(1,1,1),25,..., ipz_msrc,...) tag(1:5,1:5,2) c -z call mpi_sendrecv(meta_x( ),narea,..,ipz_mdest,.., meta_x( ),narea,...,ipz_msrc,..) z [ ] (1,5,5) (5,5,5) (1,1,5) (5,1,5) (1,5,4) (5,5,4) (1,1,4) (5,1,4) (1,5,3) (5,5,3) iz=+2 (1,1,3) (1,5,2) (5,1,3) (5,5,2) ) myrank +z -z (1,1,2) narea=25*na1cell (1,5,1) (5,1,2) (5,5,1) : (+z) (1,1,1) (5,1,1) x

39 39 /83. myrank 2 n (n 0) myrank narea=36*na1cell narea=96*na1cell myrank myrank naline=6*na1cell naline=12*na1cell allocate( tag(1:6,1:6) ) allocate( na_per_cell(1:6,1:6) ) allocate( tag(1:12,1:8) ) allocate( na_per_cell(1:12,1:8) ) ), z y x. comm_3.f, comm_fmm.f

40 40 /83 (1):,. (2):,.. ( )

41 41 /83 [ (2)] [ (1),(2)] FMM M2M/L2L [ (1)]

42 42 /83 i dihedral j K! "# 1+ cos(n!(r i, r j, r k, r l )!") $ % k l n=1 i n=2 j n=3 k l j i n=5 k do n=1,ndihedrals phi=phi(ri, rj, rk, rl) Fi, Fj, Fk, Fl f(i)=f(i)+fi f(j)=f(j)+fj f(k)=f(k)+fk f(l)=f(l)+fl n=4 l n=6

43 43 /83 i dihedral j K! "# 1+ cos(n!(r i, r j, r k, r l )!") $ % k l myrank (rank=0) n=1 i n=2 j n=3 k rank=1 rank=1 Fk, Fl l do n=1,ndihedrals(myrank) phi=phi(ri, rj, rk, rl) Fi, Fj, Fk, Fl MPI IF(ri in myrank) f(i)=f(i)+fi, ELSE Fi IF(rj in myrank) f(j)=f(j)+fj, ELSE Fj IF(rk in myrank) f(k)=f(k)+fk, ELSE Fk IF(rl in myrank) f(l)=f(l)+fl, ELSE Fl ELSE, rank=3 Fj rank=3 rank=1 Fl rank=4 Fi rank=4

44 44 /83 i dihedral j K! "# 1+ cos(n!(r i, r j, r k, r l )!") $ % k l i0=2 i0=1 myrank i i0=3 i0=5 i0 : myrank j i0=6 k rank=1 l MPI i0=4 i0=7 do i0=1,natom(myrank) dihedral i0 phi=phi(ri, rj, rk, rl) Fi f(i)=f(i)+fi 4. i0 OpenMP, SIMD md_charmm_f90.f rank=3 rank=4

45 45 /83 F ij =!F ji ) Lennard-Jones, Coulomb do icell(myrank) do jcell_list(myrank or otherranks) do i=na_per_cell(icell) do j=na_per_cell(jcell) rij=rij(ri, rj) Fij f(i)=f(i)+fij IF(rj in myrank) f(j)=f(j)-fij ELSE storef(j)=storef(j)-fij! j! i! jcell! icell storef(j) IF, DO Fij myrank icell jcell other ranks

46 46 /83 F ij =!F ji ) Lennard-Jones, Coulomb do icell(myrank) do jcell_list(myrank or otherranks) do i=na_per_cell(icell) do j=na_per_cell(jcell) rij=rij(ri, rj) Fij f(i)=f(i)+fij i ; ; ; 2. OpenMP, SIMD = myrank icell jcell other ranks ( )

47 47 /83 FMM M2M myrank 2 M2M (L1 L2) M2M 1 M2M (L0 L1) myrank M2M

48 48 /83 FMM M2M other ranks myrank 2 M2M (L1 L2) M2M 1 M2M (L0 L1) myrank M2M

49 49 /83 FMM M2M : 6+ 1 mpi_bcast 2 M2M (L1 L2) M2M 1 M2M (L0 L1) mpi_gather myrank M2M

50 50 /83 FMM M2M : M2M (L1 L2) 1 mpi_sendrecv M2M (L0 L1) myrank M2M

51 51 /83 FMM L2L FMM-ewald myrank 2 L2L (L2 L1) L2L 1 L2L (L1 L0) L2L

52 52 /83 FMM L2L mpi_bcast : 3+ 9 FMM-ewald other ranks 2 L2L (L2 L1) 1 L2L (L1 L0)

53 53 /83 FMM L2L ) wm M2M : FMM-ewald FMM-ewald FMM-ewald FMM-ewald 2 L2L (L2 L1) 1 L2L (L1 L0)

54 54 /83 IF

55 55 /83 ) 16GB ) 6MB Main memory 100 L2 cache 10 ) 32KB ) 128GFLOPS L1 cache CPU 1 (1) (2)

56 56 /83 wk_x(n) r cut other ranks i j wk_x(1)

57 57 /83 meta_x: X-Y (= ) meta_x(n) Y (1,5) (2,5) (3,5) (4,5) (5,5) (1,4) (2,4) (3,4) (4,4) (5,4) (1,3) (2,3) (3,3) (4,3) (5,3) (1,2) (2,2) (3,2) (4,2) (5,2) (1,1) (2,1) (3,1) (4,1) (5,1) meta_x(1) X 1) 2)

58 データの連続化 [1] 座標 CMSI配信講義B 第15回 58 /83 メタデータ配列 前回説明 meta_x: X-Y 平面上での原子の相対位置関係 (= メタデータ ) を保持 Y meta_x(n) (1,5) (2,5) (3,5) (4,5) (5,5) (1,4) (2,4) (3,4) (4,4) (5,4) (1,3) (2,3) (3,3) (4,3) (5,3) 帯単位での j 原子座標への連続アクセス 原子 j 原子 i (1,2) (2,2) (3,2) (4,2) (5,2) (1,1) (2,1) (3,1) (4,1) (5,1) meta_x(1) X 1) 自プロセスを中心にデータを局所化 2) 袖部に直にデータ装填

59 59 /83 M2L myrank M2M 1) 2)

60 60 /83 M2L myrank M2M 1) 2)

61 61 /83 do icell(myrank) do jcell do iatm=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatm=tag(jcell), tag(jcell)+na_per_cell(jcell)-1 icell jcell myrank

62 62 /83 do icell(myrank) do jcell do iatm=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatm=tag(jcell), tag(jcell)+na_per_cell(jcell)-1 Main memory 100 L2 cache 10 L1 cache 1 CPU jcell icell icell jcell myrank (1) icell icell (2) jcell., SIMD

63 63 /83 do jcell_line do icell(myrank) [along icell_line] do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1 Main memory 100 L2 cache 10 L1 cache 1 CPU tag(jcell) icell_line tag(jcell+4)+ na_per_cell(jcell+4) myrank jcell_line (1) jcell_line 1.. (2) jcell_line,. SIMD

64 DO jcell_line 64 /83 icell icell=jcell IF 3 md_direct_f90.f

65 65 /83 do icell(myrank) do icy=1,10 do icx=1,10 if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif wm_local((nmax+1) 2,10,10) M2L myrank icell

66 66 /83 do icell(myrank) do icy=1,10 do icx=1,10 if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif wm_local((nmax+1) 2,10,10) M2L myrank icell

67 67 /83 do icell(myrank) do icy=1,10 do icx=1,10 if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif wm_local((nmax+1) 2,10,10) icell myrank icell wm_local, m2l..

68 68 /83 do iblk=1,nblock do icy=icyblkst(iblk),icyblkend(iblk) do icx=icxblkst(iblk),icxblkend(iblk) do icell(myrank) if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif iblk=1 icxblkst(1) M2L iblk=1 iblk=3 icxblkend(1) myrank iblk=2 iblk=4 icyblkend(1) icyblkst(1) iblk wm_local, m2l icell 1..

69 69 /83 do iblk=1,nblock do icy=icyblkst(iblk),icyblkend(iblk) do icx=icxblkst(iblk),icxblkend(iblk) do icell(myrank) if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif iblk=2 icxblkst(2) iblk=1 iblk=3 myrank icxblkend(2) M2L iblk=2 iblk=4 icyblkend(2) icyblkst(2) iblk wm_local, m2l icell 1..

70 70 /83 NIC 2 (ifort, pgf90, frtpx) 2 0!$omp (Fortran) #pragma omp (C ) ( ) [do/for ] OpenMP memory core core CPU core core OpenMP, SIMD

71 71 /83 hello_omp.f: include omp_lib.h nomp = omp_get_max_threads() OpenMP, (nomp) OMP_NUM_THREADS!$omp parallel iam = omp_get_thread_num()!$omp do Do i=1,nomp WRITE(*,*) Hello, iam Enddo!$omp end do!$omp end parallel STOP END > ifort -openmp hello_omp.f (iam) 0 > export OMP_NUM_THREADS=4 >./a.out Hello 0 Hello 1 Hello 2 Hello 3

72 72 /83!$omp parallel!$omp do do iblk=1,nblock do icy=icyblkst(iblk),icyblkend(iblk) do icx=icxblkst(iblk),icxblkend(iblk) do icell(myrank) if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif!$omp end do!$omp end parallel M2L.

73 73 /83!$omp parallel!$omp do schedule(static,nchunk) do load=1,nload icx=lddir(1,load) icy=lddir(2,load) do icell(myrank) if(icx,icy 2 ) do m1=1,(nmax+1) 2 do m2=1,(nmax+1) 2 wl_local=wl_local+m2l*wm_local endif!$omp end do!$omp end parallel M2L lddir. nchunk. md_fmm_f90.f

74 74 /83 do jcell_line do icell [along icell_line]!$omp parallel!$omp do do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1!$omp!$omp end parallel

75 75 /83 do jcell_line do icell [along icell_line]!$omp parallel!$omp do do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1!$omp!$omp end parallel $!omp parallel!$omp parallel do jcell_line do icell jcell_line *icell parallel open/close [along icell_line]!$omp do do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1!$omp!$omp end parallel

76 single instruction multiple data) core (/proc/cpuinfo ) ) intel SSE pentium III~ 128bit (32bit X 4, 64 bit X 2) AVX Sandy Bridge~ 256bit (32bit X 8, 64 bit X 4) SIMD : SIMD,, Fortran/C intrinsic 76 /83 data x 4 +, SIMD 2 OpenMP, SIMD

77 77 /83 SIMD simd.f: real(8)::a(10000,10000),b(10000) real(8)::c(10000) a=1d0 b=1d0 do i=1,10000 c(i)=0d0 do j=1,10000 c(i)=c(i)+a(i,j)*b(j) stop end C(i)=ΣA(i,j)*B(j) SIMD >ifort -O0 simd.f >time./a.out real 0m1.782s user 0m1.274s sys 0m0.508s SIMD >ifort -xhost -vec-report simd.f simd.f(3): (col. 2) remark: LOOP WAS VECTORIZED. simd.f(4): (col. 2) remark: LOOP WAS VECTORIZED. simd.f(5): (col. 2) remark: PERMUTED LOOP WAS VECTORIZED. >time./a.out real 0m0.718s user 0m0.397s sys 0m0.321s. VECTORIZED

78 78 /83 OpenMP, 1-4 scale 1-2 void nonbond : do imol=1,nmol-1 do jmol=imol+1,nmol do i=1,natom(imol) do j=1,natom(jmol) rij=rij(ri, rj) LJ φ nonbond =φ nonbond +φ ij f(i)=f(i)+fi f(j)=f(j)+fj do imol=1,nmol do i=1,natom(imol)-1 do j=i+1,natom(imol) rij=rij(ri, rj) LJ x = φ nonbond =φ nonbond +x*φ ij f(i)=f(i)+x*fi f(j)=f(j)+x*fj 0 if 1-2,-3 void s if 1-4 scale 1 else 1 2 (1-2, 1-3 void) 3 s (1-4 scale) [s LJ, Coulomb ] 4

79 1-4 scale 1-2 void nonbond : 79 /83 do jcell_line do icell [along icell_line] do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1 rij=rij(ri,rj) LJ x= φ nonbond =φ nonbond +x*φ ij f(i)=f(i)+x*fi f(j)=f(j)+x*fj 0 if 1-2,-3 void s if 1-4 scale 1 else OpenMP jcell_line if 1 2 (1-2, 1-3 void) 3 s (1-4 scale), s LJ, Coulomb 4

80 80 /83 do jcell_line do icell [along icell_line] do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=tag(jcell), tag(jcell+4)+na_per_cell(jcell+4)-1 rij=rij(ri,rj) if(rij rcut) LJ_epsilon=0d0 φ nonbond =φ nonbond +φ ij f(i)=f(i)+fi f(j)=f(j)+fj jcell_line void, scale ( ). do iatom=tag(icell), tag(icell)+na_per_cell(icell)-1 do jatom=1,voidpair123(iatom) rij=rij(ri,rj) φ nonbond =φ nonbond φ ij void f(i)=f(i) Fi f(j)=f(j) Fj do jatom=1,scalepair14(iatom) rij=rij(ri,rj) x=1-s φ nonbond =φ nonbond x*φ ij f(i)=f(i) x*fi f(j)=f(j) x*fj (MDGRAPE) scale

81 81 /83 frtpx -Qt md_direct_f90.f <<< Loop-information Start >>> <<< [OPTIMIZATION] <<< SIMD <<< SOFTWARE PIPELINING <<< Loop-information End >>> p v do j0=tag(jzb-2,jyb,jxb), & tag(jzb+2,jyb,jxb) & + na_per_cell(jzb+2,jyb,jxb) p v rx=xi-wkxyz(1,j0) p v ry=yi-wkxyz(2,j0) p v rz=zi-wkxyz(3,j0) p v r2=rx*rx+ry*ry+rz*rz 149 9! ^^^ spherical cut-off ^^^ p v if(r2<=cutrad2) then p v eps=epsilon_sqrt_i & *epsilon_sqrt_table(ic,iam) p v else p v eps=0d p v endif!cut-off p v sulj12=sulj12+ulj p v sulj6 =sulj6 +Ulj p v sucoulomb=sucoulomb+ucoulomb p v stlcx=stlcx+tlx p v stlcy=stlcy+tly p v stlcz=stlcz+tlz p v stlcx=stlcx+tcx p v stlcy=stlcy+tcy p v stlcz=stlcz+tcz p v ic=ic p v!j0

82 82 /83 frtpx -Qt md_fmm_f90.f p DO load = 1, nload p ic = lddir(1,load) p jc = lddir(2,load) p kc = lddir(3,load) **** multipole to local translation <<< Loop-information Start >>> <<< [OPTIMIZATION] <<< PREFETCH : 6 <<< wwl_localx: 6 <<< Loop-information End >>> p do m1=1,(nmax+1)*(nmax+1) <<< Loop-information Start >>> <<< [OPTIMIZATION] <<< SIMD <<< SOFTWARE PIPELINING <<< Loop-information End >>> p 6v do m2=1,(nmax+1)*(nmax+1) p 6v wwl_localx(m1,icz0,icy0,icx0,iam) $ = wwl_localx(m1,icz0,icy0,icx0,iam) $ + wm_localx(m2,icz1,icy1,icx1)*shml(m2,m1,kc,jc,ic,nl) p 6v p p ENDDO! load

83 83 /83 3 MPI,,,.,. OpenMP (, ) SIMD (IF, ).

84 /83 (PDF) (PDF). 21 CMSI : MODYLAS

コードのチューニング

コードのチューニング ハイブリッド並列 八木学 ( 理化学研究所計算科学研究機構 ) 謝辞 松本洋介氏 ( 千葉大学 ) KOBE HPC Spring School 2017 2017 年 3 月 14 日神戸大学計算科学教育センター MPI とは Message Passing Interface 分散メモリのプロセス間の通信規格(API) SPMD(Single Program Multi Data) が基本 -

More information

Microsoft PowerPoint - 演習1:並列化と評価.pptx

Microsoft PowerPoint - 演習1:並列化と評価.pptx 講義 2& 演習 1 プログラム並列化と性能評価 神戸大学大学院システム情報学研究科横川三津夫 yokokawa@port.kobe-u.ac.jp 2014/3/5 RIKEN AICS HPC Spring School 2014: プログラム並列化と性能評価 1 2014/3/5 RIKEN AICS HPC Spring School 2014: プログラム並列化と性能評価 2 2 次元温度分布の計算

More information

untitled

untitled RIKEN AICS Summer School 3 4 MPI 2012 8 8 1 6 MPI MPI 2 allocatable 2 Fox mpi_sendrecv 3 3 FFT mpi_alltoall MPI_PROC_NULL 4 FX10 /home/guest/guest07/school/ 5 1 A (i, j) i+j x i i y = Ax A x y y 1 y i

More information

演習準備

演習準備 演習準備 2014 年 3 月 5 日神戸大学大学院システム情報学研究科森下浩二 1 演習準備の内容 神戸大 FX10(π-Computer) 利用準備 システム概要 ログイン方法 コンパイルとジョブ実行方法 MPI 復習 1. MPIプログラムの基本構成 2. 並列実行 3. 1 対 1 通信 集団通信 4. データ 処理分割 5. 計算時間計測 2 神戸大 FX10(π-Computer) 利用準備

More information

<4D F736F F F696E74202D D F95C097F D834F E F93FC96E5284D F96E291E85F8DE391E52E >

<4D F736F F F696E74202D D F95C097F D834F E F93FC96E5284D F96E291E85F8DE391E52E > SX-ACE 並列プログラミング入門 (MPI) ( 演習補足資料 ) 大阪大学サイバーメディアセンター日本電気株式会社 演習問題の構成 ディレクトリ構成 MPI/ -- practice_1 演習問題 1 -- practice_2 演習問題 2 -- practice_3 演習問題 3 -- practice_4 演習問題 4 -- practice_5 演習問題 5 -- practice_6

More information

C/C++ FORTRAN FORTRAN MPI MPI MPI UNIX Windows (SIMD Single Instruction Multipule Data) SMP(Symmetric Multi Processor) MPI (thread) OpenMP[5]

C/C++ FORTRAN FORTRAN MPI MPI MPI UNIX Windows (SIMD Single Instruction Multipule Data) SMP(Symmetric Multi Processor) MPI (thread) OpenMP[5] MPI ( ) snozawa@env.sci.ibaraki.ac.jp 1 ( ) MPI MPI Message Passing Interface[2] MPI MPICH[3],LAM/MPI[4] (MIMDMultiple Instruction Multipule Data) Message Passing ( ) (MPI (rank) PE(Processing Element)

More information

120802_MPI.ppt

120802_MPI.ppt CPU CPU CPU CPU CPU SMP Symmetric MultiProcessing CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CP OpenMP MPI MPI CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU MPI MPI+OpenMP CPU CPU CPU CPU CPU CPU CPU CP

More information

2012年度HPCサマーセミナー_多田野.pptx

2012年度HPCサマーセミナー_多田野.pptx ! CCS HPC! I " tadano@cs.tsukuba.ac.jp" " 1 " " " " " " " 2 3 " " Ax = b" " " 4 Ax = b" A = a 11 a 12... a 1n a 21 a 22... a 2n...... a n1 a n2... a nn, x = x 1 x 2. x n, b = b 1 b 2. b n " " 5 Gauss LU

More information

Microsoft PowerPoint - KHPCSS pptx

Microsoft PowerPoint - KHPCSS pptx KOBE HPC サマースクール 2018( 初級 ) 9. 1 対 1 通信関数, 集団通信関数 2018/8/8 KOBE HPC サマースクール 2018 1 2018/8/8 KOBE HPC サマースクール 2018 2 MPI プログラム (M-2):1 対 1 通信関数 問題 1 から 100 までの整数の和を 2 並列で求めなさい. プログラムの方針 プロセス0: 1から50までの和を求める.

More information

untitled

untitled I 9 MPI (II) 2012 6 14 .. MPI. 1-3 sum100.f90 4 istart=myrank*25+1 iend=(myrank+1)*25 0 1 2 3 mpi_recv 3 isum1 1 isum /tmp/120614/sum100_4.f90 program sum100_4 use mpi implicit none integer :: i,istart,iend,isum,isum1,ip

More information

MPI usage

MPI usage MPI (Version 0.99 2006 11 8 ) 1 1 MPI ( Message Passing Interface ) 1 1.1 MPI................................. 1 1.2............................... 2 1.2.1 MPI GATHER.......................... 2 1.2.2

More information

コードのチューニング

コードのチューニング MPI による並列化実装 ~ ハイブリッド並列 ~ 八木学 ( 理化学研究所計算科学研究センター ) KOBE HPC Spring School 2019 2019 年 3 月 14 日 MPI とは Message Passing Interface 分散メモリのプロセス間の通信規格(API) SPMD(Single Program Multi Data) が基本 - 各プロセスが 同じことをやる

More information

演習準備 2014 年 3 月 5 日神戸大学大学院システム情報学研究科森下浩二 1 RIKEN AICS HPC Spring School /3/5

演習準備 2014 年 3 月 5 日神戸大学大学院システム情報学研究科森下浩二 1 RIKEN AICS HPC Spring School /3/5 演習準備 2014 年 3 月 5 日神戸大学大学院システム情報学研究科森下浩二 1 演習準備の内容 神戸大 FX10(π-Computer) 利用準備 システム概要 ログイン方法 コンパイルとジョブ実行方法 MPI 復習 1. MPIプログラムの基本構成 2. 並列実行 3. 1 対 1 通信 集団通信 4. データ 処理分割 5. 計算時間計測 2 神戸大 FX10(π-Computer) 利用準備

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション 計算科学演習 I 第 8 回講義 MPI を用いた並列計算 (I) 2013 年 6 月 6 日 システム情報学研究科計算科学専攻 山本有作 今回の講義の概要 1. MPI とは 2. 簡単な MPI プログラムの例 (1) 3. 簡単な MPI プログラムの例 (2):1 対 1 通信 4. 簡単な MPI プログラムの例 (3): 集団通信 共有メモリ型並列計算機 ( 復習 ) 共有メモリ型並列計算機

More information

2 T 1 N n T n α = T 1 nt n (1) α = 1 100% OpenMP MPI OpenMP OpenMP MPI (Message Passing Interface) MPI MPICH OpenMPI 1 OpenMP MPI MPI (trivial p

2 T 1 N n T n α = T 1 nt n (1) α = 1 100% OpenMP MPI OpenMP OpenMP MPI (Message Passing Interface) MPI MPICH OpenMPI 1 OpenMP MPI MPI (trivial p 22 6 22 MPI MPI 1 1 2 2 3 MPI 3 4 7 4.1.................................. 7 4.2 ( )................................ 10 4.3 (Allreduce )................................. 12 5 14 5.1........................................

More information

並列計算導入.pptx

並列計算導入.pptx 並列計算の基礎 MPI を用いた並列計算 並列計算の環境 並列計算 複数の計算ユニット(PU, ore, Pなど を使用して 一つの問題 計算 を行わせる 近年 並列計算を手軽に使用できる環境が急速に整いつつある >通常のP PU(entral Processing Unit)上に計算装置であるoreが 複数含まれている Intel ore i7 シリーズ: 4つの計算装置(ore) 通常のプログラム

More information

01_OpenMP_osx.indd

01_OpenMP_osx.indd OpenMP* / 1 1... 2 2... 3 3... 5 4... 7 5... 9 5.1... 9 5.2 OpenMP* API... 13 6... 17 7... 19 / 4 1 2 C/C++ OpenMP* 3 Fortran OpenMP* 4 PC 1 1 9.0 Linux* Windows* Xeon Itanium OS 1 2 2 WEB OS OS OS 1 OS

More information

Microsoft PowerPoint _MPI-01.pptx

Microsoft PowerPoint _MPI-01.pptx 計算科学演習 Ⅰ MPI を いた並列計算 (I) 神戸大学大学院システム情報学研究科谷口隆晴 yaguchi@pearl.kobe-u.ac.jp この資料は昨年度担当の横川先生の資料を参考にさせて頂いています. 2016/06/23 MPI を用いた並列計算 (I) 1 講義概要 分散メモリ型計算機上のプログラミング メッセージ パシング インターフェイス (Message Passing Interface,MPI)

More information

NUMAの構成

NUMAの構成 メッセージパッシング プログラミング 天野 共有メモリ対メッセージパッシング 共有メモリモデル 共有変数を用いた単純な記述自動並列化コンパイラ簡単なディレクティブによる並列化 :OpenMP メッセージパッシング 形式検証が可能 ( ブロッキング ) 副作用がない ( 共有変数は副作用そのもの ) コストが小さい メッセージパッシングモデル 共有変数は使わない 共有メモリがないマシンでも実装可能 クラスタ

More information

040312研究会HPC2500.ppt

040312研究会HPC2500.ppt 2004312 e-mail : m-aoki@jp.fujitsu.com 1 2 PRIMEPOWER VX/VPP300 VPP700 GP7000 AP3000 VPP5000 PRIMEPOWER 2000 PRIMEPOWER HPC2500 1998 1999 2000 2001 2002 2003 3 VPP5000 PRIMEPOWER ( 1 VU 9.6 GF 16GB 1 VU

More information

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド Visual Fortran Composer XE 2013 Windows* エクセルソフト株式会社 www.xlsoft.com Rev. 1.1 (2012/12/10) Copyright 1998-2013 XLsoft Corporation. All Rights Reserved. 1 / 53 ... 3... 4... 4... 5 Visual Studio... 9...

More information

Microsoft PowerPoint _MPI-03.pptx

Microsoft PowerPoint _MPI-03.pptx 計算科学演習 Ⅰ ( 第 11 回 ) MPI を いた並列計算 (III) 神戸大学大学院システム情報学研究科横川三津夫 yokokawa@port.kobe-u.ac.jp 2014/07/03 計算科学演習 Ⅰ:MPI を用いた並列計算 (III) 1 2014/07/03 計算科学演習 Ⅰ:MPI を用いた並列計算 (III) 2 今週の講義の概要 1. 前回課題の解説 2. 部分配列とローカルインデックス

More information

CPU Levels in the memory hierarchy Level 1 Level 2... Increasing distance from the CPU in access time Level n Size of the memory at each level 1: 2.2

CPU Levels in the memory hierarchy Level 1 Level 2... Increasing distance from the CPU in access time Level n Size of the memory at each level 1: 2.2 FFT 1 Fourier fast Fourier transform FFT FFT FFT 1 FFT FFT 2 Fourier 2.1 Fourier FFT Fourier discrete Fourier transform DFT DFT n 1 y k = j=0 x j ω jk n, 0 k n 1 (1) x j y k ω n = e 2πi/n i = 1 (1) n DFT

More information

nakao

nakao Fortran+Python 4 Fortran, 2018 12 12 !2 Python!3 Python 2018 IEEE spectrum https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2018!4 Python print("hello World!") if x == 10: print

More information

コードのチューニング

コードのチューニング OpenMP による並列化実装 八木学 ( 理化学研究所計算科学研究センター ) KOBE HPC Spring School 2019 2019 年 3 月 14 日 スレッド並列とプロセス並列 スレッド並列 OpenMP 自動並列化 プロセス並列 MPI プロセス プロセス プロセス スレッドスレッドスレッドスレッド メモリ メモリ プロセス間通信 Private Private Private

More information

(Microsoft PowerPoint \211\211\217K3_4\201i\216R\226{_\211\272\215\342\201j.ppt [\214\335\212\267\203\202\201[\203h])

(Microsoft PowerPoint \211\211\217K3_4\201i\216R\226{_\211\272\215\342\201j.ppt [\214\335\212\267\203\202\201[\203h]) RIKEN AICS Summer School 演習 3 4 MPI による並列計算 2012 年 8 月 8 日 神戸大学大学院システム情報学研究科山本有作理化学研究所計算科学研究機構下坂健則 1 演習の目標 講義 6 並列アルゴリズム基礎 で学んだアルゴリズムのいくつかを,MPI を用いて並列化してみる これを通じて, 基本的な並列化手法と,MPI 通信関数の使い方を身に付ける 2 取り上げる例題と学習項目

More information

Microsoft PowerPoint - 講義:片方向通信.pptx

Microsoft PowerPoint - 講義:片方向通信.pptx MPI( 片方向通信 ) 09 年 3 月 5 日 神戸大学大学院システム情報学研究科計算科学専攻横川三津夫 09/3/5 KOBE HPC Spring School 09 分散メモリ型並列計算機 複数のプロセッサがネットワークで接続されており, れぞれのプロセッサ (PE) が, メモリを持っている. 各 PE が自分のメモリ領域のみアクセス可能 特徴数千から数万 PE 規模の並列システムが可能

More information

I I / 47

I I / 47 1 2013.07.18 1 I 2013 3 I 2013.07.18 1 / 47 A Flat MPI B 1 2 C: 2 I 2013.07.18 2 / 47 I 2013.07.18 3 / 47 #PJM -L "rscgrp=small" π-computer small: 12 large: 84 school: 24 84 16 = 1344 small school small

More information

para02-2.dvi

para02-2.dvi 2002 2 2002 4 23 : MPI MPI 1 MPI MPI(Message Passing Interface) MPI UNIX Windows Machintosh OS, MPI 2 1 1 2 2.1 1 1 1 1 1 1 Fig. 1 A B C F Fig. 2 A B F Fig. 1 1 1 Fig. 2 2.2 Fig. 3 1 . Fig. 4 Fig. 3 Fig.

More information

目 目 用方 用 用 方

目 目 用方 用 用 方 大 生 大 工 目 目 用方 用 用 方 用 方 MS-MPI MPI.NET MPICH MPICH2 LAM/MPI Ver. 2 2 1 2 1 C C++ Fortan.NET C# C C++ Fortan 用 行 用 用 用 行 用 言 言 言 行 生 方 方 一 行 高 行 行 文 用 行 If ( rank == 0 ) { // 0 } else if (rank == 1) {

More information

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a))

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) E-mail: {nanri,amano}@cc.kyushu-u.ac.jp 1 ( ) 1. VPP Fortran[6] HPF[3] VPP Fortran 2. MPI[5]

More information

スライド 1

スライド 1 目次 2.MPI プログラミング入門 この資料は, スーパーコン 10 で使用したものである. ごく基本的な内容なので, 現在でも十分利用できると思われるものなので, ここに紹介させて頂く. ただし, 古い情報も含まれているので注意が必要である. 今年度版の解説は, 本選の初日に配布する予定である. 1/20 2.MPI プログラミング入門 (1) 基本 説明 MPI (message passing

More information

スパコンに通じる並列プログラミングの基礎

スパコンに通じる並列プログラミングの基礎 2018.06.04 2018.06.04 1 / 62 2018.06.04 2 / 62 Windows, Mac Unix 0444-J 2018.06.04 3 / 62 Part I Unix GUI CUI: Unix, Windows, Mac OS Part II 2018.06.04 4 / 62 0444-J ( : ) 6 4 ( ) 6 5 * 6 19 SX-ACE * 6

More information

Microsoft PowerPoint - 演習2:MPI初歩.pptx

Microsoft PowerPoint - 演習2:MPI初歩.pptx 演習 2:MPI 初歩 - 並列に計算する - 2013 年 8 月 6 日 神戸大学大学院システム情報学研究科計算科学専攻横川三津夫 MPI( メッセージ パッシング インターフェース ) を使おう! [ 演習 2 の内容 ] はじめの一歩課題 1: Hello, world を並列に出力する. 課題 2: プロセス 0 からのメッセージを受け取る (1 対 1 通信 ). 部分に分けて計算しよう課題

More information

Fujitsu Standard Tool

Fujitsu Standard Tool XcalableMP ワークショップ COARRAY の便利な使い方 2017 年 10 月 31 日富士通株式会社 ) 次世代 TC 開発本部原口正寿 COARRAY 仕様 Fortran 2008 に組み込まれた分散並列機能 指示文とサービスサブルーチンではなく 文法として組み込まれた [, ] ( 角括弧 ) によるプロセス間通信と 同期のための文 アトミックサブルーチンなど組込み手続 SPMDモデル(Single

More information

Intel® Compilers Professional Editions

Intel® Compilers Professional Editions 2007 6 10.0 * 10.0 6 5 Software &Solutions group 10.0 (SV) C++ Fortran OpenMP* OpenMP API / : 200 C/C++ Fortran : OpenMP : : : $ cat -n main.cpp 1 #include 2 int foo(const char *); 3 int main()

More information

MPI MPI MPI.NET C# MPI Version2

MPI MPI MPI.NET C# MPI Version2 MPI.NET C# 2 2009 2 27 MPI MPI MPI.NET C# MPI Version2 MPI (Message Passing Interface) MPI MPI Version 1 1994 1 1 1 1 ID MPI MPI_Send MPI_Recv if(rank == 0){ // 0 MPI_Send(); } else if(rank == 1){ // 1

More information

OpenMPプログラミング

OpenMPプログラミング OpenMP 基礎 岩下武史 ( 学術情報メディアセンター ) 1 2013/9/13 並列処理とは 逐次処理 CPU1 並列処理 CPU1 CPU2 CPU3 CPU4 処理 1 処理 1 処理 2 処理 3 処理 4 処理 2 処理 3 処理 4 時間 2 2 種類の並列処理方法 プロセス並列 スレッド並列 並列プログラム 並列プログラム プロセス プロセス 0 プロセス 1 プロセス間通信 スレッド

More information

Microsoft PowerPoint - 03_What is OpenMP 4.0 other_Jan18

Microsoft PowerPoint - 03_What is OpenMP 4.0 other_Jan18 OpenMP* 4.x における拡張 OpenMP 4.0 と 4.5 の機能拡張 内容 OpenMP* 3.1 から 4.0 への拡張 OpenMP* 4.0 から 4.5 への拡張 2 追加された機能 (3.1 -> 4.0) C/C++ 配列シンタックスの拡張 SIMD と SIMD 対応関数 デバイスオフロード task 構 の依存性 taskgroup 構 cancel 句と cancellation

More information

スパコンに通じる並列プログラミングの基礎

スパコンに通じる並列プログラミングの基礎 2018.09.10 furihata@cmc.osaka-u.ac.jp ( ) 2018.09.10 1 / 59 furihata@cmc.osaka-u.ac.jp ( ) 2018.09.10 2 / 59 Windows, Mac Unix 0444-J furihata@cmc.osaka-u.ac.jp ( ) 2018.09.10 3 / 59 Part I Unix GUI CUI:

More information

Microsoft PowerPoint MPI.v...O...~...O.e.L.X.g(...Q..)

Microsoft PowerPoint MPI.v...O...~...O.e.L.X.g(...Q..) MPI プログラミング Information Initiative Center, Hokkaido Univ. MPI ライブラリを利用した分散メモリ型並列プログラミング 分散メモリ型並列処理 : 基礎 分散メモリマルチコンピュータの構成 プロセッサエレメントが専用のメモリ ( ローカルメモリ ) を搭載 スケーラビリティが高い 例 :HITACHI SR8000 Interconnection

More information

¥Ñ¥Ã¥±¡¼¥¸ Rhpc ¤Î¾õ¶·

¥Ñ¥Ã¥±¡¼¥¸ Rhpc ¤Î¾õ¶· Rhpc COM-ONE 2015 R 27 12 5 1 / 29 1 2 Rhpc 3 forign MPI 4 Windows 5 2 / 29 1 2 Rhpc 3 forign MPI 4 Windows 5 3 / 29 Rhpc, R HPC Rhpc, ( ), snow..., Rhpc worker call Rhpc lapply 4 / 29 1 2 Rhpc 3 forign

More information

課題 S1 解説 Fortran 編 中島研吾 東京大学情報基盤センター

課題 S1 解説 Fortran 編 中島研吾 東京大学情報基盤センター 課題 S1 解説 Fortran 編 中島研吾 東京大学情報基盤センター 内容 課題 S1 /a1.0~a1.3, /a2.0~a2.3 から局所ベクトル情報を読み込み, 全体ベクトルのノルム ( x ) を求めるプログラムを作成する (S1-1) file.f,file2.f をそれぞれ参考にする 下記の数値積分の結果を台形公式によって求めるプログラムを作成する

More information

XcalableMP入門

XcalableMP入門 XcalableMP 1 HPC-Phys@, 2018 8 22 XcalableMP XMP XMP Lattice QCD!2 XMP MPI MPI!3 XMP 1/2 PCXMP MPI Fortran CCoarray C++ MPIMPI XMP OpenMP http://xcalablemp.org!4 XMP 2/2 SPMD (Single Program Multiple Data)

More information

02_C-C++_osx.indd

02_C-C++_osx.indd C/C++ OpenMP* / 2 C/C++ OpenMP* OpenMP* 9.0 1... 2 2... 3 3OpenMP*... 5 3.1... 5 3.2 OpenMP*... 6 3.3 OpenMP*... 8 4OpenMP*... 9 4.1... 9 4.2 OpenMP*... 9 4.3 OpenMP*... 10 4.4... 10 5OpenMP*... 11 5.1

More information

±é½¬£²¡§£Í£Ð£É½éÊâ

±é½¬£²¡§£Í£Ð£É½éÊâ 2012 8 7 1 / 52 MPI Hello World I ( ) Hello World II ( ) I ( ) II ( ) ( sendrecv) π ( ) MPI fortran C wget http://www.na.scitec.kobe-u.ac.jp/ yaguchi/riken2012/enshu2.zip unzip enshu2.zip 2 / 52 FORTRAN

More information

スパコンに通じる並列プログラミングの基礎

スパコンに通じる並列プログラミングの基礎 2016.06.06 2016.06.06 1 / 60 2016.06.06 2 / 60 Windows, Mac Unix 0444-J 2016.06.06 3 / 60 Part I Unix GUI CUI: Unix, Windows, Mac OS Part II 0444-J 2016.06.06 4 / 60 ( : ) 6 6 ( ) 6 10 6 16 SX-ACE 6 17

More information

インテル(R) Visual Fortran Composer XE

インテル(R) Visual Fortran Composer XE Visual Fortran Composer XE 1. 2. 3. 4. 5. Visual Studio 6. Visual Studio 7. 8. Compaq Visual Fortran 9. Visual Studio 10. 2 https://registrationcenter.intel.com/regcenter/ w_fcompxe_all_jp_2013_sp1.1.139.exe

More information

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë 2012 5 24 scalar Open MP Hello World Do (omp do) (omp workshare) (shared, private) π (reduction) PU PU PU 2 16 OpenMP FORTRAN/C/C++ MPI OpenMP 1997 FORTRAN Ver. 1.0 API 1998 C/C++ Ver. 1.0 API 2000 FORTRAN

More information

Microsoft PowerPoint - S1-ref-F.ppt [互換モード]

Microsoft PowerPoint - S1-ref-F.ppt [互換モード] 課題 S1 解説 Fortran 言語編 RIKEN AICS HPC Summer School 2014 中島研吾 ( 東大 情報基盤センター ) 横川三津夫 ( 神戸大 計算科学教育センター ) MPI Programming 課題 S1 (1/2) /a1.0~a1.3, /a2.0~a2.3 から局所ベクトル情報を読み込み, 全体ベクトルのノルム ( x ) を求めるプログラムを作成する

More information

Microsoft Word - 計算科学演習第1回3.doc

Microsoft Word - 計算科学演習第1回3.doc スーパーコンピュータの基本的操作方法 2009 年 9 月 10 日高橋康人 1. スーパーコンピュータへのログイン方法 本演習では,X 端末ソフト Exceed on Demand を使用するが, 必要に応じて SSH クライアント putty,ftp クライアント WinSCP や FileZilla を使用して構わない Exceed on Demand を起動し, 以下のとおり設定 ( 各自のユーザ

More information

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë 2011 5 26 scalar Open MP Hello World Do (omp do) (omp workshare) (shared, private) π (reduction) scalar magny-cours, 48 scalar scalar 1 % scp. ssh / authorized keys 133. 30. 112. 246 2 48 % ssh 133.30.112.246

More information

Microsoft PowerPoint - sales2.ppt

Microsoft PowerPoint - sales2.ppt 並列化の基礎 ( 言葉の意味 ) 並列実行には 複数のタスク実行主体が必要 共有メモリ型システム (SMP) での並列 プロセスを使用した並列化 スレッドとは? スレッドを使用した並列化 分散メモリ型システムでの並列 メッセージパッシングによる並列化 並列アーキテクチャ関連の言葉を押さえよう 21 プロセスを使用した並列処理 並列処理を行うためには複数のプロセスの生成必要プロセスとは プログラム実行のための能動実態メモリ空間親プロセス子プロセス

More information

<4D F736F F F696E74202D C097F B A E B93C782DD8EE682E890EA97705D>

<4D F736F F F696E74202D C097F B A E B93C782DD8EE682E890EA97705D> 並列アルゴリズム 2005 年後期火曜 2 限青柳睦 Aoyagi@cc.kyushu-u.ac.jp http//server-500.cc.kyushu-u.ac.jp/ 11 月 29( 火 ) 7. 集団通信 (Collective Communication) 8. 領域分割 (Domain Decomposition) 1 もくじ 1. 序並列計算機の現状 2. 計算方式およびアーキテクチュアの分類

More information

openmp1_Yaguchi_version_170530

openmp1_Yaguchi_version_170530 並列計算とは /OpenMP の初歩 (1) 今 の内容 なぜ並列計算が必要か? スーパーコンピュータの性能動向 1ExaFLOPS 次世代スハ コン 京 1PFLOPS 性能 1TFLOPS 1GFLOPS スカラー機ベクトル機ベクトル並列機並列機 X-MP ncube2 CRAY-1 S-810 SR8000 VPP500 CM-5 ASCI-5 ASCI-4 S3800 T3E-900 SR2201

More information

演習 II 2 つの講義の演習 奇数回 : 連続系アルゴリズム 部分 偶数回 : 計算量理論 部分 連続系アルゴリズム部分は全 8 回を予定 前半 2 回 高性能計算 後半 6 回 数値計算 4 回以上の課題提出 ( プログラム + 考察レポート ) で単位

演習 II 2 つの講義の演習 奇数回 : 連続系アルゴリズム 部分 偶数回 : 計算量理論 部分 連続系アルゴリズム部分は全 8 回を予定 前半 2 回 高性能計算 後半 6 回 数値計算 4 回以上の課題提出 ( プログラム + 考察レポート ) で単位 演習 II ( 連続系アルゴリズム ) 第 1 回 : MPI 須田研究室 M2 本谷徹 motoya@is.s.u-tokyo.ac.jp 2012/10/05 2012/10/18 補足 訂正 演習 II 2 つの講義の演習 奇数回 : 連続系アルゴリズム 部分 偶数回 : 計算量理論 部分 連続系アルゴリズム部分は全 8 回を予定 前半 2 回 高性能計算 後半 6 回 数値計算 4 回以上の課題提出

More information

4th XcalableMP workshop 目的 n XcalableMPのローカルビューモデルであるXMPのCoarray機能を用 いて Fiberミニアプリ集への実装と評価を行う PGAS(Pertitioned Global Address Space)言語であるCoarrayのベ ンチマ

4th XcalableMP workshop 目的 n XcalableMPのローカルビューモデルであるXMPのCoarray機能を用 いて Fiberミニアプリ集への実装と評価を行う PGAS(Pertitioned Global Address Space)言語であるCoarrayのベ ンチマ 4th XcalableMP workshop 目的 n XcalableMPのローカルビューモデルであるXMPのCoarray機能を用 いて Fiberミニアプリ集への実装と評価を行う PGAS(Pertitioned Global Address Space)言語であるCoarrayのベ ンチマークとして整備することも考慮している n Coarrayによる並列化に関する知見を得る 1 n n l

More information

2 2.1 Mac OS CPU Mac OS tar zxf zpares_0.9.6.tar.gz cd zpares_0.9.6 Mac Makefile Mekefile.inc cp Makefile.inc/make.inc.gfortran.seq.macosx make

2 2.1 Mac OS CPU Mac OS tar zxf zpares_0.9.6.tar.gz cd zpares_0.9.6 Mac Makefile Mekefile.inc cp Makefile.inc/make.inc.gfortran.seq.macosx make Sakurai-Sugiura z-pares 26 9 5 1 1 2 2 2.1 Mac OS CPU......................................... 2 2.2 Linux MPI............................................ 2 3 3 4 6 4.1 MUMPS....................................

More information

スライド 1

スライド 1 本日 (4/25) の内容 1 並列計算の概要 並列化計算の目的 並列コンピュータ環境 並列プログラミングの方法 MPI を用いた並列プログラミング 並列化効率 2 並列計算の実行方法 Hello world モンテカルロ法による円周率計算 並列計算のはじまり 並列計算の最初の構想を イギリスの科学者リチャードソンが 1922 年に発表 < リチャードソンの夢 > 64000 人を円形の劇場に集めて

More information

GRAPE-DR /

GRAPE-DR / GRAPE-DR / GRAPE GRAPE-DR GRAPE ( ): (Barnes-Hut tree, FMM, Particle- Mesh Ewald(PPPM)...): ( ) 1988 32 IC 200 0.1m 3 400 GRAPE-1(1989) 16 8 32 48 240Mflops GRAPE-2(1990) 8 ( ) 40Mflops GRAPE-3(1991) 24

More information

次世代スーパーコンピュータのシステム構成案について

次世代スーパーコンピュータのシステム構成案について 6 19 4 27 1. 2. 3. 3.1 3.2 A 3.3 B 4. 5. 2007/4/27 4 1 1. 2007/4/27 4 2 NEC NHF2 18 9 19 19 2 28 10PFLOPS2.5PB 30MW 3,200 18 12 12 SimFold, GAMESS, Modylas, RSDFT, NICAM, LatticeQCD, LANS HPL, NPB-FT 19

More information

2/66

2/66 1/66 9 Outline 1. 2. 3. 4. CPU 5. Jun. 13, 2013@A 2/66 3/66 4/66 Network Memory Memory Memory CPU SIMD if Cache CPU Cache CPU Cache CPU 5/66 FPU FPU Floating Processing Unit Register Register Register

More information

演習問題の構成 ディレクトリ構成 MPI/ --practice_1 演習問題 1 --practice_2 演習問題 2 --practice_3 演習問題 3 --practice_4 演習問題 4 --practice_5 演習問題 5 --practice_6 演習問題 6 --sample

演習問題の構成 ディレクトリ構成 MPI/ --practice_1 演習問題 1 --practice_2 演習問題 2 --practice_3 演習問題 3 --practice_4 演習問題 4 --practice_5 演習問題 5 --practice_6 演習問題 6 --sample H26 年度 MPI プログラミング入門 ( 演習補足資料 ) 2014 年 6 月 24 日 大阪大学サイバーメディアセンター 日本電気株式会社 演習問題の構成 ディレクトリ構成 MPI/ --practice_1 演習問題 1 --practice_2 演習問題 2 --practice_3 演習問題 3 --practice_4 演習問題 4 --practice_5 演習問題 5 --practice_6

More information

演習1: 演習準備

演習1: 演習準備 演習 1: 演習準備 2013 年 8 月 6 日神戸大学大学院システム情報学研究科森下浩二 1 演習 1 の内容 神戸大 X10(π-omputer) について システム概要 ログイン方法 コンパイルとジョブ実行方法 OpenMP の演習 ( 入門編 ) 1. parallel 構文 実行時ライブラリ関数 2. ループ構文 3. shared 節 private 節 4. reduction 節

More information

かし, 異なったプロセス間でデータを共有するためには, プロセス間通信や特殊な共有メモリ領域を 利用する必要がある. このためマルチプロセッサマシンの利点を最大に引き出すことができない. こ の問題はマルチスレッドを用いることで解決できる. マルチスレッドとは,1 つのプロセスの中に複 数のスレッド

かし, 異なったプロセス間でデータを共有するためには, プロセス間通信や特殊な共有メモリ領域を 利用する必要がある. このためマルチプロセッサマシンの利点を最大に引き出すことができない. こ の問題はマルチスレッドを用いることで解決できる. マルチスレッドとは,1 つのプロセスの中に複 数のスレッド 0 並列計算について 0.1 並列プログラミングライブラリのメッセージパッシングモデル並列プログラムにはメモリモデルで分類すると, 共有メモリモデルと分散メモリモデルの 2 つに分けられる. それぞれ次のような特徴がある. 共有メモリモデル複数のプロセスやスレッドが事項する主体となり, 互いに通信や同期を取りながら計算が継続される. スレッド間の実行順序をプログラマが保証してやらないと, 思った結果が得られない.

More information

nosenote3.dvi

nosenote3.dvi i 1 1 2 5 3 Verlet 9 4 18 5 23 6 26 1 1 1 MD t N r 1 (t), r 2 (t),, r N (t) ṙ 1 (t), ṙ 2 (t),, ṙ N (t) MD a 1, a 2, a 3 r i (i =1,,n) 1 2 T =0K r i + m 1 a 1 + m 2 a 2 + m 3 a 3 (m 1,m 2,m 3 =0, ±1, ±2,,

More information

スライド 1

スライド 1 計算科学演習 MPI 基礎 学術情報メディアセンター情報学研究科 システム科学専攻中島浩 目次 プログラミングモデル SPMD 同期通信 / 非同期通信 MPI 概論 プログラム構造 Communicator & rank データ型 タグ 一対一通信関数 1 次元分割並列化 : 基本 基本的考え方 配列宣言 割付 部分領域交換 結果出力 1 次元分割並列化 : 高速化 通信 計算のオーバーラップ 通信回数削減

More information

26

26 26 FIPP FAPP I/O LAMMPS LJ atomic fluid 32,000 atoms for 100 timesteps FX10 4 16 / (FIPP) FIPP fipp - C - d dir/ - Ihwm,call - i10 mpiexec./a.out GUI, fipppx - A - d dir/ - Ihwm,cpu,balance,call,src

More information

スライド 1

スライド 1 High Performance and Productivity 並列プログラミング課題と挑戦 HPC システムの利用の拡大の背景 シュミレーションへの要求 より複雑な問題をより精度良くシュミレーションすることが求められている HPC システムでの並列処理の要求の拡大 1. モデル アルゴリズム 解析対象は何れもより複雑で 規模の大きなものになっている 2. マイクロプロセッサのマルチコア化 3.

More information

ÊÂÎó·×»»¤È¤Ï/OpenMP¤Î½éÊâ¡Ê£±¡Ë

ÊÂÎó·×»»¤È¤Ï/OpenMP¤Î½éÊâ¡Ê£±¡Ë 2015 5 21 OpenMP Hello World Do (omp do) Fortran (omp workshare) CPU Richardson s Forecast Factory 64,000 L.F. Richardson, Weather Prediction by Numerical Process, Cambridge, University Press (1922) Drawing

More information

86

86 86 86 86 main() {... } main() { main() { main() {......... } } } 86 main() { main() { main() {......... } } } main() { if(rank==)... } main() { if(rank==)... } main() { if(rank==x)... } 86 P(N) P(N) /

More information

main() {... } main() { main() { main() {......... } } } main() { main() { main() {......... } } } main() { if(rank==)... } main() { if(rank==)... } main() { if(rank==x)... } P(N) P(N) / P(M) * ( M / N

More information

第8回講義(2016年12月6日)

第8回講義(2016年12月6日) 2016/12/6 スパコンプログラミング (1) (Ⅰ) 1 行列 - 行列積 (2) 東京大学情報基盤センター准教授塙敏博 2016 年 12 月 6 日 ( 火 ) 10:25-12:10 2016/11/29 講義日程 ( 工学部共通科目 ) 1. 9 月 27 日 ( 今日 ): ガイダンス 2. 10 月 4 日 l 並列数値処理の基本演算 ( 座学 ) 3. 10 月 11 日 : スパコン利用開始

More information

Itanium2ベンチマーク

Itanium2ベンチマーク HPC CPU mhori@ile.osaka-u.ac.jp Special thanks Timur Esirkepov HPC 2004 2 25 1 1. CPU 2. 3. Itanium 2 HPC 2 1 Itanium2 CPU CPU 3 ( ) Intel Itanium2 NEC SX-6 HP Alpha Server ES40 PRIMEPOWER SR8000 Intel

More information

AHPを用いた大相撲の新しい番付編成

AHPを用いた大相撲の新しい番付編成 5304050 2008/2/15 1 2008/2/15 2 42 2008/2/15 3 2008/2/15 4 195 2008/2/15 5 2008/2/15 6 i j ij >1 ij ij1/>1 i j i 1 ji 1/ j ij 2008/2/15 7 1 =2.01/=0.5 =1.51/=0.67 2008/2/15 8 1 2008/2/15 9 () u ) i i i

More information

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë 2013 5 30 (schedule) (omp sections) (omp single, omp master) (barrier, critical, atomic) program pi i m p l i c i t none integer, parameter : : SP = kind ( 1. 0 ) integer, parameter : : DP = selected real

More information

GeoFEM開発の経験から

GeoFEM開発の経験から FrontISTR における並列計算のしくみ < 領域分割に基づく並列 FEM> メッシュ分割 領域分割 領域分割 ( パーティショニングツール ) 全体制御 解析制御 メッシュ hecmw_ctrl.dat 境界条件 材料物性 計算制御パラメータ 可視化パラメータ 領域分割ツール 逐次計算 並列計算 Front ISTR FEM の主な演算 FrontISTR における並列計算のしくみ < 領域分割に基づく並列

More information

about MPI

about MPI 本日 (4/16) の内容 1 並列計算の概要 並列化計算の目的 並列コンピュータ環境 並列プログラミングの方法 MPI を用いた並列プログラミング 並列化効率 2 並列計算の実行方法 Hello world モンテカルロ法による円周率計算 並列計算のはじまり 並列計算の最初の構想を イギリスの科学者リチャードソンが 1922 年に発表 < リチャードソンの夢 > 64000 人を円形の劇場に集めて

More information

インテル(R) Visual Fortran Composer XE 2011 Windows版 入門ガイド

インテル(R) Visual Fortran Composer XE 2011 Windows版 入門ガイド Visual Fortran Composer XE 2011 Windows* エクセルソフト株式会社 www.xlsoft.com Rev. 1.0 (2010/12/20) Copyright 1998-2011 XLsoft Corporation. All Rights Reserved. 1 / 36 ... 3... 4... 5... 7 /... 7... 9 /... 9...

More information

連載講座 : 高生産並列言語を使いこなす (5) 分子動力学シミュレーション 田浦健次朗 東京大学大学院情報理工学系研究科, 情報基盤センター 目次 1 問題の定義 17 2 逐次プログラム 分子 ( 粒子 ) セル 系の状態 ステップ 18

連載講座 : 高生産並列言語を使いこなす (5) 分子動力学シミュレーション 田浦健次朗 東京大学大学院情報理工学系研究科, 情報基盤センター 目次 1 問題の定義 17 2 逐次プログラム 分子 ( 粒子 ) セル 系の状態 ステップ 18 連載講座 : 高生産並列言語を使いこなす (5) 分子動力学シミュレーション 田浦健次朗 東京大学大学院情報理工学系研究科, 情報基盤センター 目次 1 問題の定義 17 2 逐次プログラム 17 2.1 分子 ( 粒子 ) 17 2.2 セル 17 2.3 系の状態 18 2.4 1ステップ 18 2.5 力の計算 19 2.6 速度と位置の更新 20 2.7 セル間の分子の移動 21 3 OpenMP

More information

Fundamental MPI 1 概要 MPI とは MPI の基礎 :Hello World 全体データと局所データタ グループ通信 (Collective Communication) 1 対 1 通信 (Point-to-Point Communication)

Fundamental MPI 1 概要 MPI とは MPI の基礎 :Hello World 全体データと局所データタ グループ通信 (Collective Communication) 1 対 1 通信 (Point-to-Point Communication) MPI 超 入門 (FORTRAN 編 ) 東京大学情報基盤センター Fundamental MPI 1 概要 MPI とは MPI の基礎 :Hello World 全体データと局所データタ グループ通信 (Collective Communication) 1 対 1 通信 (Point-to-Point Communication) Fundamental MPI 2 MPI とは (1/2)

More information

Microsoft PowerPoint - MPIprog-F2.ppt [互換モード]

Microsoft PowerPoint - MPIprog-F2.ppt [互換モード] MPI によるプログラミング概要 ( その ) Fortran 言語編 RIKEN AICS HPC Summer School 01 中島研吾 ( 東大 情報基盤センター ) 横川三津夫 ( 神戸大学 計算科学教育センター ) 1 概要 MPI とは MPI の基礎 :Hello World 全体データと局所データ グループ通信 (Collective Communication) 1 対 1 通信

More information

Microsoft PowerPoint - OpenMP入門.pptx

Microsoft PowerPoint - OpenMP入門.pptx OpenMP 入門 須田礼仁 2009/10/30 初版 OpenMP 共有メモリ並列処理の標準化 API http://openmp.org/ 最新版は 30 3.0 バージョンによる違いはあまり大きくない サポートしているバージョンはともかく csp で動きます gcc も対応しています やっぱり SPMD Single Program Multiple Data プログラム #pragma omp

More information

スライド 1

スライド 1 計算科学演習 MPI 基礎 学術情報メディアセンター 情報学研究科 システム科学専攻 中島浩 目次 プログラミングモデル SPMD 同期通信 / 非同期通信 MPI 概論 プログラム構造 Communicator & rank データ型 タグ 一対一通信関数 1 次元分割並列化 : 基本 基本的考え方 配列宣言 割付 部分領域交換 結果出力 1 次元分割並列化 : 高速化 通信 計算のオーバーラップ

More information

MPI 超 入門 (FORTRAN 編 ) 東京大学情報基盤センター C 言語編は以下 /ohshima/seminars/t2k201111/ (MPI による並列アプリケーション開発入門 2)

MPI 超 入門 (FORTRAN 編 ) 東京大学情報基盤センター C 言語編は以下   /ohshima/seminars/t2k201111/ (MPI による並列アプリケーション開発入門 2) MPI 超 入門 (FORTRAN 編 ) 東京大学情報基盤センター C 言語編は以下 http://www.cspp.cc.u-tokyo.ac.jp /ohshima/seminars/t2k201111/ (MPI による並列アプリケーション開発入門 2) Fundamental MPI 1 概要 MPI とは MPI の基礎 :Hello World 全体データと局所データ グループ通信 (Collective

More information

WinHPC ppt

WinHPC ppt MPI.NET C# 2 2009 1 20 MPI.NET MPI.NET C# MPI.NET C# MPI MPI.NET 1 1 MPI.NET C# Hello World MPI.NET.NET Framework.NET C# API C# Microsoft.NET java.net (Visual Basic.NET Visual C++) C# class Helloworld

More information

Microsoft PowerPoint - 講義:コミュニケータ.pptx

Microsoft PowerPoint - 講義:コミュニケータ.pptx コミュニケータとデータタイプ (Communicator and Datatype) 2019 年 3 月 15 日 神戸大学大学院システム情報学研究科横川三津夫 2019/3/15 Kobe HPC Spring School 2019 1 講義の内容 コミュニケータ (Communicator) データタイプ (Datatype) 演習問題 2019/3/15 Kobe HPC Spring School

More information

I

I I 1 2016.07.21 MPI OpenMP 84 1344 gnuplot Xming Tera term cp -r /tmp/160721 chmod 0 L x L y 0 k T (x, t) k: T t = k 2 T x 2 T t = s s : heat source 1D T (x, t) t = k 2 T (x, t) x 2 + s(x) 2D T (x,

More information

GPU GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1

GPU GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1 GPU 4 2010 8 28 1 GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1 Register & Shared Memory ( ) CPU CPU(Intel Core i7 965) GPU(Tesla

More information

ストリーミング SIMD 拡張命令2 (SSE2) を使用した SAXPY/DAXPY

ストリーミング SIMD 拡張命令2 (SSE2) を使用した SAXPY/DAXPY SIMD 2(SSE2) SAXPY/DAXPY 2.0 2000 7 : 248600J-001 01/12/06 1 305-8603 115 Fax: 0120-47-8832 * Copyright Intel Corporation 1999, 2000 01/12/06 2 1...5 2 SAXPY DAXPY...5 2.1 SAXPY DAXPY...6 2.1.1 SIMD C++...6

More information

統計数理研究所とスーパーコンピュータ

統計数理研究所とスーパーコンピュータ スーパーコンピュータと統計数理研究所 統計数理研究所 統計科学技術センターセンター長 中野純司 目次 スーパーコンピュータとは いったい何? 本当に スーパー?: ノートパソコンとの比較 どのように使う?: 仕組みとソフトウェア 統計数理研究所の ( スーパー ) コンピュータ 必要性 導入の歴史 現在の統数研スパコン : A, I, C 2/44 目次 スーパーコンピュータとは いったい何? 本当に

More information

Sae x Sae x 1: 1. {x (i) 0 0 }N i=1 (x (i) 0 0 p(x 0) ) 2. = 1,, T a d (a) i (i = 1,, N) I, II I. v (i) II. x (i) 1 = f (x (i) 1 1, v(i) (b) i (i = 1,

Sae x Sae x 1: 1. {x (i) 0 0 }N i=1 (x (i) 0 0 p(x 0) ) 2. = 1,, T a d (a) i (i = 1,, N) I, II I. v (i) II. x (i) 1 = f (x (i) 1 1, v(i) (b) i (i = 1, ( ) 1 : ( ) Sampling/Imporance resampling (SIR) Kiagawa (1993, 1996), Gordon(1993) EnKF EnKF EnKF 1CPU 1core 2 x = f (x 1, v ) y = h (x, w ) (1a) (1b) PF p(x y 1 ) {x (i) 1 }N i=1, p(x y ) {x (i) }N i=1

More information

Total View Debugger 利用の手引 東京工業大学学術国際情報センター version 1.0

Total View Debugger 利用の手引 東京工業大学学術国際情報センター version 1.0 Total View Debugger 利用の手引 東京工業大学学術国際情報センター 2015.04 version 1.0 目次 Total View Debugger 利用の手引き 1 1. はじめに 1 1.1 利用できるバージョン 1 1.2 概要 1 1.3 マニュアル 1 2. TSUBAME での利用方法 2 2.1 Total View Debugger の起動 2 (1) TSUBAMEにログイン

More information

untitled

untitled OS 2007/4/27 1 Uni-processor system revisited Memory disk controller frame buffer network interface various devices bus 2 1 Uni-processor system today Intel i850 chipset block diagram Source: intel web

More information

XMPによる並列化実装2

XMPによる並列化実装2 2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer

More information

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」 ALTIMA Company, MACNICA, Inc Nios II HAL API Modular Scatter-Gather DMA Core Ver.17.1 2018 8 Rev.1 Nios II HAL API Modular Scatter-Gather DMA Core...3...3...4... 4... 5 3-2-1. msgdma... 6 3-2-2. On-Chip

More information

名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL アライアンスパートナー コアテクノロジーパートナー NVIDIA JAPAN ソリュ

名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL   アライアンスパートナー コアテクノロジーパートナー NVIDIA JAPAN ソリュ GPUDirect の現状整理 multi-gpu に取組むために G-DEP チーフエンジニア河井博紀 (kawai@gdep.jp) 名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL http://www.gdep.jp アライアンスパートナー コアテクノロジーパートナー

More information

講義の流れ 並列プログラムの概要 通常のプログラムと並列プログラムの違い 並列プログラム作成手段と並列計算機の構造 OpenMP による並列プログラム作成 処理を複数コアに分割して並列実行する方法 MPI による並列プログラム作成 ( 午後 ) プロセス間通信による並列処理 処理の分割 + データの

講義の流れ 並列プログラムの概要 通常のプログラムと並列プログラムの違い 並列プログラム作成手段と並列計算機の構造 OpenMP による並列プログラム作成 処理を複数コアに分割して並列実行する方法 MPI による並列プログラム作成 ( 午後 ) プロセス間通信による並列処理 処理の分割 + データの ( 財 ) 計算科学振興財団 大学院 GP 大学連合による計算科学の最先端人材育成 第 1 回社会人向けスパコン実践セミナー資料 29 年 2 月 17 日 13:15~14:45 九州大学情報基盤研究開発センター 南里豪志 1 講義の流れ 並列プログラムの概要 通常のプログラムと並列プログラムの違い 並列プログラム作成手段と並列計算機の構造 OpenMP による並列プログラム作成 処理を複数コアに分割して並列実行する方法

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション OpenMP 並列解説 1 人が共同作業を行うわけ 田植えの例 重いものを持ち上げる 田おこし 代かき 苗の準備 植付 共同作業する理由 1. 短時間で作業を行うため 2. 一人ではできない作業を行うため 3. 得意分野が異なる人が協力し合うため ポイント 1. 全員が最大限働く 2. タイミングよく 3. 作業順序に注意 4. オーバーヘッドをなくす 2 倍率 効率 並列化率と並列加速率 並列化効率の関係

More information