Parallel Programming 박필성 IT 대학컴퓨터학과

Size: px
Start display at page:

Download "Parallel Programming 박필성 IT 대학컴퓨터학과"

Transcription

1 Parallel Programming 박필성 IT 대학컴퓨터학과

2 목차 Why Parallel? Parallel Computers Parallel Processing Parallel Programming Models Parallel Programming OpenMP Standard MPI Standard Related Topics & Questions

3 Why Parallel? (1) Why parallel computing? 전통적인 compute-intensive applications 기상예보, 전산유체역학, 화학, 천문학, 다양한공학문제 새로운 data-intensive applications video servers, data mining 미래의 high performance applications VR, 협업환경, CAD Save time and/or money. Solve large problems. Provide concurrency. Use of non-local resources Limits to serial computing

4 Why Parallel? (2) Atmosphere, Earth, Environment Physics - applied, nuclear, particle, condensed matter, high pressure, fusion, photonics Bioscience, Biotechnology, Genetics Chemistry, Molecular Sciences Geology, Seismology Mechanical Engineering - from prosthetics to spacecraft Electrical Engineering, Circuit Design, Microelectronics Computer Science, Mathematics

5 Why Parallel? (3) Databases, data mining Oil exploration Web search engines, web based business services Medical imaging and diagnosis Pharmaceutical design Management of national and multi-national corporations Financial and economic modeling Advanced graphics and virtual reality, particularly in the entertainment industry Networked video and multi-media technologies Collaborative work environments

6 Why Parallel? (4) Computer 의물리적한계 ( 계속 ) 현재 CPU 의 clock speed 는대략 3GHz - 발열문제 - 반도체소자의문제 1 Tera Hz(1 x 10^12 Hz) 의 computer 는가능한가? 광속 c = 3 x 10^8 m/sec = 3 x 10^11 mm/sec CPU 와 memory 사이의거리를 r 이라고하면 r < c / 10^12 = 0.3 mm!! 1 Tera byte(=10^6 x 10^6 bytes) 의 memory 가지려면 1 byte 는 3A x 3A 이내에저장되어야!! Computer 의성능높아질수록가격은기하급수적으로상승 하나의고가시스템보다여러개의저가시스템을사용하여병렬처리하는것이대안

7 Why Parallel? (5) Computer 의물리적한계 ( 계속 ) 2004 년까지 SW 개선없이도 HW 발전에따라수혜 CPU clock 의증가 : 2000 년대초반까지기하급수적으로증가 CPU 실행시간최적화 : CPU 명령어의순차실행최적화 (pipeline, 분기예측, out-of-order execution 등 ) Cache 크기증가 The free lunch is over: A fundamental turn toward concurrency in SW (Hurb Sutter, 2005) 전력소모및발열문제 : clock 속도의제곱 ( 세제곱?) Clock 속도증가 짧은도선 CPU 의신뢰도하락 2004 년부터 CPU 제조사들은 clock 속도경쟁포기 CPU : single core multi-core GPU : many-core

8 Parallel Computers (1) Parallel computer 정의 * 다수의 CPU 가다수의프로그램혹은분할된프로그램을동시에처리하는컴퓨터 * 다수의 CPU 를결합하여단일 CPU 성능의한계를극복하기위한컴퓨터구조 다양한분류방법이있으나, 메모리공유에따른분류는 * SMP(Symmetric Multi Processing) * MPP(Massively Parallel Processing) * NUMA(Non-Uniform Memory Access) ** Cluster computer (workstation, PC, ) - 개인 PC 나소형 server 등을 network 장비를사용하여다수연결하여구성한일종의병렬처리용 supercomputer - 저렴한가격 ( 상용 supercomputer 의 1/10), 확장성, 유연성

9 Parallel Computers (2) 2012 년 11 월 Top500 에따른 HPC 시장의구성비 (1993-)

10 Parallel Computers (3) 2012 년 11 월 Top500 에따른 HPC 시장의구성비 (1993-)

11 Parallel Computers (4) 2012 년 11 월 Top500 에따른 HPC 시장의구성비 (1993-)

12 Parallel Computers (5) PC Cluster 소형 PC 나 PC 서버를수십대에서수천대까지병렬네트워크로연결해슈퍼컴퓨터에상응하는고성능컴퓨팅 (HPC) 을구현하는기술 최초 NASA CESDIS Beowulf : 16-node Intel DX4 processors

13 Parallel Computers (6) Computer architecture 구분

14 Parallel Processing (1) 병렬처리 (parallel processing) 란? 복수의처리장치를사용하여, 모든처리장치가하나의프로그램상의서로다른태스크를동시에처리함으로써처리의부하를분담하여처리속도를향상시키는방법 여러개의프로그램을동시에병렬처리하는다중처리 ( multiprocessing) 와는다름

15 Parallel Processing (2) 병렬처리의장단점 장점 - program 의실제실행시간 (wall-clock time) 감소 - 해결할수있는문제의규모증대 단점 - 추가적인 overhead 소요 - 프로그래밍이어려움 - 모든문제에효율적으로적용되는것이아님 병렬처리의예 일상생활 / 회사에서의예 벽에페인트칠하기 병렬처리쉬움 고도의수학문제풀기 병렬처리어려움 / 불가능 / 무의미

16 Parallel Processing (3) 병렬처리관련용어 program disk 에 file 로저장되어있는일련의명령어의모음 processor(=cpu) single(1), dual(2), quad(4), hexa(6), octa(8), deca(10), magni(12) CPU core : CPU 의핵심부분 task OS 관점에서본독립적인실행작업의단위 process - 실행가능한 program 이호출되어 OS 의실행제어상태에놓인것. - 각 process 는 program code, data, stack, register 등의독립적인자원과주소공간을가진다. - 일반적으로하나의 program 이실행될때다수의 process 생성. thread - OS 에서제어하는가장작은작업단위의하나로 process 에포함되어실행. - 즉하나의 process 안에서동일한 text( 문맥 ) 을사용하는작업단위 - 독립적인제어의흐름으로프로그램에대한 CPU 시간할당의단위가된다

17 Parallel Processing (4) process 와 thread processor 는한번에하나의 process 만사용가능 processor 를다른 process 에게넘겨줄때 context switch( 문맥교환 ) 현재실행중인 process 의상태를저장하고다른 process 를실행시키기위한처리과정이필요. * task context (process, thread ) the minimal set of data used by the task that must be saved to allow a task interruption + the configuration of the task process 는독립적인작업단위로수행되나컴퓨터기술의발전으로 process 는보다작은작업단위인 thread 로분류되어수행될수있게되었다. process scheduling 과 thread scheduling - 각 process 는서로다른 text 를사용하나 thread 는 text 를공유 - 하나의 process 안에서각 thread 는모두동일한 text 를공유하므로하나의 process 안에서 thread 의교체가일어나는경우 text 를교체할필요가없으므로보다빠르게작업을교체하여실행가능 - 따라서효율적인자원할당과문맥교환으로인해 thread 단위의 program 실행은 process 단위의실행보다더나은성능보인다.

18 Parallel Programming Models (1) Why parallel programming model? 병렬연산에서는 process( 혹은 thread) 간에 data 전달필요. 시스템의 hardware 구조에따른적절한 programming model 선택해야 Shared memory system - 모든 CPU 는메모리를공유 한 CPU 가다른 CPU 에 data 를전달하려면단순히공유메모리에 write 다른 CPU 가 read programming 이쉽다. - memory contention CPU 개수에한계 Distributed memory system - 모든 CPU 는독립된메모리사용 다른 CPU 에 data 를전달하려면명시적인통신필요 programming 어렵다. - memory contention 없으므로시스템확장용이

19 Parallel Programming Models (2) 1) 공유메모리병렬프로그래밍모델 하나의 process 에속한 thread 들은시스템자원을공유하므로다중 thread program 이공유메모리아키텍쳐에적합. - POSIX thread(p-thread) : 사용자가 thread 생성및작업할당제어 - OpenMP : source program 에 compiler 지시어를삽입하여다중 thread 실행 program 을생성 단일 thread process 와다중 thread process.

20 Parallel Programming Models (3) 2) Message passing 병렬프로그래밍모델 병렬시스템을구성하는 node 들이주소공간을공유하지않는다면각 process 는다른 process 들이갱신하는 data 에접근하기위해 network 을통해 data 를주고받아야한다. - HPF(High Performance FORTRAN) - PVM(Parallel Virtual Machine) - MPI (Message Passing Interface) Message Passing

21 Parallel Programming Models (4) 3) Hybrid 병렬프로그래밍모델 SMP cluster 와분산 - 공유메모리아키텍처를가지는시스템에서는공유메모리모델의특징과 message passing 모델의특성을모두살리는 hybrid 모델이적합 하나의 program 내에서공유메모리모델과 message passing model 을모두이용하여 programming 하는것을말함 ex. OpenMP + MPI 하나의 node 에단일 thread 를가지는여러 process 생성의예

22 Parallel Programming Models (5) SPMD vs. MPMD SPMD (Single Program Multiple Data) 병렬프로그램을수행하는모든 process 또는 thread 가동일한하나의프로그램을실행하면서 - 프로그램내의함수를서로다른 data 를가지고병렬로실행하거나 (domain 분해 ) - 서로각기다른함수를맡아병렬로실행한다 ( 기능적분해 ) MPMD (Multiple Program Multiple Data) 여러개의프로그램으로구성되며, 각 process 또는 thread 가서로다른프로그램을실행하면서프로그램이필요로하는 data 를통신을통해주고받는다. SPMD MPMD

23 Parallel Programming (1) 병렬프로그래밍에서고려되어야할사항 data 의존성 (dependency) 의문제 근본적인의존성이있는경우는병렬화불가의존성을피하며병렬화 교착 (deadlock) 의문제 확장성 (scalability) 이좋도록작성해야 고른작업분배가중요 : 모두가동시에작업이끝나야 I/O 문제 : 입출력은하나의 worker 가담당해야 모든 worker 의작업및진도를어떻게 control? 동기화 (synchronization) 의문제 어떻게 worker 간에정보 ( 즉 data) 를주고받을것인가? shared memory vs. distributed memory program 을어떻게작성할것인가? - SPMD(single program multiple data) - MPMD(multiple program multiple data)

24 Parallel Programming (2) 병렬처리문제 : 1 부터 n 까지의합을구하라. p : 전체 worker 의수각 worker 는 p 와자신이몇번째 worker 인지 ( 자신의 rank ) 알아야. Algorithm 1. master worker 가 n 을입력받는다. 2. master worker 가고르게작업을나누고각자담당할작업범위를 slave worker 들에게알린다. 3. 각자주어진범위의부분합을독립적으로계산한다. 4. slave worker 는각기 master worker 에게자신이계산한부분합을보고한다. 5. master worker 는자신을포함한모든 worker 의부분합을취합하여답을낸다. 2 대신 master worker 는 n 값을 slave worker 들에게 broadcast 하고모든 worker 는각자자신의 rank 에따라자신의작업범위를파악한다.

25 Parallel Programming (3) SPMD vs. MPMD [1/2] SPMD(single program multiple data) worker 모두가같은프로그램사용, 단, 각 worker 의 rank 에따라역할을분류 Algorithm master worker의 rank=0을가정 1. If my rank==0, n을입력받고, slave worker들의작업범위를결정하고, 각자에게통보한다. else master worker로부터작업범위를통보받는다.( 그때까지대기 ) 2. 각자독립적으로자신이맡은범위의수를더해부분합을구한다. 3. If my rank==0, 모든 slave worker로부터부분합을전달받아총합을계산한다. else 각자 master worker에게자신의부분합을보고한다. 4. If my rank==0, 총합을출력한다.

26 Parallel Programming (4) SPMD vs. MPMD [2/2] MPMD(multiple program multiple data) 역할에따라 2 개이상의프로그램사용, Algorithm (master worker) 1. n을입력받고, 각 slave worker의작업범위를결정하고, 각자에게통보한다. 2. 자신이맡은범위의수를더해부분합을구한다. 3. 모든다른 worker로부터부분합을전달받아총합을계산한다. 4. 총합을출력한다. Algorithm (slave worker) 1. master worker로부터자신의작업범위를통보받는다. 2. 각자독립적으로자신이맡은범위의수를더해부분합을구한다. 3. 각자 master worker에게자신의부분합을보고한다.

27 OpenMP Standard (1) OpenMP 란무엇인가? 공유메모리환경에서다중 thread 병렬프로그램작성을위한 API( 응용프로그램인터페이스 ) 기존의직렬프로그램에병렬화지시어 (directive) 를추가하여 compiler 로하여금병렬화유도 기존의직렬프로그램을그대로혹은약간의변형만으로병렬화가능. 단지공유메모리시스템에서만사용가능

28 OpenMP Standard (2) OpenMP 의목표 표준과이식성 공유메모리다중 thread 병렬프로그래밍의사실상의표준 (de facto standard) OpenMP 의역사 1990 년대 : 고성능공유메모리시스템의비약적발전업체고유의다양한지시어 (directive) 집합보유 표준화필요 1996 년 openmp.org 설립 년 OpenMP API 발표 2002 년 3 월 OpenMP 2.0 발표 (C/C++) 2008 년 10 월 OpenMP 3.0 발표 2013 년 3 월현재 OpenMP 4.0 개발중 현재대부분의 compiler 가 OpenMP 지원 ex. Linux gcc 4.0 이후 : OpenMP 3.0 지원

29 OpenMP Standard (3) OpenMP 의구성 #include <omp.h> Compiler directives( 컴파일러지시어 ) - thread 사이의작업분담, 통신, 동기화를담당. 좁은의미의 OpenMP - 형식 : #pragma omp 지시어 ex. program 내에서 #pragma omp parallel #pragma omp for Runtime library( 실행시간라이브러리 ) 병렬매개변수 ( 참여 thread 의개수, 번호등 ) 을설정과조회 ex. program 내에서 omp_set_num_thread(8); 실행시병렬영역에서 thread 개수를 8 개사용 Environment variable( 환경변수 ) 실행시스템의병렬매개변수 ( 사용하는 thread 개수등 ) 를정의 ex. Linux system 에서는 $ export OMP_NUM_THREADS=8 실행시병렬영역에서 thread 개수를 8 개사용

30 OpenMP Standard (4) OpenMP programming model Thread 기반 Fork-Join model / compiler directive 기반 : 순차 code 에지시어삽입 - compiler 가지시어를참고하여다중 thread 생성 - OpenMP 지원하는 compiler 필요

31 OpenMP Standard (5) serial code ialpha = 2; for (i=1; i<=100, i++) { : } parallel code ialpha = 2; #pragma omp parallel for for (i=1; i<=100, i++) { : }

32 OpenMP Standard (6) 주요 OpenMP compiler directives (1) 병렬 block 의지정 #pragma omp parallel 프로그램내에서병렬 block을지정 { fork : 지정된수의 thread가생성병렬 block thread들이병렬로실행 } join : master thread만남음 병렬 block 내에서의작업분할 1) #pragma omp for for 문의작업분할 for (i=0; i<n; i++) 2) #pragma omp sections section별로 thread에게작업할당 { #pragma omp section 각 section을정의 { } } #pragma omp section { } 각 section 을정의 /

33 OpenMP Standard (7) 주요 OpenMP compiler directives (2) 병렬 block 내에서의작업분할 ( 계속 ) 3) #pragma omp single 단일 thread 가실행할 block 지정 { 단일 thread 가실행할 block } 4) #pragma omp task ex. 명시적인 task 정의. #pragma omp single private(i) { for (i=0; i<n; i++) { #pragma omp task { 여기에 task 정의 } } }

34 OpenMP Standard (8) 주요 OpenMP compiler directives (3) 상호배제 #pragma omp critical 매순간오직하나의 thread만실행. 다른것은대기 #pragma omp atomic mini critical event 동기화 #pragma omp barrier #pragma omp ordered #pragma omp master 모든 thread들이 barrier에도달할때까지대기내부의 loop 실행을순차적으로실행 master thread만실행. 다른 thread는건너뜀 기타 #pragma omp threadprivate( 변수 ) #pragma omp taskwait #pragma omp flush :

35 OpenMP Standard (9) OpenMP compiler directive 에추가하여사용하는것 Data 유효범위관련 clauses shared ( 변수들 ) private ( 변수들 ) firstprivate ( 변수들 ) lastprivate ( 변수들 ) default () copyin ( 변수들 ) reduction ( 연산자 : 변수 ) 모든 thread가공유하는변수선언각 thread가각기하나씩가지는변수선언 기타 schedule nowait collapse ordered :

36 OpenMP Standard (10) 주요 OpenMP runtime library functions omp_get_thread_num() omp_get_num_threads() omp_set_num_threads() omp_get_max_threads() omp_get_num_procs() omp_in_parallel() omp_set_dynamic() thread ID 파악전체 thread 개수파악사용하는 thread 개수설정최대 thread 개수파악사용할수있는 processor 개수파악현재수행중인곳이병렬영역인지판단 thread 개수를동적으로변경가능케할것인가설정 program 내에서함수를호출하여사용 주요 OpenMP 환경변수 OMP_NUM_THREADS 실행시사용할수있는 thread의최대개수 OMP_DYNAMIC 실행시 thread 개수를동적으로변경가능케할것인지 OMP_SCHEDULE scheduling 방식 OMP_NESTED nested parallelism 허용여부 Linux 의경우, 프로그램실행전에다음과같은명령을실행하여환경설정 $ export OMP_NUM_THREADS=16

37 OpenMP Standard (11) OpenMP 예제프로그램 #include <stdio.h> #include <omp.h> int main(void) { int i, sum=0; #pragma omp parallel for reduction(+:sum) { for (i=1; i<=1000; i++) sum+=i; } printf("sum from 1 to 1000 is %d.\n",sum); } #include <stdio.h> #include <omp.h> int main(void) { int i, sum=0, total=0, Nthreads, th_id; #pragma omp parallel { Nthreads = omp_get_num_threads(); th_id = omp_get_thread_num() for (i=th_id; i<1001; i=i+nthreads) sum+=i; #pragma omp critical total=total+sum; } printf("sum from 1 to 1000 is %d.\n", total); }

38 OpenMP Standard (12) OpenMP 의장단점, 기타 장점 사용자가직접통신을처리해야하는 MPI 에비해코딩, 디버깅이비교적쉽다. 사용자가직접 data 분할을해야하는 MPI 보다 data 분할에대한부담적다. 각 loop 을하나씩병렬화하여점진적인병렬화가가능 compile option 의조정과선택적 compile 문법을이용해하나의 code 를병렬 code 와순차 code 로 compile 가능 상대적으로 code 의크기가작다. 단점 생성된병렬프로그램은공유메모리환경의다중프로세서아키텍처에서만실행가능 아키텍처 ( 프로세서수, 메모리 ) 의한계로원하는성능을얻기힘들다. OpenMP 를지원하는 compiler 가반드시필요 프로그램의병렬성이 loop 에대한의존도가커서병렬화효율이낮다. - compiler 지시어, runtime library routines, 환경변수알아야 - 사용하는변수가 shared 인지 private 인지 - 기타병렬적감각

39 MPI Standard (1) Message Passing 이란? 지역적으로독립된메모리를가지는 process 들이 data 를공유하기위해 message(data) 를송수신하여통신하는방식 병렬화를위한작업할당, data 분배, 통신의운용등모든것을프로그래머가담당 : 어렵지만효율높다. 다양한 hardware platform 에서구현가능 분산메모리다중 processor system 공유메모리다중 processor system 단일 processor system MPI 란무엇인가? Message Passing Interface de facto standard( 사실상의표준 ) Message passing 병렬프로그래밍을위해표준화된데이터통신라이브러리 (Message Passing Library) 의표준을정의한것 목적 : 이식성 (portability), 효율성 (efficiency), 기능성 (functionality) * hardware vendor 가자신의 hardware 에최적화된 library 제공가능

40 MPI Standard (2) MPI 의역사 1980 년대 1990 년대초까지, 다양한분산메모리병렬컴퓨팅 SW 등장. MPI Forum : 표준마련의필요성에서정부, 학계, 산업체등, 1992 시작 년 MPI-1 표준마련 (MPI Forum) 년 MPI-2 발표 2012 년 9 월 MPI-3.0 발표 MPI 표준에맞추어개발한 MPI Library MPICH, CHIMP, LAM/MPI, OpenMPI,, 기타각 hardware vendor 들의 MPI (ex. IBM MPI) OpenMPI site

41 MPI Standard (3) MPI 관련기본개념 (1) Process 와 processor MPI 는 process 기준으로작업할당 Processor : process = 1:1 or 1:many Communicator 서로간에통신이허용되는모든 process 들의집합 Process rank 동일한 communicator 내의 process 들을식별하기위한식별자 만일 p 개의 process 가연산에참여한다면 rank 는 0, 1,, p-1

42 MPI Standard (4) MPI 관련기본개념 (2) Message [ = data + envelope ] 어느 process 가보내는가 어디에있는 data 를보내는가 어떤 data 를보내는가 Data 를얼마나보내는가 어느 process 가수신할것인가 어디에저장할것인가 얼마나받을준비를해야하는가 Tag ( 꼬리표 ) Message 의 matching 과구분에이용 순서대로메시지도착을처리할수있음 message buffer 사용 wild card 사용가능 : MPI_ANY_TAG ex. 누군가 message 를보내오면

43 MPI Standard (5) MPI 관련기본개념 (3) 점대점통신 (point to point communication) 두개의 process 사이의통신 하나의송신 process에하나의수신 process가대응 집합통신 (collective communication) 동시에여러개의 process가통신에참여 일대다, 다대일, 다대다대응가능 여러번의점대점통신사용을하나의집합통신으로대체 프로그래밍이쉽고간단하다. 오류의가능성이적다. 최적화되어일반적으로빠르다.

44 MPI Standard (6) MPI(Message Passing Interface) 표준 In the definition by Gropp et al 96, MPI "is a message passing applicati on programmer interface, together with protocol and semantic specifica tions for how its features must behave in any implementation", "MPI incl udes point-to-point message passing and collective (global) operation s, all scoped to a user-specified group of processes. MPI is a language-independent communications protocol used to progr am parallel computers. MPI-1 은 127 개의함수로구성 대부분의 MPI implementation 은 Fortran, C, C++ 에서호출가능한 library function 으로구성 보통의 Fortran, C, C++ 프로그램에서다른 process 로통신이필요시적절한함수만호출하면됨 그외 Python, Ocaml, Java 에서도사용하도록노력중

45 MPI Standard (7) MPI 프로그램의기본구조 #include <mpi.h> - MPI 함수의 prototype 선언 - macro, MPI 관련인수, data type 정의 변수선언 - MPI 함수의 prototype 선언 MPI 환경의초기화 - MPI_Init() - MPI_Comm_rank() - MPI_Comm_size() MPI 통신함수호출하며연산수행 MPI 환경해제 - MPI_Finalize()

46 MPI Standard (8) MPI 함수에대하여 MPI 함수의이름과형태 MPI_Xxxxxx(parameter, ); MPI_ 로시작그다음첫글자 X 는대문자 MPI 함수의호출과 return 값 호출예 err = MPI_Init(&argc, &argv); if (err == MPI_SUCCESS) { : } 혹은 MPI_Init(&argc, &argv); Return 값첫예의경우, err 로 return. 호출이성공적이면 MPI_SUCCESS 값가짐

47 MPI Standard (9) MPI 의기본함수 (1) int MPI_Init(&argc, &argv); MPI 환경초기화 MPI 루틴중가장먼저오직한번반드시호출되어야함 MPI_COMM_WORLD 라는 communicator 가정의됨 호출예 MPI_Init(&argc, &argv); int MPI_Comm_rank(MPI_COMM comm, int *rank); 같은 communicator comm 에속한 process 의 rank 를할당 - p 개의 process 를사용할경우, 0 부터 p-1 의값을할당 호출예 MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);

48 MPI Standard (10) MPI 의기본함수 (2) int MPI_Comm_size(MPI_COMM comm, int *size); Communicator comm 에포함된 process 들의총개수가져오기 호출예 MPI_Comm_size(MPI_COMM_WORLD, &p); int MPI_Finalize( ); 모든 MPI 자료구조정리 모든 process 들이마지막으로한번호출되어야함 Process 를종료시키는것은아님 호출예 MPI_Finalize();

49 MPI Standard (11) MPI 메시지 = data + 봉투 (envelope) Data Buffer : 수신 ( 송신 ) data의변수이름 개수 : 수신 ( 송신 ) data의개수 Data type : 수신 ( 송신 ) data의 data 유형 봉투 수신자 ( 송신자 ) : 수신 ( 송신 ) process의 rank Tag( 꼬리표 ) : 송신 ( 수신 ) data를나타내는고유한정수 Communicator : 송신, 수신 process들이포함된 process group MPI data type 기본 type과유도 type(derived type) 유도 type은마음대로만들수있다. 송신과수신 data type은반드시일치해야한다.

50 MPI Standard (12) MPI 기본 data type

51 MPI Standard (13) 점대점통신 (point to point communication) [1/3] 반드시두개의 process 만참여 communicator 내에서만이루어짐 송신 / 수신 process 의확인을위해 communicator 와 rank 사용 통신의완료 메시지전송에이용된메모리위치에안전하게접근할수있음을의미 Blocking 통신과 non-blocking 통신 Blocking : 통신이완료된후루틴으로부터 return 됨 Non-blocking : 통신이시작되면완료와관계없이 return, 이후완료여부검사 통신완료에요구되는조건에따라통신모드분류

52 MPI Standard (14) 점대점통신 (point to point communication) [2/3] 통신모드

53 MPI Standard (15) 점대점통신 (point to point communication) [3/3] int MPI_Send(void *message, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) Datatype 형태의자료 message 를 count 개수만큼 dest rank 의 process 에게전송 반환값 : error code ex. MPI_Send(message, strlen(message)+1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); int MPI_Recv(void *message, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) Source process 로부터 tag 태그를사용해서보내온메시지를받음 Source : process rank 혹은 MPI_ANY_SOURCE 사용 Tag : 전송자가사용한 tag 혹은 MPI_ANY_TAG 사용가능 ex. MPI_Recv(message, 100, MPI_CHAR, source, tag, MPI_COMM_WORLD, &status); 이외많은점대점통신함수가있음

54 MPI Standard (16) 집합통신 (Collective communication) [1/3] 한그룹의 process가참여 점대점통신을이용한구현보다편리하고성능면에서유리 집합통신루틴 Communicator 내의모든 process 호출 동기화가보장되지않음, Non-blocking 루틴없음, Tag 없음

55 MPI Standard (17) 집합통신 (Collective communication) [2/3]

56 MPI Standard (18) 집합통신 (Collective communication) [3/3] int MPI_Bcast(void *message, int count, MPI_Datatype datatype, int root, MPI_Comm comm) 전송자와수신자는모두같은명령을사용 root 라는 rank 를가진 process 가송신하며다른모든 process 는수신 Ex. MPI_Bcast(&uplimit,1,MPI_LONG,0,MPI_COMM_WORLD); Int MPI_Reduce(void *operand, void *result, int count, MPI_Datatype datatype, MPI_Op operator, int root, MPI_COMM comm) Operand 에주어진자료에대해 operator 로지정된연산을수행한결과를 result 로반환함 Operator 는 MPI_MAX, MPI_MIN, MPI_SUM, MPI_PROD 등많은종류의연산이가능 Ex. MPI_Reduce(&sum,&gsum,1,MPI_DOUBLE,MPI_SUM,0, MPI_COMM_WORLD);

57 MPI Standard (19) 1 부터 n 까지더하는 serial program #include <stdio.h> int main(int argc, char* argv[]) { long int i,last; double sum; printf("this program computes the sum from 1 to a given number.\n"); printf("enter a big number : "); scanf("%ld",&last); sum=0.; for (i=1; i<=last; i++) { sum=sum+i; } printf( Sum from 1 to %ld is %f\n",last,sum); }

58 MPI Standard (20) 1 부터 n 까지더하는 parallel program #include <stdio.h> #include "mpi.h int main(int argc, char* argv[]) { int MyRank, size; long int i, uplimit, mok, nam, start, last, count[16]; double sum, gsum, stime, time1, time2; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &MyRank); MPI_Comm_size(MPI_COMM_WORLD, &size); if (MyRank==0) { printf("enter a big number : "); scanf("%ld", &uplimit); } for (i=0; i<size; i++) { count[i]=mok; if (i < nam) count[i]=count[i]+1; } start=1; for (i=0; i<myrank; i++) start=start+count[i]; last=start+count[myrank]-1; printf(" MyRank = %d : %ld - %ld\n",myrank,start,last); } sum=0.; for (i=start; i<=last; i++) sum=sum + (double) i; MPI_Reduce(&sum,&gsum,1,MPI_DOUBLE,MPI_SUM,0, MPI_COMM_WORLD); MPI_Bcast(&uplimit,1,MPI_LONG,0,MPI_COMM_WORLD); mok=uplimit/size; nam=uplimit % size; if (MyRank==0) printf(" Sum = %f\n",gsum); MPI_Finalize(); }

59 Related Topics & Questions Related Topics GPU computing GPGPU( 위키백과 ) 한글 영문 CUDA 미루웨어 한국 CUDA 사용자그룹 (KCUG) OpenCL Questions?

Microsoft PowerPoint - 병렬표준.pptx

Microsoft PowerPoint - 병렬표준.pptx Parallel Programming & MPI 박필성 수원대학교 IT 대학컴퓨터학과 목차 Why Parallel? Parallel Processing Parallel Programming MPI의기본개념 MPI 표준 MPI 프로그램및실행 Related Topics & Questions Why Parallel? (1) Why parallel computing?

More information

Parallel Programming & MPI 박필성 수원대학교 IT 대학컴퓨터학과

Parallel Programming & MPI 박필성 수원대학교 IT 대학컴퓨터학과 Parallel Programming & MPI 박필성 수원대학교 IT 대학컴퓨터학과 목차 Why Parallel? Parallel Computers Parallel Processing Parallel Programming MPI의기본개념 MPI 표준 MPI 프로그램및실행 Related Topics & Questions Why Parallel? (1) Why

More information

fprintf(fp, "clf; clear; clc; \n"); fprintf(fp, "x = linspace(0, %d, %d)\n ", L, N); fprintf(fp, "U = [ "); for (i = 0; i <= (N - 1) ; i++) for (j = 0

fprintf(fp, clf; clear; clc; \n); fprintf(fp, x = linspace(0, %d, %d)\n , L, N); fprintf(fp, U = [ ); for (i = 0; i <= (N - 1) ; i++) for (j = 0 병렬계산을이용한열방정식풀기. 1. 처음 병렬계산을하기전에 C 언어를이용하여명시적유한차분법으로하나의열방정식을풀어본 다. 먼저 C 로열방정식을이해한다음초기조건만다르게하여클러스터로여러개의열방 정식을풀어보자. 2. C 를이용한명시적유한차분법으로열방적식풀기 열방정식을풀기위한자세한이론은앞서다룬 Finite-Difference method 을보기로하고 바로식 (1.10)

More information

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

Microsoft Word - 3부A windows 환경 IVF + visual studio.doc

Microsoft Word - 3부A windows 환경 IVF + visual studio.doc Visual Studio 2005 + Intel Visual Fortran 9.1 install Intel Visual Fortran 9.1 intel Visual Fortran Compiler 9.1 만설치해서 DOS 모드에서실행할수있지만, Visual Studio 2005 의 IDE 를사용하기위해서는 Visual Studio 2005 를먼저설치후 Integration

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

Microsoft PowerPoint - chap01-C언어개요.pptx

Microsoft PowerPoint - chap01-C언어개요.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 프로그래밍의 기본 개념을

More information

untitled

untitled Embedded System Lab. II Embedded System Lab. II 2 RTOS Hard Real-Time vs Soft Real-Time RTOS Real-Time, Real-Time RTOS General purpose system OS H/W RTOS H/W task Hard Real-Time Real-Time System, Hard

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

PowerPoint Presentation

PowerPoint Presentation MPI 를이용한병렬프로그래밍기초 : Point-to-Point Communication Hongsuk Yi KISTI Supercomputing Center 2009-11-09 1 MPI 란무엇인가? MPI Message Passing Interface 병렬프로그래밍을위해표준화된데이터통신라이브러리 MPI-1 표준마련 (MPI Forum) : 1994 년 Procs

More information

PCServerMgmt7

PCServerMgmt7 Web Windows NT/2000 Server DP&NM Lab 1 Contents 2 Windows NT Service Provider Management Application Web UI 3 . PC,, Client/Server Network 4 (1),,, PC Mainframe PC Backbone Server TCP/IP DCS PLC Network

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Reasons for Poor Performance Programs 60% Design 20% System 2.5% Database 17.5% Source: ORACLE Performance Tuning 1 SMS TOOL DBA Monitoring TOOL Administration TOOL Performance Insight Backup SQL TUNING

More information

Figure 5.01

Figure 5.01 Chapter 4: Threads Yoon-Joong Kim Hanbat National University, Computer Engineering Department Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Function) 1. 함수의개념 입력에대해적절한출력을발생시켜주는것 내가 ( 프로그래머 ) 작성한명령문을연산, 처리, 실행해주는부분 ( 모듈 ) 자체적으로실행되지않으며,

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

C 언어 프로그래밊 과제 풀이

C 언어 프로그래밊 과제 풀이 과제풀이 (1) 홀수 / 짝수판정 (1) /* 20094123 홍길동 20100324 */ /* even_or_odd.c */ /* 정수를입력받아홀수인지짝수인지판정하는프로그램 */ int number; printf(" 정수를입력하시오 => "); scanf("%d", &number); 확인 주석문 가필요한이유 printf 와 scanf 쌍

More information

APOGEE Insight_KR_Base_3P11

APOGEE Insight_KR_Base_3P11 Technical Specification Sheet Document No. 149-332P25 September, 2010 Insight 3.11 Base Workstation 그림 1. Insight Base 메인메뉴 Insight Base Insight Insight Base, Insight Base Insight Base Insight Windows

More information

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 System call table and linkage v Ref. http://www.ibm.com/developerworks/linux/library/l-system-calls/ - 2 - Young-Jin Kim SYSCALL_DEFINE 함수

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 2015-1 프로그래밍언어 7. 포인터 (Pointer), 동적메모리할당 2015 년 4 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 포인터 (pointer) 란? 간접참조연산자

More information

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The Last(8 th ) Lecture 유명환 ( yoo@netplug.co.kr) INDEX 1 I 2 C 통신이야기 2 ATmega128 TWI(I 2 C) 구조분석 4 ATmega128 TWI(I 2 C) 실습 : AT24C16 1 I 2 C 통신이야기 I 2 C Inter IC Bus 어떤 IC들간에도공통적으로통할수있는 ex)

More information

Oracle9i Real Application Clusters

Oracle9i Real Application Clusters Senior Sales Consultant Oracle Corporation Oracle9i Real Application Clusters Agenda? ? (interconnect) (clusterware) Oracle9i Real Application Clusters computing is a breakthrough technology. The ability

More information

김기남_ATDC2016_160620_[키노트].key

김기남_ATDC2016_160620_[키노트].key metatron Enterprise Big Data SKT Metatron/Big Data Big Data Big Data... metatron Ready to Enterprise Big Data Big Data Big Data Big Data?? Data Raw. CRM SCM MES TCO Data & Store & Processing Computational

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 08 함수 01 함수의개요 02 함수사용하기 03 함수와배열 04 재귀함수 함수의필요성을인식한다. 함수를정의, 선언, 호출하는방법을알아본다. 배열을함수의인자로전달하는방법과사용시장점을알아본다. 재귀호출로해결할수있는문제의특징과해결방법을알아본다. 1.1 함수의정의와기능 함수 (function) 특별한기능을수행하는것 여러가지함수의예 Page 4 1.2

More information

Microsoft PowerPoint APUE(Intro).ppt

Microsoft PowerPoint APUE(Intro).ppt 컴퓨터특강 () [Ch. 1 & Ch. 2] 2006 년봄학기 문양세강원대학교컴퓨터과학과 APUE 강의목적 UNIX 시스템프로그래밍 file, process, signal, network programming UNIX 시스템의체계적이해 시스템프로그래밍능력향상 Page 2 1 APUE 강의동기 UNIX 는인기있는운영체제 서버시스템 ( 웹서버, 데이터베이스서버

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

Microsoft Word - 2부B windows 환경 visual studio 2005.doc

Microsoft Word - 2부B windows 환경 visual studio 2005.doc 1. 영문 Visual Studio 2005 Visual Studio 2005 설치 Visual Studio 2005 시작하기 new project 파일 > 새로만들기 > 새로운 프로젝트 > Visual C/C++ Project > Console Application File > New >New Project > Visual C/C++ project > Console

More information

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다. Eclipse 개발환경에서 WindowBuilder 를이용한 Java 프로그램개발 이예는 Java 프로그램의기초를이해하고있는사람을대상으로 Embedded Microcomputer 를이용한제어시스템을 PC 에서 Serial 통신으로제어 (Graphical User Interface (GUI) 환경에서 ) 하는프로그램개발예를설명한다. WindowBuilder:

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 06 반복문 01 반복문의필요성 02 for문 03 while문 04 do~while문 05 기타제어문 반복문의의미와필요성을이해한다. 대표적인반복문인 for 문, while 문, do~while 문의작성법을 알아본다. 1.1 반복문의필요성 반복문 동일한내용을반복하거나일정한규칙으로반복하는일을수행할때사용 프로그램을좀더간결하고실제적으로작성할수있음.

More information

11장 포인터

11장 포인터 Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함

More information

OCW_C언어 기초

OCW_C언어 기초 초보프로그래머를위한 C 언어기초 4 장 : 연산자 2012 년 이은주 학습목표 수식의개념과연산자및피연산자에대한학습 C 의알아보기 연산자의우선순위와결합방향에대하여알아보기 2 목차 연산자의기본개념 수식 연산자와피연산자 산술연산자 / 증감연산자 관계연산자 / 논리연산자 비트연산자 / 대입연산자연산자의우선순위와결합방향 조건연산자 / 형변환연산자 연산자의우선순위 연산자의결합방향

More information

-

- World Top 10 by 2030 CONTENTS CONTENTS 02 03 PRESIDENT S MESSAGE 04 05 VISION GOALS VISION GOALS STRATEGIES 06 07 HISTORY 2007 2008 2009 2010 2011 08 09 UNIST POWER 10 11 MPI USTC UNIST UCI UTD U-M GT

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Network Programming Jo, Heeseung Network 실습 네트워크프로그래밍 멀리떨어져있는호스트들이서로데이터를주고받을수있도록프로그램을구현하는것 파일과는달리데이터를주고받을대상이멀리떨어져있기때문에소프트웨어차원에서호스트들간에연결을해주는장치가필요 이러한기능을해주는장치로소켓이라는인터페이스를많이사용 소켓프로그래밍이란용어와네트워크프로그래밍이랑용어가같은의미로사용

More information

JVM 메모리구조

JVM 메모리구조 조명이정도면괜찮조! 주제 JVM 메모리구조 설미라자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조장. 최지성자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조원 이용열자료조사, 자료작성, PPT 작성, 보고서작성. 이윤경 자료조사, 자료작성, PPT작성, 보고서작성. 이수은 자료조사, 자료작성, PPT작성, 보고서작성. 발표일 2013. 05.

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

Microsoft PowerPoint - eSlim SV5-2510 [080116]

Microsoft PowerPoint - eSlim SV5-2510 [080116] Innovation for Total Solution Provider!! eslim SV5-2510 Opteron Server 2008. 03 ESLIM KOREA INC. 1. 제 품 개 요 eslim SV5-2510 Server Quad-Core and Dual-Core Opteron 2000 Series 6 internal HDD bays for SAS

More information

Chap7.PDF

Chap7.PDF Chapter 7 The SUN Intranet Data Warehouse: Architecture and Tools All rights reserved 1 Intranet Data Warehouse : Distributed Networking Computing Peer-to-peer Peer-to-peer:,. C/S Microsoft ActiveX DCOM(Distributed

More information

Microsoft Word - cover.docx

Microsoft Word - cover.docx Parallel Programming using MPICH2 차 례 1. Parallel Programming 환경구축 - 1 2. Parallel Programming using MPICH2-13 3. 병렬처리예제프로그램 - 22 4. 참고자료 - 23 1. Parallel Programming 환경구축병렬프로그래밍을위하여널리사용되는 Message Programming

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 13. 포인터와배열! 함께이해하기 2013.10.02. 오병우 컴퓨터공학과 13-1 포인터와배열의관계 Programming in C, 정재은저, 사이텍미디어. 9 장참조 ( 교재의 13-1 은읽지말것 ) 배열이름의정체 배열이름은 Compile 시의 Symbol 로서첫번째요소의주소값을나타낸다. Symbol 로서컴파일시에만유효함 실행시에는메모리에잡히지않음

More information

Microsoft PowerPoint - 알고리즘_5주차_1차시.pptx

Microsoft PowerPoint - 알고리즘_5주차_1차시.pptx Basic Idea of External Sorting run 1 run 2 run 3 run 4 run 5 run 6 750 records 750 records 750 records 750 records 750 records 750 records run 1 run 2 run 3 1500 records 1500 records 1500 records run 1

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

Microsoft PowerPoint - eSlim SV5-2410 [20080402]

Microsoft PowerPoint - eSlim SV5-2410 [20080402] Innovation for Total Solution Provider!! eslim SV5-2410 Opteron Server 2008. 3 ESLIM KOREA INC. 1. 제 품 개 요 eslim SV5-2410 Server Quad-Core and Dual-Core Opteron 2000 Series Max. 4 Disk Bays for SAS and

More information

Something that can be seen, touched or otherwise sensed

Something that can be seen, touched or otherwise sensed Something that can be seen, touched or otherwise sensed Things about an object Weight Height Material Things an object does Pen writes Book stores words Water have Fresh water Rivers Oceans have

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

Microsoft PowerPoint - o4.pptx

Microsoft PowerPoint - o4.pptx 목표 쓰레드 (thread) 개념소개 Thread API Multithreaded 프로그래밍관련이슈 4 장. 쓰레드 2 4.1 개요 쓰레드 쓰레드 (Thread ) CPU 이용의기본실행단위 단일쓰레드 (Single threaded) Processes 전통적인프로세스 한개의실행단위로구성 다중쓰레드 (Multithreaded) Process 여러개의실행쓰레드를갖는프로세스

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 (Host) set up : Linux Backend RS-232, Ethernet, parallel(jtag) Host terminal Target terminal : monitor (Minicom) JTAG Cross compiler Boot loader Pentium Redhat 9.0 Serial port Serial cross cable Ethernet

More information

1217 WebTrafMon II

1217 WebTrafMon II (1/28) (2/28) (10 Mbps ) Video, Audio. (3/28) 10 ~ 15 ( : telnet, ftp ),, (4/28) UDP/TCP (5/28) centralized environment packet header information analysis network traffic data, capture presentation network

More information

PRO1_04E [읽기 전용]

PRO1_04E [읽기 전용] Siemens AG 1999 All rights reserved File: PRO1_04E1 Information and S7-300 2 S7-400 3 EPROM / 4 5 6 HW Config 7 8 9 CPU 10 CPU : 11 CPU : 12 CPU : 13 CPU : / 14 CPU : 15 CPU : / 16 HW 17 HW PG 18 SIMATIC

More information

1. 회사소개 및 연혁 - 회사소개 회사소개 회사연혁 대표이사: 한종열 관계사 설립일 : 03. 11. 05 자본금 : 11.5억원 인 원 : 18명 에스오넷 미도리야전기코리 아 미도리야전기(일본) 2008 2007 Cisco Premier Partner 취득 Cisco Physical Security ATP 취득(진행) 서울시 강남구 도심방범CCTV관제센터

More information

<4D F736F F F696E74202D FC0CFB9DD5FBAB4B7C4C7C1B7CEB1D7B7A1B9D62E >

<4D F736F F F696E74202D FC0CFB9DD5FBAB4B7C4C7C1B7CEB1D7B7A1B9D62E > 컴퓨팅브릿지일반병렬프로그래밍 김정한 목표 병렬프로그래밍을하기위해필요한사전지식을 전달하고, OpenMP와 MPI의개념및사용법을소개하여간단한병렬프로그램을직접작성할수있게한다. INDEX 1. 병렬프로그래밍개요 2. OpenMP 사용법 3. MPI 사용법 01. 병렬프로그래밍개요 병렬프로그래밍과관련된개념을정리하고병렬프로그래밍모델, 성능측정, 그리고병렬프로그램의작성과정에대해알아본다.

More information

OPCTalk for Hitachi Ethernet 1 2. Path. DCOMwindow NT/2000 network server. Winsock update win95. . . 3 Excel CSV. Update Background Thread Client Command Queue Size Client Dynamic Scan Block Block

More information

SMB_ICMP_UDP(huichang).PDF

SMB_ICMP_UDP(huichang).PDF SMB(Server Message Block) UDP(User Datagram Protocol) ICMP(Internet Control Message Protocol) SMB (Server Message Block) SMB? : Microsoft IBM, Intel,. Unix NFS. SMB client/server. Client server request

More information

Microsoft PowerPoint - Lecture_Note_7.ppt [Compatibility Mode]

Microsoft PowerPoint - Lecture_Note_7.ppt [Compatibility Mode] Unix Process Department of Computer Engineering Kyung Hee University. Choong Seon Hong 1 유닉스기반다중서버구현방법 클라이언트들이동시에접속할수있는서버 서비스를동시에처리할수있는서버프로세스생성을통한멀티태스킹 (Multitasking) 서버의구현 select 함수에의한멀티플렉싱 (Multiplexing)

More information

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

More information

학습목차 2.1 다차원배열이란 차원배열의주소와값의참조

학습목차 2.1 다차원배열이란 차원배열의주소와값의참조 - Part2- 제 2 장다차원배열이란무엇인가 학습목차 2.1 다차원배열이란 2. 2 2 차원배열의주소와값의참조 2.1 다차원배열이란 2.1 다차원배열이란 (1/14) 다차원배열 : 2 차원이상의배열을의미 1 차원배열과다차원배열의비교 1 차원배열 int array [12] 행 2 차원배열 int array [4][3] 행 열 3 차원배열 int array [2][2][3]

More information

thesis

thesis CORBA TMN Surveillance System DPNM Lab, GSIT, POSTECH Email: mnd@postech.ac.kr Contents Motivation & Goal Related Work CORBA TMN Surveillance System Implementation Conclusion & Future Work 2 Motivation

More information

Microsoft PowerPoint - additional01.ppt [호환 모드]

Microsoft PowerPoint - additional01.ppt [호환 모드] 1.C 기반의 C++ part 1 함수 오버로딩 (overloading) 디폴트매개변수 (default parameter) 인-라인함수 (in-line function) 이름공간 (namespace) Jong Hyuk Park 함수 Jong Hyuk Park 함수오버로딩 (overloading) 함수오버로딩 (function overloading) C++ 언어에서는같은이름을가진여러개의함수를정의가능

More information

SRC PLUS 제어기 MANUAL

SRC PLUS 제어기 MANUAL ,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO

More information

vm-웨어-01장

vm-웨어-01장 Chapter 16 21 (Agenda). (Green),., 2010. IT IT. IT 2007 3.1% 2030 11.1%, IT 2007 1.1.% 2030 4.7%, 2020 4 IT. 1 IT, IT. (Virtualization),. 2009 /IT 2010 10 2. 6 2008. 1970 MIT IBM (Mainframe), x86 1. (http

More information

solution map_....

solution map_.... SOLUTION BROCHURE RELIABLE STORAGE SOLUTIONS ETERNUS FOR RELIABILITY AND AVAILABILITY PROTECT YOUR DATA AND SUPPORT BUSINESS FLEXIBILITY WITH FUJITSU STORAGE SOLUTIONS kr.fujitsu.com INDEX 1. Storage System

More information

Microsoft PowerPoint - 알고리즘_1주차_2차시.pptx

Microsoft PowerPoint - 알고리즘_1주차_2차시.pptx Chapter 2 Secondary Storage and System Software References: 1. M. J. Folk and B. Zoellick, File Structures, Addison-Wesley. 목차 Disks Storage as a Hierarchy Buffer Management Flash Memory 영남대학교데이터베이스연구실

More information

T100MD+

T100MD+ User s Manual 100% ) ( x b a a + 1 RX+ TX+ DTR GND TX+ RX+ DTR GND RX+ TX+ DTR GND DSR RX+ TX+ DTR GND DSR [ DCE TYPE ] [ DCE TYPE ] RS232 Format Baud 1 T100MD+

More information

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 비트연산자 1 1 비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 진수법! 2, 10, 16, 8! 2 : 0~1 ( )! 10 : 0~9 ( )! 16 : 0~9, 9 a, b,

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

04_오픈지엘API.key

04_오픈지엘API.key 4. API. API. API..,.. 1 ,, ISO/IEC JTC1/SC24, Working Group ISO " (Architecture) " (API, Application Program Interface) " (Metafile and Interface) " (Language Binding) " (Validation Testing and Registration)"

More information

10주차.key

10주차.key 10, Process synchronization (concurrently) ( ) => critical section ( ) / =>, A, B / Race condition int counter; Process A { counter++; } Process B { counter ;.. } counter++ register1 = counter register1

More information

17장 클래스와 메소드

17장 클래스와 메소드 17 장클래스와메소드 박창이 서울시립대학교통계학과 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 1 / 18 학습내용 객체지향특징들객체출력 init 메소드 str 메소드연산자재정의타입기반의버전다형성 (polymorphism) 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 2 / 18 객체지향특징들 객체지향프로그래밍의특징 프로그램은객체와함수정의로구성되며대부분의계산은객체에대한연산으로표현됨객체의정의는

More information

ETL_project_best_practice1.ppt

ETL_project_best_practice1.ppt ETL ETL Data,., Data Warehouse DataData Warehouse ETL tool/system: ETL, ETL Process Data Warehouse Platform Database, Access Method Data Source Data Operational Data Near Real-Time Data Modeling Refresh/Replication

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

00-Intro

00-Intro SSE3054: Multicore Systems Spring 2017 Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu SSE3054: Multicore Systems, Spring 2017, Jinkyu Jeong (jinkyu@skku.ed)

More information

untitled

untitled while do-while for break continue while( ) ; #include 0 i int main(void) int meter; int i = 0; while(i < 3) meter = i * 1609; printf("%d %d \n", i, meter); i++; return 0; i i< 3 () 0 (1)

More information

MAX+plus II Getting Started - 무작정따라하기

MAX+plus II Getting Started - 무작정따라하기 무작정 따라하기 2001 10 4 / Version 20-2 0 MAX+plus II Digital, Schematic Capture MAX+plus II, IC, CPLD FPGA (Logic) ALTERA PLD FLEX10K Series EPF10K10QC208-4 MAX+plus II Project, Schematic, Design Compilation,

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 10 포인터 01 포인터의기본 02 인자전달방법 03 포인터와배열 04 포인터와문자열 변수의주소를저장하는포인터에대해알아본다. 함수의인자를값과주소로전달하는방법을알아본다. 포인터와배열의관계를알아본다. 포인터와문자열의관계를알아본다. 1.1 포인터선언 포인터선언방법 자료형 * 변수명 ; int * ptr; * 연산자가하나이면 1 차원포인터 1 차원포인터는일반변수의주소를값으로가짐

More information

Microsoft PowerPoint - chap12-고급기능.pptx

Microsoft PowerPoint - chap12-고급기능.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 가 제공하는 매크로 상수와 매크로

More information

Windows Embedded Compact 2013 [그림 1]은 Windows CE 로 알려진 Microsoft의 Windows Embedded Compact OS의 history를 보여주고 있다. [표 1] 은 각 Windows CE 버전들의 주요 특징들을 담고

Windows Embedded Compact 2013 [그림 1]은 Windows CE 로 알려진 Microsoft의 Windows Embedded Compact OS의 history를 보여주고 있다. [표 1] 은 각 Windows CE 버전들의 주요 특징들을 담고 OT S / SOFTWARE 임베디드 시스템에 최적화된 Windows Embedded Compact 2013 MDS테크놀로지 / ES사업부 SE팀 김재형 부장 / jaei@mdstec.com 또 다른 산업혁명이 도래한 시점에 아직도 자신을 떳떳이 드러내지 못하고 있는 Windows Embedded Compact를 오랫동안 지켜보면서, 필자는 여기서 그와 관련된

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

세종대 요람

세종대 요람 Sejong University 2016 2016 Sejong University 4 SEJONG UNIVERSITY www.sejong.ac.kr 5 8 SEJONG UNIVERSITY 2016 Sejong University 10 SEJONG UNIVERSITY www.sejong.ac.kr 11 12 SEJONG UNIVERSITY www.sejong.ac.kr

More information

SW¹é¼Ł-³¯°³Æ÷ÇÔÇ¥Áö2013

SW¹é¼Ł-³¯°³Æ÷ÇÔÇ¥Áö2013 SOFTWARE ENGINEERING WHITE BOOK : KOREA 2013 SOFTWARE ENGINEERING WHITE BOOK : KOREA 2013 SOFTWARE ENGINEERING WHITE BOOK : KOREA 2013 SOFTWARE ENGINEERING WHITE BOOK : KOREA 2013 SOFTWARE ENGINEERING

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 3 장함수와문자열 1. 함수의기본적인개념을이해한다. 2. 인수와매개변수의개념을이해한다. 3. 함수의인수전달방법 2가지를이해한다 4. 중복함수를이해한다. 5. 디폴트매개변수를이해한다. 6. 문자열의구성을이해한다. 7. string 클래스의사용법을익힌다. 이번장에서만들어볼프로그램 함수란? 함수선언 함수호출 예제 #include using

More information

<31325FB1E8B0E6BCBA2E687770>

<31325FB1E8B0E6BCBA2E687770> 88 / 한국전산유체공학회지 제15권, 제1호, pp.88-94, 2010. 3 관내 유동 해석을 위한 웹기반 자바 프로그램 개발 김 경 성, 1 박 종 천 *2 DEVELOPMENT OF WEB-BASED JAVA PROGRAM FOR NUMERICAL ANALYSIS OF PIPE FLOW K.S. Kim 1 and J.C. Park *2 In general,

More information

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2 제 17 장동적메모리와연결리스트 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

untitled

untitled if( ) ; if( sales > 2000 ) bonus = 200; if( score >= 60 ) printf(".\n"); if( height >= 130 && age >= 10 ) printf(".\n"); if ( temperature < 0 ) printf(".\n"); // printf(" %.\n \n", temperature); // if(

More information

Microsoft PowerPoint - chap10-함수의활용.pptx

Microsoft PowerPoint - chap10-함수의활용.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 중 값에 의한 전달 방법과

More information

BMP 파일 처리

BMP 파일 처리 BMP 파일처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 영상반전프로그램제작 2 Inverting images out = 255 - in 3 /* 이프로그램은 8bit gray-scale 영상을입력으로사용하여반전한후동일포맷의영상으로저장한다. */ #include #include #define WIDTHBYTES(bytes)

More information

J2EE & Web Services iSeminar

J2EE & Web Services iSeminar 9iAS :, 2002 8 21 OC4J Oracle J2EE (ECperf) JDeveloper : OLTP : Oracle : SMS (Short Message Service) Collaboration Suite Platform Email Developer Suite Portal Java BI XML Forms Reports Collaboration Suite

More information

歯I-3_무선통신기반차세대망-조동호.PDF

歯I-3_무선통신기반차세대망-조동호.PDF KAIST 00-03-03 / #1 1. NGN 2. NGN 3. NGN 4. 5. 00-03-03 / #2 1. NGN 00-03-03 / #3 1.1 NGN, packet,, IP 00-03-03 / #4 Now: separate networks for separate services Low transmission delay Consistent availability

More information

Microsoft PowerPoint - chap11-포인터의활용.pptx

Microsoft PowerPoint - chap11-포인터의활용.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 포인터를 사용하는 다양한 방법에

More information

Microsoft PowerPoint - chap13-입출력라이브러리.pptx

Microsoft PowerPoint - chap13-입출력라이브러리.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 스트림의 기본 개념을 알아보고,

More information

이도경, 최덕재 Dokyeong Lee, Deokjai Choi 1. 서론

이도경, 최덕재 Dokyeong Lee, Deokjai Choi 1. 서론 이도경, 최덕재 Dokyeong Lee, Deokjai Choi 1. 서론 2. 관련연구 2.1 MQTT 프로토콜 Fig. 1. Topic-based Publish/Subscribe Communication Model. Table 1. Delivery and Guarantee by MQTT QoS Level 2.1 MQTT-SN 프로토콜 Fig. 2. MQTT-SN

More information

Chap 6: Graphs

Chap 6: Graphs 5. 작업네트워크 (Activity Networks) 작업 (Activity) 부분프로젝트 (divide and conquer) 각각의작업들이완료되어야전체프로젝트가성공적으로완료 두가지종류의네트워크 Activity on Vertex (AOV) Networks Activity on Edge (AOE) Networks 6 장. 그래프 (Page 1) 5.1 AOV

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

API 매뉴얼

API 매뉴얼 PCI-DIO12 API Programming (Rev 1.0) Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned

More information