【文章內(nèi)容簡介】
pthread_mutex_lock(amp。slot_lock nslots++。 cond_signal(amp。slots)。 pthread_mutex_unlock(amp。slot_lock)。 } return NULL。 } 國家高性能計算中心(合肥) 共享存儲系統(tǒng)編程 ? ANSI X3H5共享存儲模型 ? POSIX 線程模型 ? OpenMP模型 國家高性能計算中心(合肥) ? The History of OpenMP ? What is directive/pragma? ? Directivebased general purpose parallel programming API with emphasis on the ability to parallelize existing serial programs ? Why a new standard? ? Who’s Involved? ? Parallelism model and basic directives ? Fortran77, Fortran90 ? C, C++ OpenMP標準 國家高性能計算中心(合肥) The History of OpenMP ? A key intermediate step was X3H5 in the late 80’s. ? An official standards effort to agree on a parallel dialect of Fortran for shared memory puters. ? The X3H5 effort failed. It was too big and too late. ? OpenMP is born: ? In 1996 a group formed to create an industry standard set of directives for SMP programming ? This group called itself the OpenMP Architecture Review Board(the ARB) who takes care of OpenMP 國家高性能計算中心(合肥) The History of OpenMP(cont.) ? The ARB has released the following specifications: ? OpenMP for Fortran, Nov. 1997 ? OpenMP for C/C++, Nov. 1998 ? OpenMP Fortran Interpretations, Spring 1999 ? OpenMP (soon) ? OpenMP is an evolving standard. Send ments over the feedback link on the OpenMP web site( 國家高性能計算中心(合肥) 為什么要建立新標準 ? ? ANSI X3H5, 1994 ? 時機不好 , 分布式機器流行 ? 只支持循環(huán)級并行性,粒度太細 ? Pthreads(IEEE Posix ) ? 是為低端 (low end)的共享機器 (如 SMP)的標準 ? 對 FORTRAN的支持不夠 ? 適合任務(wù)并行 , 而不適合數(shù)據(jù)并行 ? MPI 消息傳遞的編程標準 , 對程序員要求高 ? HPF 主要用于 分布式存儲機器 ? 大量已有的科學應(yīng)用程序需要很好地被繼承和移植 國家高性能計算中心(合肥) In a Nutshell ? A set of directives(library routines, and environment variables) used to annotate a sequential program to indicate how it should be executed in parallel— 繼承 X3H5的許多概念 ? Portable, Simple and Scalable Shared Memory Multiprocessing API ? not a new language ? not automatic parallelization ? extend base languages: Fortran77, Fortran90, C and C++ ? Multivendor Support, for both UNIX and NT ? Standardizes Fine Grained(Loop) Parallelism, also Supports Coarse Grained Algorithms 國家高性能計算中心(合肥) OpenMP是什么? ? 一組編譯制導(dǎo)語句和可調(diào)用的運行 (runtime)庫函數(shù) , 擴充到基本語言中用來表達程序中的并行性