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

Size: px
Start display at page:

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

Transcription

1 Rhpc COM-ONE 2015 R / 29

2 1 2 Rhpc 3 forign MPI 4 Windows 5 2 / 29

3 1 2 Rhpc 3 forign MPI 4 Windows 5 3 / 29

4 Rhpc, R HPC Rhpc, ( ), snow..., Rhpc worker call Rhpc lapply 4 / 29

5 1 2 Rhpc 3 forign MPI 4 Windows 5 5 / 29

6 Rhpc Rhpc SPMD...apply MPI Embedding R (libr ) Windows 6 / 29

7 Rhpc Rhpc 1 MPI Rhpc initialize Rhpc gethandle Rhpc finalize Rhpc numberofworker( ) Rhpc worker Rhpc worker call Rhpc Export Rhpc EvalQ 7 / 29

8 Rhpc Rhpc 2 Apply Rhpc lapply Rhpc lapplylb Rhpc setuprng Rhpc worker noback ( : MPI ) 8 / 29

9 Rhpc Rhpc 3 lapply Rhpc apply Rhpc sapply Rhpc sapplylb ( ) Rhpc serialize, Rhpc unserialize Rhpc enquote, Rhpc splitlist 9 / 29

10 Rhpc Many workers example (1): Rhpc Export and parallel::clusterexport(mpi) Export performance Rhpc::Rhpc_Export parallel::clusterexport(rmpi) sec Number of workers 10 / 29

11 Rhpc Many workers example (2A): Rhpc lapply* and parallel::clusterapply*(mpi) SQRT performance 1 sec Rhpc::Rhpc_lapply Rhpc::Rhpc_lapplyLB parallel::clusteraapply(rmpi+patch) parallel::clusteraapplylb(rmpi+patch) parallel::clusteraapply(rmpi) parallel::clusteraapplylb(rmpi) Number of workers 11 / 29

12 Rhpc Many workers example (2B): Rhpc lapply* and parallel::clusterapply*(mpi) SQRT performance 2 sec Rhpc::Rhpc_lapply Rhpc::Rhpc_lapplyLB parallel::clusteraapply(rmpi+patch) parallel::clusteraapplylb(rmpi+patch) Number of workers 12 / 29

13 Rhpc Many workers example (2C): Rhpc lapply* and parallel::clusterapply*(mpi) SQRT performance 3 sec Rhpc::Rhpc_lapply Rhpc::Rhpc_lapplyLB Number of workers 13 / 29

14 1 2 Rhpc 3 forign MPI 4 Windows 5 14 / 29

15 MPI MPI (C Fortran ) Master(rank0) Worker(rank1 ), SPMD. Rhpc MPI, MPI. Rhpc MPI. Rhpc lapply MPI. Rhpc, Rhpc worker noback. 15 / 29

16 Rhpc options Rhpc MPI options (options ). Rhpc.mpi.f.comm Fortran (R : ) Rhpc.mpi.c.comm C (R : ) Rhpc.mpi.procs MPI Rhpc.mpi.rank MPI 16 / 29

17 call of using.fortran,.c and.call from R Fortran C MPI R 1 mpipif<-function(n) 2 { 3 ## Exported functions get values by getoption() 4 ## when they run on workers 5 out<-.fortran("mpipif", 6 comm=getoption("rhpc.mpi.f.comm"), 7 n=as.integer(n), 8 outpi=as.double(0)) 9 out$outpi 10 } 1 mpipic<-function(n) 2 { 3 ## Exported functions get values by getoption() 4 ## when they run on workers 5 out<-.c("mpipic", 6 comm=getoption("rhpc.mpi.f.comm"), 7 n=as.integer(n), 8 outpi=as.double(0)) 9 out$outpi 10 } 1 mpipicall<-function(n) 2 { 3 ## Exported functions get values by getoption() 4 ## when they run on workers 5 out<-.call("mpipicall", 6 comm=getoption("rhpc.mpi.c.comm"), 7 n=as.integer(n)) 8 out 9 }.C R Fortran. C.Call. see help(.c) 17 / 29

18 Changing MPI Fortran code for.fortran in R. program main subroutine mpipif(mpi_comm,n,outpi) include "mpif.h" include "mpif.h" double precision mypi, sumpi double precision mypi, sumpi double precision h, sum, x, f, a double precision h, sum, x, f, a double precision pi double precision pi parameter (pi= ) parameter (pi= ) integer n, rank, procs, i, ierr integer n, rank, procs, i, ierr character*16 argv integer mpi_comm integer argc double precision outpi f(a) 4.d0 / (1.d0 + a*a) argc = COMMAND_ARGUMENT_COUNT() < f(a) = 4.d0 / (1.d0 + a*a) n=0 if (argc.ge. 1) then < call getarg(1, argv) < read(argv,*) n < endif < c call MPI_INIT(ierr) < COMM c COMM call MPI_COMM_RANK(MPI_COMM_WORLD, call MPI_COMM_RANK(mpi_comm, & rank, ierr) & rank, ierr) call MPI_COMM_SIZE(MPI_COMM_WORLD, call MPI_COMM_SIZE(mpi_comm, & procs, ierr) & procs, ierr) call MPI_BCAST(n,1,MPI_INTEGER,0, call MPI_BCAST(n,1,MPI_INTEGER,0, & MPI_COMM_WORLD,ierr) & mpi_comm,ierr) if ( n.le. 0 ) goto 30 if ( n.le. 0 ) goto 30 h = 1.0d0/n h = 1.0d0/n sum = 0.0d0 sum = 0.0d0 do 20 i = rank+1, n, procs do 20 i = rank+1, n, procs 20 x = h * (dble(i) - 0.5d0) x = h * (dble(i) - 0.5d0) sum = sum + f(x) sum = sum + f(x) continue 20 continue mypi = h * sum mypi = h * sum call MPI_REDUCE(mypi,sumpi,1, call MPI_REDUCE(mypi,sumpi,1, & MPI_DOUBLE_PRECISION, MPI_SUM,0, & MPI_DOUBLE_PRECISION, MPI_SUM,0, & MPI_COMM_WORLD,ierr) & mpi_comm,ierr) if (rank.eq. 0) then outpi=sumpi print *, pi =, sumpi 30 continue 30 endif return call MPI_FINALIZE(ierr) stop < end end 18 / 29

19 Changing MPI C code for.c in R. #include "mpi.h" #include "mpi.h" #include <stdio.h> #include <stdio.h> #include <math.h> #include <math.h> #include <R.h> > #include <Rinternals.h> int main( int argc, char *argv[] ) int mpipic( int *comm, int *N, double *outpi ) { > { MPI_Comm mpi_comm; int n=0, rank, procs, i; int n=0, rank, procs, i; double mypi, pi, h, sum, x; double mypi, pi, h, sum, x; if ( argc >= 2){ mpi_comm = MPI_Comm_f2c(*comm); n = atoi(argv[1]); n = *N; } < MPI_Init(&argc,&argv); < // COMM MPI_Comm_size(MPI_COMM_WORLD,&procs); // COMM MPI_Comm_size(mpi_comm, &procs); MPI_Comm_rank(MPI_COMM_WORLD,&rank); MPI_Comm_rank(mpi_comm, &rank); MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD); MPI_Bcast(&n, 1, MPI_INT, 0, mpi_comm); h 1.0 / (double) n; sum = 0.0; h 1.0 / (double) n; sum = 0.0; for (i = rank + 1; i <= n; i += procs) { for (i = rank + 1; i <= n; i += procs) { x = h * ((double)i - 0.5); x = h * ((double)i - 0.5); sum += (4.0 / (1.0 + x*x)); sum += (4.0 / (1.0 + x*x)); } mypi = h * sum; } mypi = h * sum; MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); mpi_comm); if (rank == 0) *outpi=pi; printf("pi = %.16f\n", pi); < MPI_Finalize(); < return(0); return(0); } } 19 / 29

20 Changing MPI C code for.call in R. #include "mpi.h" #include "mpi.h" #include <stdio.h> #include <stdio.h> #include <math.h> #include <math.h> #include <R.h> > #include <Rinternals.h> int main( int argc, char *argv[] ) SEXP mpipicall(sexp comm, SEXP N) { > { MPI_Comm mpi_comm; int n=0, rank, procs, i; > SEXP ret; int n=0, rank, procs, i; double mypi, pi, h, sum, x; double mypi, pi, h, sum, x; if ( argc >= 2){ mpi_comm = *((MPI_Comm*)R_ExternalPtrAddr(comm)); n = atoi(argv[1]); PROTECT(ret=allocVector(REALSXP,1)); } n = INTEGER(N)[0]; MPI_Init(&argc,&argv); < // COMM MPI_Comm_size(MPI_COMM_WORLD,&procs); // COMM MPI_Comm_size(mpi_comm, &procs); MPI_Comm_rank(MPI_COMM_WORLD,&rank); MPI_Comm_rank(mpi_comm, &rank); MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD); MPI_Bcast(&n, 1, MPI_INT, 0, mpi_comm ); h 1.0 / (double) n; sum = 0.0; h 1.0 / (double) n; sum = 0.0; for (i = rank + 1; i <= n; i += procs) { for (i = rank + 1; i <= n; i += procs) { x = h * ((double)i - 0.5); x = h * ((double)i - 0.5); sum += (4.0 / (1.0 + x*x)); sum += (4.0 / (1.0 + x*x)); } mypi = h * sum; } mypi = h * sum; MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); mpi_comm ); if (rank == 0) REAL(ret)[0]=pi; printf("pi = %.16f\n", pi); UNPROTECT(1); MPI_Finalize(); return(ret); return(0); < } } 20 / 29

21 Call foreign MPI program from R 1 source("mpipicall.r") 2 source("mpipic.r") 3 source("mpipif.r") 4 5 library(rhpc) 6 Rhpc_initialize() 7 cl<-rhpc_gethandle(4) 8 9 n< ## Load shared library 12 Rhpc_worker_call(cl,dyn.load,"pi.so"); dyn.load("pi.so") ## Rhpc_worker_noback calls a function, but does not 15 ## get any result. 16 ## Workers should be started faster than a master. 17 Rhpc_worker_noback(cl,mpipicall,n); mpipicall(n) 18 Rhpc_worker_noback(cl,mpipic,n); mpipic(n) 19 Rhpc_worker_noback(cl,mpipif,n); mpipif(n) Rhpc_finalize() 21 / 29

22 1 2 Rhpc 3 forign MPI 4 Windows 5 22 / 29

23 Windows Rhpc CRAN Windows MPI MS-MPI, MS-MPI Rhpc Windows CRAN MS-MPI MS-MPIv4.2 MS-MPI MS-MPIv7 MS-MPI v5 SDK 64bit def link mpiexec MPI, SDK Rhpc, MS-MPI 23 / 29

24 Windows Rhpc: 1 Windows Rhpc: 1 C:\Users\boofoo> mpiexec.exe -env PATH "C:\Program Files\R\R-3.2.2\bin\x64;%PATH%" -n 1 CMD /C "C:\Program Files\R\R-3.2.2\bin\x64\Rgui.exe" : -env PATH "C:\Program Files\R\R-3.2.2\bin\x64;%PATH%" -n 3 "%USERPROFILE%\Documents\R\win-library\3.2\Rhpc\RhpcWorker64.exe" / 29

25 Windows Rhpc: 2 Windows Rhpc: 2 C:\Users\boofoo> Documents\R\win-library\3.2\Rhpc\RhpcWin64.cmd, ( ) NPROCS ( ) OMP NUM THREADS (1) R HOME ( ) R VER ( ) 25 / 29

26 Windows Rhpc: Windows Rhpc: > library(rhpc) > Rhpc initialize() rank 0/ 4( ) : hostname : 2152 > cl <- Rhpc gethandle() # Detected communication size 4 26 / 29

27 Windows Rhpc: Windows64bit 4 (1 Master 3 Worker).,, export MPI., *lapply. parallel(sock) Rhpc Transfer of matrix by *export 1.54sec 1.39sec times of calc sqrt by *lapply 0.70sec 0.08sec times of calc sqrt by *lapplylb 0.91sec 0.11sec 27 / 29

28 1 2 Rhpc 3 forign MPI 4 Windows 5 28 / 29

29 R R Rhpc. Rhpc MPI Rhpc,. 29 / 29

目 目 用方 用 用 方

目 目 用方 用 用 方 大 生 大 工 目 目 用方 用 用 方 用 方 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

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

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

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

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

±é½¬£²¡§£Í£Ð£É½éÊâ 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

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

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

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

コードのチューニング

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

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

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

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

NUMAの構成

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

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

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

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

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó  ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý (2018) 2018 7 5 f(x) [ 1, 1] 3 3 1 3 f(x) dx c i f(x i ) 1 0 i=1 = 5 ) ( ) 3 ( 9 f + 8 5 9 f(0) + 5 3 9 f 5 1 1 + sin(x) θ ( 1 θ dx = tan 1 + sin x 2 π ) + 1 4 1 3 [a, b] f a, b double G3(double (*f)(),

More information

115 9 MPIBNCpack 9.1 BNCpack 1CPU X = , B =

115 9 MPIBNCpack 9.1 BNCpack 1CPU X = , B = 115 9 MPIBNCpack 9.1 BNCpack 1CPU 1 2 3 4 5 25 24 23 22 21 6 7 8 9 10 20 19 18 17 16 X = 11 12 13 14 15, B = 15 14 13 12 11 16 17 18 19 20 10 9 8 7 6 21 22 23 24 25 5 4 3 2 1 C = XB X dmat1 B dmat2 C dmat

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

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

DKA ( 1) 1 n i=1 α i c n 1 = 0 ( 1) 2 n i 1 <i 2 α i1 α i2 c n 2 = 0 ( 1) 3 n i 1 <i 2 <i 3 α i1 α i2 α i3 c n 3 = 0. ( 1) n 1 n i 1 <i 2 < <i

DKA ( 1) 1 n i=1 α i c n 1 = 0 ( 1) 2 n i 1 <i 2 α i1 α i2 c n 2 = 0 ( 1) 3 n i 1 <i 2 <i 3 α i1 α i2 α i3 c n 3 = 0. ( 1) n 1 n i 1 <i 2 < <i 149 11 DKA IEEE754 11.1 DKA n p(x) = a n x n + a n 1 x n 1 + + a 0 (11.1) p(x) = 0 (11.2) p n (x) q n (x) = x n + c n 1 x n 1 + + c 1 x + c 0 q n (x) = 0 (11.3) c i = a i a n (i = 0, 1,..., n 1) (11.3)

More information

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

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

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

MPI

MPI 筑波大学計算科学研究センター CCS HPC サマーセミナー MPI 建部修見 tatebe@cs.tsukuba.ac.jp 筑波大学大学院システム情報工学研究科計算科学研究センター 分散メモリ型並列計算機 (PC クラスタ ) 計算ノードはプロセッサとメモリで構成され, 相互結合網で接続 ノード内のメモリは直接アクセス 他ノードとはネットワーク通信により情報交換 いわゆるPCクラスタ 相互結合網

More information

MPI コミュニケータ操作

MPI コミュニケータ操作 コミュニケータとデータタイプ 辻田祐一 (RIKEN AICS) 講義 演習内容 MPI における重要な概念 コミュニケータ データタイプ MPI-IO 集団型 I/O MPI-IO の演習 2 コミュニケータ MPI におけるプロセスの 集団 集団的な操作などにおける操作対象となる MPI における集団的な操作とは? 集団型通信 (Collective Communication) 集団型 I/O(Collective

More information

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

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

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

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

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

コードのチューニング

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

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

chap2.ppt

chap2.ppt 2. メッセージ通信計算 2.1 メッセージ通信プログラミングの基本 プログラミングの選択肢 特別な並列プログラミング言語を設計する occam (Inmos, 1984, 1986) 既存の逐次言語の文法 / 予約語をメッセージ通信を処理できるように拡張する 既存の逐次言語を用い メッセージ通信のための拡張手続のライブラリを用意する どのプロセスを実行するのか メッセージ通信のタイミング 中身を明示的に指定する必要がある

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

<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

num2.dvi

num2.dvi kanenko@mbk.nifty.com http://kanenko.a.la9.jp/ 16 32...... h 0 h = ε () 0 ( ) 0 1 IEEE754 (ieee754.c Kerosoft Ltd.!) 1 2 : OS! : WindowsXP ( ) : X Window xcalc.. (,.) C double 10,??? 3 :, ( ) : BASIC,

More information

86 8 MPIBNCpack 15 : int n, myid, numprocs, i; 16 : double pi, start_x, end_x; 17 : double startwtime = 0.0, endwtime; 18 : int namelen; 19 : char pro

86 8 MPIBNCpack 15 : int n, myid, numprocs, i; 16 : double pi, start_x, end_x; 17 : double startwtime = 0.0, endwtime; 18 : int namelen; 19 : char pro 85 8 MPIBNCpack 1CPU BNCpack MPIBNCpack 1 1 8.1 5.2 (5.1) f (a), f (b), f (x i ) PE reduce 1 0 1 1 + x 2 dx = π 4 mpi-int.c mpi-int-gmp.c mpi-int.c 2 : #include 3 : #include "mpi.h" 5 : 6 : #include

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

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

Krylov (b) x k+1 := x k + α k p k (c) r k+1 := r k α k Ap k ( := b Ax k+1 ) (d) β k := r k r k 2 2 (e) : r k 2 / r 0 2 < ε R (f) p k+1 :=

Krylov (b) x k+1 := x k + α k p k (c) r k+1 := r k α k Ap k ( := b Ax k+1 ) (d) β k := r k r k 2 2 (e) : r k 2 / r 0 2 < ε R (f) p k+1 := 127 10 Krylov Krylov (Conjugate-Gradient (CG ), Krylov ) MPIBNCpack 10.1 CG (Conjugate-Gradient CG ) A R n n a 11 a 12 a 1n a 21 a 22 a 2n A T = =... a n1 a n2 a nn n a 11 a 21 a n1 a 12 a 22 a n2 = A...

More information

情報処理概論(第二日目)

情報処理概論(第二日目) 1 並列プログラミング超入門講習会 九州大学情報基盤研究開発センター MPI コース 2 並列計算機の構成 計算ノード ネットワーク CPU コア メモリ アクセラレータ (GPU 等 ) 例 : スーパーコンピュータシステム ITO サブシステム B ノード数 CPU 数 / ノードコア数 / CPU GPU 数 / ノード 128 2 18 4 MPI (Message Passing Interface)

More information

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 (Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 17 Fortran Formular Tranlator Lapack Fortran FORTRAN, FORTRAN66, FORTRAN77, FORTRAN90, FORTRAN95 17.1 A Z ( ) 0 9, _, =, +, -, *,

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

スライド 1

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

More information

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru 43 6 MPI MPI(Message Passing Interface) MPI 1CPU/1 PC Cluster MPICH[5] 6.1 MPI MPI MPI 1 : #include 2 : #include 3 : #include 4 : 5 : #include "mpi.h" 7 : int main(int argc,

More information

スライド 1

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

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

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

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

58 7 MPI 7 : main(int argc, char *argv[]) 8 : { 9 : int num_procs, myrank; 10 : double a, b; 11 : int tag = 0; 12 : MPI_Status status; 13 : 1 MPI_Init

58 7 MPI 7 : main(int argc, char *argv[]) 8 : { 9 : int num_procs, myrank; 10 : double a, b; 11 : int tag = 0; 12 : MPI_Status status; 13 : 1 MPI_Init 57 7 MPI MPI 1 1 7.1 Bcast( ) allocate Bcast a=1 PE0 a=1 PE1 a=1 PE2 a=1 PE3 7.1: Bcast 58 7 MPI 7 : main(int argc, char *argv[]) 8 : { 9 : int num_procs, myrank; 10 : double a, b; 11 : int tag = 0; 12

More information

XACC講習会

XACC講習会 www.xcalablemp.org 1 4, int array[max]; #pragma xmp nodes p(*) #pragma xmp template t(0:max-1) #pragma xmp distribute t(block) onto p #pragma xmp align array[i] with t(i) int array[max]; main(int argc,

More information

GNU開発ツール

GNU開発ツール 高性能並列プログラミング環境 プログラミング環境特論 2011 年 1 月 20 日 建部修見 分散メモリ型計算機 CPU CPU CPU とメモリという一つの計算機システムが ネットワークで結合されているシステム MEM CPU Network MEM CPU それぞれの計算機で実行されているプログラムはネットワークを通じて データ ( メッセージ ) を交換し 動作する MEM MEM 超並列

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² –

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² – (2018) 11 2018 12 13 2 g v dv x dt = bv x, dv y dt = g bv y (1) b v 0 θ x(t) = v 0 cos θ ( 1 e bt) (2) b y(t) = 1 ( v 0 sin θ + g ) ( 1 e bt) g b b b t (3) 11 ( ) p14 2 1 y 4 t m y > 0 y < 0 t m1 h = 0001

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

More information

内容に関するご質問は まで お願いします [Oakforest-PACS(OFP) 編 ] 第 85 回お試しアカウント付き並列プログラミング講習会 ライブラリ利用 : 科学技術計算の効率化入門 スパコンへのログイン テストプログラム起動 東京大学情報基盤セ

内容に関するご質問は まで お願いします [Oakforest-PACS(OFP) 編 ] 第 85 回お試しアカウント付き並列プログラミング講習会 ライブラリ利用 : 科学技術計算の効率化入門 スパコンへのログイン テストプログラム起動 東京大学情報基盤セ 内容に関するご質問は ida@cc.u-tokyo.ac.jp まで お願いします [Oakforest-PACS(OFP) 編 ] 第 85 回お試しアカウント付き並列プログラミング講習会 ライブラリ利用 : 科学技術計算の効率化入門 スパコンへのログイン テストプログラム起動 東京大学情報基盤センター特任准教授伊田明弘 1 講習会 : ライブラリ利用 [FX10] スパコンへのログイン ファイル転送

More information

11042 計算機言語7回目 サポートページ:

11042 計算機言語7回目  サポートページ: 11042 7 :https://goo.gl/678wgm November 27, 2017 10/2 1(print, ) 10/16 2(2, ) 10/23 (3 ) 10/31( ),11/6 (4 ) 11/13,, 1 (5 6 ) 11/20,, 2 (5 6 ) 11/27 (7 12/4 (9 ) 12/11 1 (10 ) 12/18 2 (10 ) 12/25 3 (11

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

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

Microsoft PowerPoint 並列アルゴリズム04.ppt

Microsoft PowerPoint 並列アルゴリズム04.ppt 並列アルゴリズム 2005 年後期火曜 2 限 青柳睦 Aoyagi@cc.kyushu-u.ac.jp http://server-500.cc.kyushu-u.ac.jp/ 11 月 8 日 ( 火 ) 5. MPI の基礎 6. 並列処理の性能評価 1 もくじ 1. 序並列計算機の現状 2. 計算方式およびアーキテクチュアの分類 3. 並列計算の目的と課題 4. 数値計算における各種の並列化

More information

1.overview

1.overview 村井均 ( 理研 ) 2 はじめに 規模シミュレーションなどの計算を うためには クラスタのような分散メモリシステムの利 が 般的 並列プログラミングの現状 半は MPI (Message Passing Interface) を利 MPI はプログラミングコストが きい 標 性能と 産性を兼ね備えた並列プログラミング 語の開発 3 並列プログラミング 語 XcalableMP 次世代並列プログラミング

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó  ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡ (2018) 2018 5 17 0 0 if switch if if ( ) if ( 0) if ( ) if ( 0) if ( ) (0) if ( 0) if ( ) (0) ( ) ; if else if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 (0) 2 if else

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

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

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

スライド 1

スライド 1 Parallel Programming in MPI part 2 1 1 Today's Topic ノンブロッキング通信 Non-Blocking Communication 通信の完了を待つ間に他の処理を行う Execute other instructions while waiting for the completion of a communication. 集団通信関数の実装 Implementation

More information

08 p Boltzmann I P ( ) principle of equal probability P ( ) g ( )g ( 0 ) (4 89) (4 88) eq II 0 g ( 0 ) 0 eq Taylor eq (4 90) g P ( ) g ( ) g ( 0

08 p Boltzmann I P ( ) principle of equal probability P ( ) g ( )g ( 0 ) (4 89) (4 88) eq II 0 g ( 0 ) 0 eq Taylor eq (4 90) g P ( ) g ( ) g ( 0 08 p. 8 4 k B log g() S() k B : Boltzmann T T S k B g g heat bath, thermal reservoir... 4. I II II System I System II II I I 0 + 0 const. (4 85) g( 0 ) g ( )g ( ) g ( )g ( 0 ) (4 86) g ( )g ( 0 ) 0 (4

More information

tuat1.dvi

tuat1.dvi ( 1 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 6 23 ( 1 ) 1 / 58 C ( 1 ) 2 / 58 2008 9 2002 2005 T E X ptetex3, ptexlive pt E X UTF-8 xdvi-jp 3 ( 1 ) 3 / 58 ( 1 ) 4 / 58 C,... ( 1 ) 5 / 58 6/23( )

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

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

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó  ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡ (2018) 2018 5 24 ( ) while ( ) do while ( ); for ( ; ; ) while int i = 0; while (i < 100) { printf("i = %3d\n", i); i++; while int i = 0; i while (i < 100) { printf("i = %3d\n", i); i++; while int i =

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

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

untitled

untitled OpenMP MPI OpenMPI 1 2 http://www.es.jamstec.go.jp/ 3 4 http://www.top500.org/ CPU 3GHz, 10GHz 90nm 65nm, 45nm VLIW L3 Intel Hyperthreading CPU Pentium 5 6 7 8 Cell 23400 90nm 221mm2 SPU 1.52Moore s Law

More information

スライド 1

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

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/ 10 月 18( 火 ) 4. 数値計算における各種の並列化 5. MPI の基礎 1 講義の概要 並列計算機や計算機クラスターなどの分散環境における並列処理の概論 MPI および OpenMP による並列計算 理工学分野の並列計算アルゴリズム

More information

sim98-8.dvi

sim98-8.dvi 8 12 12.1 12.2 @u @t = @2 u (1) @x 2 u(x; 0) = (x) u(0;t)=u(1;t)=0fort 0 1x, 1t N1x =1 x j = j1x, t n = n1t u(x j ;t n ) Uj n U n+1 j 1t 0 U n j =1t=(1x) 2 = U n j+1 0 2U n j + U n j01 (1x) 2 (2) U n+1

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

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

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

演習準備

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

More information

Fujitsu Standard Tool

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

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

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

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

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

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

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

More information

1F90/kouhou_hf90.dvi

1F90/kouhou_hf90.dvi Fortran90 3 33 1 2 Fortran90 FORTRAN 1956 IBM IBM704 FORTRAN(FORmula TRANslation ) 1965 FORTRAN66 1978 FORTRAN77 1991 Fortran90 Fortran90 Fortran Fortran90 6 Fortran90 77 90 90 Fortran90 [ ] Fortran90

More information

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

Java updated

Java updated Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................

More information

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in C 1 / 21 C 2005 A * 1 2 1.1......................................... 2 1.2 *.......................................... 3 2 4 2.1.............................................. 4 2.2..............................................

More information

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf ("%s", str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf (%s, str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i ABC066 / ARC077 writer: nuip 2017 7 1 For International Readers: English editorial starts from page 8. A : ringring a + b b + c a + c a, b, c a + b + c 1 # include < stdio.h> 2 3 int main (){ 4 int a,

More information

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

Microsoft PowerPoint - MPIprog-C1.ppt [互換モード] MPI によるプログラミング概要 ( その 1) C 言語編 RIKEN AICS HPC Summer School 2015 中島研吾 ( 東大 情報基盤センター ) 横川三津夫 ( 神戸大 計算科学教育センター ) 1 本 school の目的 並列計算機の使用によって, より大規模で詳細なシミュレーションを高速に実施することが可能になり, 新しい科学の開拓が期待される 並列計算の目的 高速

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

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B A/B (2010/10/08) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2010/soft/soft.html 2010 10 8 A/B 1 2010 10 8 2 1 1 1.1 OHP.................................... 1 1.2.......................................

More information

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0) E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2

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

untitled

untitled Fortran90 ( ) 17 12 29 1 Fortran90 Fortran90 FORTRAN77 Fortran90 1 Fortran90 module 1.1 Windows Windows UNIX Cygwin (http://www.cygwin.com) C\: Install Cygwin f77 emacs latex ps2eps dvips Fortran90 Intel

More information