2011, Oracle / U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware

Similar documents
StorageTek Virtual Storage Manager GUI - 安全指南

2 2 3 DLight CPU I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AM

第7章-并行计算.ppt

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

Sun Storage Common Array Manager 阵列管理指南,版本 6.9.0

Oracle Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE "P

提纲 1 2 OS Examples for 3

2005 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD UNIX X/Open Company, Ltd. / Sun Sun Microsystems Su

Sun Fire V440 Server Administration Guide - zh_TW

2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD UNIX X/Open Company, Ltd. / SunSun MicrosystemsSun

C++ 程式設計

PowerPoint 演示文稿

Java Desktop System 呂衄盋 2 呂衄说柔

2005 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD UNIX X/Open Company, Ltd. / Sun Sun Microsystems Su

CC213

2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD University of California UNIX X/Open Company, Ltd.

untitled

并行算法实践

科学计算的语言-FORTRAN95

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

CC213

CANVIO_AEROCAST_CS_EN.indd

Java

2/80 2

Sun Blade X6275 M A

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

RunPC2_.doc

软件测试(TA07)第一学期考试

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

FY.DOC

ebook15-C

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft PowerPoint - RT0950_EliminatingRubyGILthroughHTM_Slides_ja.ppt

mvc

Panaboard Overlayer help

C 1

2007, Oracle / Sun Microsystems, Inc. / Sun Microsystems, Inc. FAR Federal Acquisition Regulations Berkeley BSD UNIX X/Open Company, Ltd. / Sun Sun Mi

Chapter 2

EK-STM32F

2005 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD UNIX X/Open Company, Ltd. / Sun Sun Microsystems Su

Oracle 4

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

第3章.doc


P4VM800_BIOS_CN.p65

K7VT2_QIG_v3

c_cpp

3.1 num = 3 ch = 'C' 2

Windows XP

新・明解C言語入門編『索引』

Microsoft Word - PS2_linux_guide_cn.doc

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

ebook70-21

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

LH_Series_Rev2014.pdf

ebook66-15

D C 93 2

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

第5章修改稿

Microsoft Word - 01.DOC

Measurement Studio Expands Your Test and Measurement Programming Power

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

Learning Java

概述

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

Serial ATA ( Nvidia nforce430)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Microsoft Win

C语言的应用.PDF

1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes

Serial ATA ( nvidia nforce4 Ultra/SLI)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Micro

ebook14-4

目次 

C

ebook35-2

untitled

Guide to Install SATA Hard Disks

untitled

Sun Update Connection System Sun Microsystems, Inc Network Circle Santa Clara, CA U.S.A

P4V88+_BIOS_CN.p65

Microsoft Word - SupplyIT manual 3_cn_david.doc

Microsoft PowerPoint - OPVB1基本VB.ppt

W. Richard Stevens UNIX Sockets API echo Sockets TCP OOB IO C struct C/C++ UNIX fork() select(2)/poll(2)/epoll(4) IO IO CPU 100% libevent UNIX CPU IO

CH01.indd

版权所有 2004 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,California 95054, U.S.A. 保留所有权利 美国政府权利 - 商业软件 政府用户应遵守 Sun Microsystems, Inc. 标准许可证协

51 C 51 isp 10 C PCB C C C C KEIL

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

Lexmark Prospect Pro200 Series 快速参考手册

1. 請 先 檢 查 包 裝 內 容 物 AC750 多 模 式 無 線 分 享 器 安 裝 指 南 安 裝 指 南 CD 光 碟 BR-6208AC 電 源 供 應 器 網 路 線 2. 將 設 備 接 上 電 源, 即 可 使 用 智 慧 型 無 線 裝 置 進 行 設 定 A. 接 上 電 源

untitled

Sun StorEdge 3000 系列安装、操作和维护手册 (3310)

Applied Biosystems StepOne™ Real-Time PCR System Quick Reference Card for Installation

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

Microsoft Word - (web)_F.1_Notes_&_Application_Form(Chi)(non-SPCCPS)_16-17.doc

HP LJ 4000 UG - ZHTW

2

WinMDI 28

ebook

Transcription:

Oracle Solaris Studio 12.3 OpenMP API E26443 2011 12 E26443-01

2011, Oracle / U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are commercial computer software pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. Oracle Corporation Oracle Java Oracle / Intel Intel Xeon Intel Corporation SPARC SPARC International, Inc AMD Opteron AMD AMD Opteron Advanced Micro Devices UNIX The Open Group Oracle Corporation Oracle Corporation 120220@25097

...7 1 OpenMP API...11 1.1 OpenMP... 11 1.2... 11 2 OpenMP...13 2.1... 13 2.2 OpenMP... 15 2.2.1 OpenMP... 15 2.2.2 Oracle Solaris Studio... 15 2.3... 19 2.3.1 ID... 20 2.3.2 SUNW_MP_PROCBIND... 20 2.3.3 OS... 21 2.4... 21 2.5 OpenMP... 22 3...23 3.1... 23 3.2... 23 3.3... 24 3.4... 24 3.5... 24 3.6... 25 3.6.1 SECTIONS... 25 3.6.2 SINGLE... 25 3

3.6.3 ATOMIC... 25 3.7... 25 3.7.1 omp_set_num_threads()... 25 3.7.2 omp_set_schedule()... 25 3.7.3 omp_set_max_active_levels()... 25 3.7.4 omp_get_max_active_levels()... 26 3.8... 26 3.9 Fortran... 27 3.9.1 THREADPRIVATE... 27 3.9.2 SHARED... 27 3.9.3... 28 4...29 4.1... 29 4.2... 29 4.2.1 OMP_NESTED... 29 4.2.2 OMP_THREAD_LIMIT... 31 4.2.3 OMP_MAX_ACTIVE_LEVELS... 31 4.3 OpenMP... 33 4.4... 35 5...37 5.1... 37 5.2... 39 5.3... 39 5.4... 41 5.4.1 THREADPRIVATE... 41 5.4.2... 41 5.4.3... 42 6...47 6.1... 47 6.1.1 auto... 48 6.1.2 default( auto)... 48 4 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.2... 48 6.2.1... 48 6.2.2... 49 6.3... 49 6.3.1... 49 6.3.2... 49 6.4... 50 6.5... 50 6.6... 51 6.7... 52 7...59 7.1... 59 7.2... 61 8...63 8.1... 63 8.2... 66 8.2.1... 66 8.2.2... 66 8.3 Oracle Solaris OS... 67 A...69...71 5

6

Oracle Solaris Studio 12.3 C C++ Fortran OpenMP API Oracle Solaris Studio Oracle Solaris SPARC Oracle Solaris Linux x86 x86 "x86" 64 32 x86 "x64" 64 x86 CPU 32 x86 x86 32 SPARC x86 Linux Linux x86 Oracle Solaris Oracle Solaris Oracle Solaris Studio 12.3 Oracle Solaris Studio Oracle Solaris Studio Oracle Solaris Studio Web dbxtool DLight IDE "Help" F1 "Help" 7

Web URL Oracle Web Oracle Oracle Oracle Oracle Solaris Studio Oracle Web Oracle My Oracle Support http:// www.oracle.com/pls/topic/lookup?ctx=acc&id=info http://www.oracle.com/ pls/topic/lookup?ctx=acc&id=trs P 1 AaBbCc123.login ls -a machine_name% you have mail. AaBbCc123 machine_name% su Password: 8 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

P 1 aabbcc123 rm filename AaBbCc123 Class 6 shell Oracle Solaris OS UNIX shell Oracle Solaris P 2 shell shell Bash shell Korn shell Bourne shell $ Bash shell Korn shell Bourne shell # C shell C shell machine_name% machine_name# 9

10

1 1 OpenMP API OpenMP (Application Program Interface, API) OpenMP OpenMP API Oracle Solaris Oracle Solaris Studio 1.1 OpenMP OpenMP 3.1 API Oracle Solaris Studio OpenMP Web http://www.openmp.org OpenMP compunity Web http://www.compunity.org Oracle Solaris Studio OpenMP API Oracle Solaris Studio http://www.oracle.com/technetwork/server-storage/ solarisstudio 1.2 Fortran Fortran C/C++ [...] "Fortran" Fortran 95 Oracle Solaris Studio f95(1) 11

1.2 "pragma" OpenMP API C C++ Fortran 12 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

2 OpenMP OpenMP API Oracle Solaris Studio 12.3 OpenMP 2 1 OMP_NUM_THREADS omp_set_num_threads() PARALLEL num_threads 2.1 OpenMP cc CC f95 -xopenmp f95 -xopenmp -openmp -xopenmp -xopenmp=parallel -xopenmp=noopt OpenMP pragma -xopenmp=parallel -xo3 -xo3 OpenMP pragma -xo3 -xo3 -xo2 -openmp=noopt -openmp=noopt OpenMP pragma 13

2.1 -xopenmp=stubs -xopenmp=none OpenMP OpenMP OpenMP OpenMP pragma -xopenmp libompstubs.a % cc omp_ignore.c -lompstubs libompstubs.a OpenMP libmtsk.so OpenMP pragma Oracle Solaris OpenMP libmtsk.so xopenmp xopenmp=none OpenMP pragma xopenmp xopenmp=parallel -xopenmp=parallel noopt _OPENMP YYYYMM C/C++ 201107L Fortran 95 201107 dbx OpenMP -xopenmp=noopt -g -xopenmp Fortran 95 -xopenmp -xopenmp=parallel -xopenmp=noopt -stackvar 21 2.4 OpenMP -xopenmp xopenmp, xopenmp=parallel xopenmp=noopt xvpara OpenMP 6 7 OpenMP OpenMP OpenMP shared private 14 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

2.2 OpenMP 2.2 OpenMP OpenMP OpenMP http://openmp.org OpenMP API 3.1 Oracle Solaris Studio OpenMP 26 3.8 Oracle Solaris Studio OpenMP 15 2.2.2 Oracle Solaris Studio 2.2.1 OpenMP OpenMP OMP_SCHEDULE STATIC OMP_NUM_THREADS OMP_DYNAMIC OMP_NESTED OMP_STACKSIZE OMP_WAIT_POLICY OMP_MAX_ACTIVE_LEVELS OMP_THREAD_LIMIT OMP_PROC_BIND setenv OMP_SCHEDULE GUIDED,4 2 setenv OMP_NUM_THREADS 16 TRUE setenv OMP_DYNAMIC FALSE FALSE setenv OMP_NESTED FALSE 32 4MB 64 8MB setenv OMP_STACKSIZE 10M PASSIVE 4 1024 FALSE 2.2.2 Oracle Solaris Studio OpenMP OpenMP 2 OpenMP 15

2.2 OpenMP 2.2.2.1 PARALLEL PARALLEL OMP_NUM_THREADS PARALLEL OMP_NUM_THREADS 2.2.2.2 SUNW_MP_WARN OpenMP SUNW_MP_WARN TRUE stderr FALSE FALSE setenv SUNW_MP_WARN TRUE int sunw_mp_register_warn (void (*func)(void *)); sunw_mp_register_warn() 0 1 OpenMP OpenMP SUNW_MP_WARN TRUE OpenMP 2.2.2.3 SUNW_MP_THR_IDLE OpenMP SPIN SLEEP SLEEP(times) SLEEP(timems) SLEEP(timemc) time s ms mc SPIN SLEEP SLEEP SLEEP SLEEP(0) SLEEP(0s) SLEEP(0ms) SLEEP(0mc) 16 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

2.2 OpenMP SUNW_MP_THR_IDLE OMP_WAIT_POLICY OMP_WAIT_POLICY setenv SUNW_MP_THR_IDLE SPIN setenv SUNW_MP_THR_IDLE SLEEP setenv SUNW_MP_THR_IDLE SLEEP(2s) setenv SUNW_MP_THR_IDLE SLEEP(20ms) setenv SUNW_MP_THR_IDLE SLEEP(150mc) 2.2.2.4 SUNW_MP_PROCBIND Oracle Solaris Linux SUNW_MP_PROCBIND OpenMP SUNW_MP_PROCBIND OMP_PROC_BIND 19 2.3 2.2.2.5 SUNW_MP_MAX_POOL_THREADS OpenMP 1023 29 4.2 SUNW_MP_MAX_POOL_THREADS OpenMP OMP_THREAD_LIMIT OpenMP SUNW_MP_MAX_POOL_THREADS OMP_THREAD_LIMIT OMP_THREAD_LIMIT SUNW_MP_MAX_POOL_THREADS 2.2.2.6 SUNW_MP_MAX_NESTED_LEVELS 2.2.2.7 STACKSIZE SUNW_MP_MAX_NESTED_LEVELS 4 29 4.2 SUNW_MP_MAX_NESTED_LEVELS OMP_MAX_ACTIVE_LEVELS 32 SPARC V8 x86 4MB 64 SPARC V9 x86 8MB 2 OpenMP 17

2.2 OpenMP STACKSIZE B, K, M G setenv STACKSIZE 8192 // sets the thread stack size to 8 Megabytes setenv STACKSIZE 16M // sets the thread stack size to 16 Megabytes STACKSIZE OMP_STACKSIZE 2.2.2.8 SUNW_MP_GUIDED_WEIGHT GUIDED GUIDED 2.0 2.2.2.9 SUNW_MP_WAIT_POLICY CPU csh setenv SUNW_MP_WAIT_POLICY IDLE=val :BARRIER=val:TASKWAIT= val IDLE=val BARRIER= val TASKWAIT= val val SPIN YIELD SLEEP SPIN(time) CPU time s ms mc SPIN YIELD(number) CPU CPU YIELD number SLEEP SPIN SLEEP YIELD "SPIN(0),YIELD(0)" SLEEP IDLE BARRIER TASKWAIT SUNW_MP_WAIT_POLICY OMP_WAIT_POLICY OMP_WAIT_POLICY 18 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

2.3 % setenv SUNW_MP_WAIT_POLICY BARRIER=SPIN % setenv SUNW_MP_WAIT_POLICY IDLE=SPIN(10ms),YIELD(5) 10 CPU 5 % setenv SUNW_MP_WAIT_POLICY \ IDLE=SPIN(10ms),YIELD(2):BARRIER=SLEEP:TASKWAIT=YIELD(10) 10 CPU 2 CPU 10 2.3 n n SPARC T3 Oracle Solaris 64 Oracle Solaris psrinfo(1m) Linux /proc/cpuinfo SUNW_MP_PROCBIND OpenMP SUNW_MP_PROCBIND "TRUE" "FALSE" "COMPACT" "SCATTER" "true" "false" "compact" "scatter" % setenv SUNW_MP_PROCBIND "TRUE" 2 OpenMP 19

2.3 % setenv SUNW_MP_PROCBIND "2" % setenv SUNW_MP_PROCBIND "2 246" 2 4 6 n1 n2 ("-") n1 n2 % setenv SUNW_MP_PROCBIND "0-6" (ID) ID ID 2.3.1 ID ID Oracle Solaris psrinfo(1m) ID prtdiag(1m) psrinfo -pv ID 8 UltraSPARC IV 16 Sun Fire 4810 ID 0 1 2 3 8 9 10 11 512 513 514 515 520 521 522 523 ID 0 n ID 0 1... n-1 psrinfo(1m) SUNW_MP_PROCBIND 20 2.3.2 SUNW_MP_PROCBIND 2.3.2 SUNW_MP_PROCBIND SUNW_MP_PROCBIND FALSE SUNW_MP_PROCBIND TRUE SUNW_MP_PROCBIND COMPACT COMPACT SUNW_MP_PROCBIND SCATTER SCATTER COMPACT 20 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

2.4 SUNW_MP_PROCBIND ID ID ID n-1 ID 0 SUNW_MP_PROCBIND ID ID ID SUNW_MP_PROCBIND ("-") ID ID ID SUNW_MP_PROCBIND ID OpenMP 2.3.3 OS Oracle Solaris psrset Linux taskset SUNW_MP_PROCBIND SUNW_MP_PROCBIND Linux SUNW_MP_PROCBIND Oracle Solaris 2.4 f95 -stackvar Fortran OpenMP -stackvar -stackvar Fortran limit C-shell ulimit Bourne Korn shell 8MB OpenMP PRIVATE 2 OpenMP 21

2.5 OpenMP 32 SPARC V8 x86 4MB 64 SPARC V9 x86 8MB OMP_STACKSIZE demo% setenv OMP_STACKSIZE 16384 <-Set thread stack size to 16 Mb (C shell) demo$ OMP_STACKSIZE=16384 demo$ export OMP_STACKSIZE <-Set thread stack size to 16 Mb (Bourne/Korn shell) -xcheck=stkovf Fortran C C++ 2.5 OpenMP Oracle Solaris Studio OpenMP dbx dbx(1) tha(1) libtha(3) OpenMP collect(1) analyzer(1) 22 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

3 Oracle Solaris Studio OpenMP OpenMP 3.1 API E 3.1 3.2 (untied) (tied) (untied) OpenMP (taskwait) (taskyield) (untied) load/store load/store 23

3.3 3.3 nthreads-var nthreads-var 1 dyn-var dyn-var TRUE run-sched-var run-sched-var static def-sched-var def-sched-var static bind-var bind-var FALSE stacksize-var OpenMP stacksize-var 4 MB 32 8MB 64 wait-policy-var wait-policy-var PASSIVE thread-limit-var OpenMP thread-limit-var 1024 max-active-levels-var max-active-levels-var 4 3.4 OMP_DYNAMIC FALSE omp_set_dynamic() OpenMP 3.1 2.1 2.1 SUNW_MP_WARN TRUE sunw_mp_register_warn() 3.5 (collapsed) long run-sched-var auto schedule(runtime) static 24 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

3.7 3.6 3.6.1 SECTIONS 3.6.2 SINGLE 3.6.3 ATOMIC 3.7 sections single critical atomic 3.7.1 omp_set_num_threads() omp_set_num_threads() SUNW_MP_WARN TRUE sunw_mp_register_warn() 3.7.2 omp_set_schedule() Oracle Solaris Studio sunw_mp_sched_reserved static 3.7.3 omp_set_max_active_levels() omp_set_max_active_levels() SUNW_MP_WARN TRUE sunw_mp_register_warn() 3 25

3.8 omp_set_max_active_levels() SUNW_MP_WARN TRUE sunw_mp_register_warn() 3.7.4 omp_get_max_active_levels() omp_get_max_active_levels() max-active-levels-var 3.8 OMP_SCHEDULE OMP_SCHEDULE static dynamic guided auto static SUNW_MP_WARN TRUE sunw_mp_register_warn() OMP_SCHEDULE static dynamic guided static dynamic guided 1 SUNW_MP_WARN TRUE sunw_mp_register_warn() OMP_NUM_THREADS SUNW_MP_WARN TRUE sunw_mp_register_warn() SUNW_MP_WARN TRUE sunw_mp_register_warn() OMP_PROC_BIND OMP_DYNAMIC OMP_NESTED OMP_PROC_BIND TRUE FALSE OMP_DYNAMIC TRUE FALSE TRUE SUNW_MP_WARN TRUE sunw_mp_register_warn() OMP_NESTED TRUE FALSE FALSE SUNW_MP_WARN TRUE sunw_mp_register_warn() 26 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

3.9 Fortran OMP_STACKSIZE OMP_WAIT_POLICY OMP_STACKSIZE 32 4MB 64 8MB SUNW_MP_WARN TRUE sunw_mp_register_warn() ACTIVE PASSIVE OMP_MAX_ACTIVE_LEVELS OMP_MAX_ACTIVE_LEVELS (4) SUNW_MP_WARN TRUE sunw_mp_register_warn() OMP_THREAD_LIMIT OMP_THREAD_LIMIT (1024) SUNW_MP_WARN TRUE sunw_mp_register_warn() 3.9 Fortran Fortran 3.9.1 THREADPRIVATE (thread-private) 3.9.2 SHARED OpenMP 3.1 shared 3 27

3.9 Fortran 3.9.3 omp_lib.h omp_lib Oracle Solaris OpenMP Fortran KIND 28 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

4 4.1 OpenMP OpenMP fork-join - OpenMP OpenMP 4.2 4.2.1 OMP_NESTED OMP_NESTED omp_set_nested() 29

4.2 4 1 #include <omp.h> #include <stdio.h> void report_num_threads(int level) #pragma omp single printf("level %d: number of threads in the team - %d\n", level, omp_get_num_threads()); int main() omp_set_dynamic(0); #pragma omp parallel num_threads(2) report_num_threads(1); #pragma omp parallel num_threads(2) report_num_threads(2); #pragma omp parallel num_threads(2) report_num_threads(3); return(0); % setenv OMP_NESTED TRUE % a.out Level 1: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 % setenv OMP_NESTED FALSE % a.out Level 1: number of threads in the team - 2 Level 2: number of threads in the team - 1 Level 3: number of threads in the team - 1 Level 2: number of threads in the team - 1 Level 3: number of threads in the team - 1 30 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

4.2 4.2.2 OMP_THREAD_LIMIT OpenMP OMP_THREAD_LIMIT 1023 OMP_THREAD_LIMIT 1 SUNW_MP_MAX_POOL_THREADS 0 4 1 8 7 OMP_THREAD_LIMIT 6 SUNW_MP_MAX_POOL_THREADS 5 5 % setenv OMP_NESTED TRUE % OMP_THREAD_LIMIT 6 % a.out Level 1: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 1 Level 3: number of threads in the team - 1 4.2.3 OMP_MAX_ACTIVE_LEVELS OMP_MAX_ACTIVE_LEVELS 4 OMP_NESTED TRUE true omp_set_nested() 4 OMP_MAX_ACTIVE_LEVELS 2 3 4 #include <omp.h> #include <stdio.h> #define DEPTH 5 void report_num_threads(int level) 4 31

4.2 #pragma omp single printf("level %d: number of threads in the team - %d\n", level, omp_get_num_threads()); void nested(int depth) if (depth == DEPTH) return; #pragma omp parallel num_threads(2) report_num_threads(depth); nested(depth+1); int main() omp_set_dynamic(0); omp_set_nested(1); nested(1); return(0); 4 OS % setenv OMP_MAX_ACTIVE_LEVELS 4 % a.out sort Level 1: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 3: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 Level 4: number of threads in the team - 2 2 % setenv OMP_MAX_ACTIVE_LEVELS 2 % a.out sort Level 1: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 2: number of threads in the team - 2 Level 3: number of threads in the team - 1 Level 3: number of threads in the team - 1 Level 3: number of threads in the team - 1 Level 3: number of threads in the team - 1 32 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

4.3 OpenMP Level 4: number of threads in the team - 1 Level 4: number of threads in the team - 1 Level 4: number of threads in the team - 1 Level 4: number of threads in the team - 1 OS 4.3 OpenMP OpenMP - omp_set_num_threads() - omp_get_max_threads() - omp_set_dynamic() - omp_get_dynamic() - omp_set_nested() - omp_get_nested() set get 4 2 OpenMP #include <stdio.h> #include <omp.h> int main() omp_set_nested(1); omp_set_dynamic(0); #pragma omp parallel num_threads(2) if (omp_get_thread_num() == 0) omp_set_num_threads(4); /* line A */ else omp_set_num_threads(6); /* line B */ /* The following statement will print out * *0:24 *1:26 * * omp_get_num_threads() returns the number * of the threads in the team, so it is * the same for the two threads in the team. */ printf("%d: %d %d\n", omp_get_thread_num(), omp_get_num_threads(), omp_get_max_threads()); 4 33

4.3 OpenMP 4 2 OpenMP /* Two inner parallel regions will be created * one with a team of 4 threads, and the other * with a team of 6 threads. */ #pragma omp parallel #pragma omp master /* The following statement will print out * * Inner: 4 * Inner: 6 */ printf("inner: %d\n", omp_get_num_threads()); omp_set_num_threads(7); /* line C */ /* Again two inner parallel regions will be created, * one with a team of 4 threads, and the other * with a team of 6 threads. * * The omp_set_num_threads(7) call at line C * has no effect here, since it affects only * parallel regions at the same or inner nesting * level as line C. */ #pragma omp parallel printf("count me.\n"); return(0); % a.out 0:24 Inner: 4 1:26 Inner: 6 count me. count me. count me. count me. count me. count me. count me. count me. count me. count me. 34 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

4.4 4.4 2 CPU CPU CPU OMP_THREAD_LIMIT OMP_MAX_ACTIVE_LEVELS CPU CPU 4 35

36

5 OpenMP 5.1 while OpenMP task task (tied) (untied) (tied) untied task (untied) (tied) (untied) OpenMP (tied) (taskwait) (taskyield) 37

5.1 Oracle Solaris Studio (untied) task OpenMP parallel (tied) parallel OpenMP 3.1 (undeferred) (undeferred) if false (undeferred) (undeferred) if (included) (final) (included) (included) (undeferred) (undeferred) (undeferred) (undeferred) (undeferred) (undeferred) (included) (included) (included) (included) (merged) mergeable task (undeferred) (included) (merged) (merged) task (final) (final) (included) final task final TRUE (final) (final) (final) (included) 38 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

5.3 5.2 5.3 task default (private firstprivate shared none) private (list) firstprivate (list) shared (list) shared task private firstprivate task firstprivate OpenMP 3.0 2.9.1 OpenMP C/C++ OpenMP task taskwait parallel single fib(n) print fib(n) task fib(n-1) fib(n-2) fib(n) fib(n-1) fib(n-2) fib() 2 task final final (n <= THRESHOLD) true final (final) task (included) (final) n = 9, 8,..., 2 fib (included) (included) 5 39

5.3 taskwait fib() i j fib() single fib(n) Oracle Solaris Studio C++ 5 1 #include <stdio.h> #include <omp.h> #define THRESHOLD 5 int fib(int n) int i, j; if (n<2) return n; #pragma omp task shared(i) firstprivate(n) final(n <= THRESHOLD) i=fib(n-1); #pragma omp task shared(j) firstprivate(n) final(n <= THRESHOLD) j=fib(n-2); #pragma omp taskwait return i+j; int main() int n = 30; omp_set_dynamic(0); omp_set_num_threads(4); #pragma omp parallel shared(n) #pragma omp single printf ("fib(%d) = %d\n", n, fib(n)); % CC -xopenmp -xo3 task_example.cc % a.out fib(30) = 832040 40 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

5.4 5.4 OpenMP 5.4.1 THREADPRIVATE threadprivate (tied) threadprivate threadprivate (untied) threadprivate 5.4.2 OpenMP critical OpenMP 3.1 A OpenMP 2.5 lck OpenMP 3.1 lck 5 2 OpenMP 3.0 #include <stdlib.h> #include <stdio.h> #include <omp.h> int main() int x; omp_lock_t lck; omp_init_lock (&lck); omp_set_lock (&lck); x=0; 5 41

5.4 5 2 OpenMP 3.0 #pragma omp parallel shared (x) #pragma omp master x=x+1; omp_unset_lock (&lck); omp_destroy_lock (&lck); 5.4.3 task i shared work() i work() main() i work() task taskwait task i firstprivate shared 5 3 #include <stdio.h> #include <omp.h> void work() int i; i = 10; #pragma omp task shared(i) #pragma omp critical printf("in Task, i = %d\n",i); int main(int argc, char** argv) 42 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

5.4 5 3 omp_set_num_threads(8); omp_set_dynamic(0); #pragma omp parallel work(); 5 4 #include <stdio.h> #include <omp.h> void work() int i; i = 10; #pragma omp task shared(i) #pragma omp critical printf("in Task, i = %d\n",i); /* Use TASKWAIT for synchronization. */ #pragma omp taskwait int main(int argc, char** argv) omp_set_num_threads(8); omp_set_dynamic(0); #pragma omp parallel work(); task j sections j sections j firstprivate Oracle Solaris Studio sections sections sections j sections task taskwait task j firstprivate shared 5 43

5.4 5 5 #include <stdio.h> #include <omp.h> int main(int argc, char** argv) omp_set_num_threads(2); omp_set_dynamic(0); int j=100; #pragma omp parallel shared(j) #pragma omp sections firstprivate(j) #pragma omp section #pragma omp task shared(j) #pragma omp critical printf("in Task, j = %d\n",j); printf("after parallel, j = %d\n",j); 5 6 #include <stdio.h> #include <omp.h> int main(int argc, char** argv) omp_set_num_threads(2); omp_set_dynamic(0); int j=100; #pragma omp parallel shared(j) #pragma omp sections firstprivate(j) #pragma omp section #pragma omp task shared(j) #pragma omp critical printf("in Task, j = %d\n",j); /* Use TASKWAIT for synchronization. */ #pragma omp taskwait printf("after parallel, j = %d\n",j); 44 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

5.4 5 6 5 45

46

6 OpenMP OpenMP 2 OpenMP OpenMP OpenMP API OpenMP 2 OpenMP OpenMP 3.0 OpenMP 3.0 task Oracle Solaris Studio parallel Oracle Solaris Studio task 6.1 auto default( auto) Oracle Solaris Studio OpenMP 47

6.2 6.1.1 auto auto(list-of-variables) Fortran AUTO(list-of-variables) auto auto auto PARALLEL PARALLEL DO/for PARALLEL SECTIONS Fortran 95 PARALLEL WORKSHARE TASK auto 6.1.2 default( auto) default( auto) Fortran DEFAULT( AUTO) default( auto) default( auto) PARALLEL PARALLEL DO/for PARALLEL SECTIONS Fortran 95 PARALLEL WORKSHARE TASK 6.2 OpenMP DO FOR 6.2.1 PS1-PS3 PS1 SHARED 48 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.3 PS2 PRIVATE PRIVATE PARALLEL DO PARALLEL SECTIONS LASTPRIVATE PS3 REDUCTION 6.2.2 PA1 SHARED 6.3 task OpenMP PARALLEL DO/for 6.3.1 TS1-TS5 TS1 task FIRSTPRIVATE TS2 SHARED TS3 FIRSTPRIVATE TS4 PRIVATE TS5 FIRSTPRIVATE 6.3.2 6 49

6.4 6.4 _auto(list-of-variables) default(_auto) parallel default(_auto) _auto(list-of-variables) parallel task SHARED parallel task IF (.FALSE.) if(0) 6.5 -xopenmp -xo3 -xopenmp=noopt C C++ C C++ #pragma omp task /* task1 */... #pragma omp task /* task 2 */...... task2 task1 task2 SHARED task2 IF(.FALSE.) if(0) 50 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.6 OpenMP OpenMP omp_set_lock() omp_unset_lock() CRITICAL END CRITICAL OpenMP BARRIER MASTER 6.6 -g er_src er_src Oracle Solaris Studio er_src(1) Oracle Solaris Studio -xvpara xvpara 6 1 -vpara %cat source1.f INTEGER X(100), Y(100), I, T C$OMP PARALLEL DO DEFAULT( AUTO) DO I=1, 100 T = Y(I) X(I) = T*T END DO C$OMP END PARALLEL DO END %f95 -xopenmp -xo3 -vpara -c -g source1.f "source1.f", line 2: Autoscoping for OpenMP construct succeeded. Check er_src for details -xvpara 6 2 -vpara %cat source2.f INTEGER X(100), Y(100), I, T C$OMP PARALLEL DO DEFAULT( AUTO) DO I=1, 100 T = Y(I) CALL FOO(X) X(I) = T*T END DO C$OMP END PARALLEL DO END 6 51

6.7 6 2 -vpara %f95 -xopenmp -xo3 -vpara -c -g source2.f "source2.f", line 2: Warning: Autoscoping for OpenMP construct failed. Check er-src for details. Parallel region will be executed by a single thread. er_src 6 3 er_src % er_src source2.o Source file: source2.f Object file: source2.o Load Object: source2.o 1. INTEGER X(100), Y(100), I, T Source OpenMP region below has tag R1 Variables autoscoped as SHARED in R1: y Variables autoscoped as PRIVATE in R1: t, i Variables treated as shared because they cannot be autoscoped in R1: x R1 will be executed by a single thread because autoscoping for some variable s was not successful Private variables in R1: i, t Shared variables in R1: y, x 2. C$OMP PARALLEL DO DEFAULT( AUTO) Source loop below has tag L1 L1 parallelized by explicit user directive L1 autoparallelized L1 parallel loop-body code placed in function _$d1a2.main_ along with 0 inne r loops L1 could not be pipelined because it contains calls 3. DO I=1, 100 4. T = Y(I) 5. CALL FOO(X) 6. X(I) = T*T 7. END DO 8. C$OMP END PARALLEL DO 9. END 10. 6.7 6 4 1. REAL FUNCTION FOO (N, X, Y) 2. INTEGER N, I 3. REAL X(*), Y(*) 4. REAL W, MM, M 52 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.7 6 4 5. 6. W = 0.0 7. 8. C$OMP PARALLEL DEFAULT( AUTO) 9. 10. C$OMP SINGLE 11. M = 0.0 12. C$OMP END SINGLE 13. 14. MM = 0.0 15. 16. C$OMP DO 17. DOI=1,N 18. T = X(I) 19. Y(I) = T 20. IF (MM.GT. T) THEN 21. W=W+T 22. MM = T 23. END IF 24. END DO 25. C$OMP END DO 26. 27. C$OMP CRITICAL 28. IF ( MM.GT. M ) THEN 29. M = MM 30. END IF 31. C$OMP END CRITICAL 32. 33. C$OMP END PARALLEL 34. 35. FOO=W-M 36. 37. RETURN 38. END FOO() SINGLE DO CRITICAL OpenMP 1. X Y 2. X M 3. X W I N MM T W M X Y I DO OpenMP I PRIVATE N S1 SHARED 6 53

6.7 14 MM 0.0 S1 MM S2 MM PRIVATE T PRIVATE W 21 S1 S2 S3 W REDUCTION(+) M 11 SINGLE SINGLE 11 28 29 CRITICAL M M S1 M SHARED X A1 SHARED Y Y A1 Y SHARED 6 5 QuickSort static void par_quick_sort (int p, int r, float *data) if (p < r) int q = partition (p, r, data); #pragma omp task default( auto) if ((r-p)>=low_limit) par_quick_sort (p, q-1, data); #pragma omp task default( auto) if ((r-p)>=low_limit) par_quick_sort (q+1, r, data); int main ()... #pragma omp parallel #pragma omp single nowait par_quick_sort (0, N-1, &Data[0]);... er_src result: Source OpenMP region below has tag R1 Variables autoscoped as FIRSTPRIVATE in R1: p, q, data Firstprivate variables in R1: data, p, q 47. #pragma omp task default( auto) if ((r-p)>=low_limit) 48. par_quick_sort (p, q-1, data); 54 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.7 6 5 QuickSort Source OpenMP region below has tag R2 Variables autoscoped as FIRSTPRIVATE in R2: q, r, data Firstprivate variables in R2: data, q, r 49. #pragma omp task default( auto) if ((r-p)>=low_limit) 50. par_quick_sort (q+1, r, data); p q TS1 FIRSTPRIVATE 6 6 Fibbonacci int fib (int n) int x, y; if (n < 2) return n; #pragma omp task default( auto) x = fib(n - 1); #pragma omp task default( auto) y = fib(n - 2); #pragma omp taskwait return x+y; er_src result: Source OpenMP region below has tag R1 Variables autoscoped as SHARED in R1: x Variables autoscoped as FIRSTPRIVATE in R1: n Shared variables in R1: x Firstprivate variables in R1: n 24. #pragma omp task default( auto) /* shared(x) firstprivate(n) */ 25. x = fib(n - 1); Source OpenMP region below has tag R2 Variables autoscoped as SHARED in R2: y Variables autoscoped as FIRSTPRIVATE in R2: n Shared variables in R2: y Firstprivate variables in R2: n 26. #pragma omp task default( auto) /* shared(y) firstprivate(n) */ 27. y = fib(n - 2); 28. 29. #pragma omp taskwait 30. return x+y; 31. n TS1 n FIRSTPRIVATE x y fib() x y taskwait fib() fib() x y 6 55

6.7 6 6 Fibbonacci TS2 x y SHARED 6 7 int main(void) int yy = 0; #pragma omp parallel default( auto) shared(yy) int xx = 0; #pragma omp single #pragma omp task default( auto) // task1 xx = 20; #pragma omp task default( auto) // task2 yy = xx; return 0; er_src result: Source OpenMP region below has tag R1 Variables autoscoped as PRIVATE in R1: xx Private variables in R1: xx Shared variables in R1: yy 7. #pragma omp parallel default( auto) shared(yy) 8. 9. int xx = 0; 10. Source OpenMP region below has tag R2 11. #pragma omp single 12. Source OpenMP region below has tag R3 Variables autoscoped as SHARED in R3: xx Shared variables in R3: xx 13. #pragma omp task default( auto) // task1 14. 15. xx = 20; 16. 17. 18. Source OpenMP region below has tag R4 Variables autoscoped as PRIVATE in R4: yy 56 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

6.7 6 7 Variables autoscoped as FIRSTPRIVATE in R4: xx Private variables in R4: yy Firstprivate variables in R4: xx 19. #pragma omp task default( auto) // task2 20. 21. yy = xx; 22. 23. xx xx task1 xx task2 task1 xx task1 xx task1 TS2 task1 xx SHARED task2 xx xx xx PRIVATE xx task2 TS3 task2 xx FIRSTPRIVATE task2 yy task2 yy TS4 task2 yy PRIVATE 6 8 int foo(void) intxx=1,yy=0; #pragma omp parallel shared(xx,yy) #pragma omp task default( auto) xx += 1; #pragma omp atomic yy += xx; #pragma omp taskwait return 0; er_src result: Source OpenMP region below has tag R1 Shared variables in R1: yy, xx 5. #pragma omp parallel shared(xx,yy) 6. 6 57

6.7 6 8 Source OpenMP region below has tag R2 Variables autoscoped as SHARED in R2: yy Variables autoscoped as FIRSTPRIVATE in R2: xx Shared variables in R2: yy Firstprivate variables in R2: xx 7. #pragma omp task default( auto) 8. 9. xx += 1; 10. 11. #pragma omp atomic 12. yy += xx; 13. 14. 15. #pragma omp taskwait 16. task xx x x xx SHARED x TS5 xx FIRSTPRIVATE task yy taskwait yy TS2 yy SHARED 58 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

7 SHARED Oracle Solaris Studio C C++ Fortran OpenMP 7.1 -xvpara -xopenmp -xo3 OpenMP -xopenmp=noopt -xo3 OpenMP 7 1 % cat t.c #include <omp.h> #include <string.h> int main() 59

7.1 7 1 int g[100], b, i; memset(g, 0, sizeof(int)*100); #pragma omp parallel for shared(b) for (i = 0; i < 100; i++) b += g[i]; return 0; % cc -xopenmp -xo3 -xvpara source1.c "source1.c", line 10: Warning: inappropriate scoping variable b may be scoped inappropriately as shared. write at line 13 and write at line 13 may cause data race "source1.c", line 10: Warning: inappropriate scoping variable b may be scoped inappropriately as shared. write at line 13 and read at line 13 may cause data race -xo3 % cc -xopenmp=noopt -xvpara source1.c "source1.c", line 10: Warning: Scope checking under vpara compiler option is supported with optimization level -xo3 or higher. Compile with a higher optimization level to enable this feature 7 2 % cat source2.c #include <omp.h> int main() int g[100]; int r=0, a=1, b, i; #pragma omp parallel for private(a) lastprivate(i) reduction(+:r) for (i = 0; i < 100; i++) g[i] = a; b=b+g[i]; r=r*g[i]; a=b; return 0; 60 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

7.2 7 2 % cc -xopenmp -xo3 -xvpara source2.c "source2.c", line 8: Warning: inappropriate scoping variable r may be scoped inappropriately as reduction. reference at line 13 may not be a reduction of the specified type "source2.c", line 8: Warning: inappropriate scoping variable a may be scoped inappropriately as private. read at line 11 may be undefined. consider firstprivate "source2.c", line 8: Warning: inappropriate scoping variable i may be scoped inappropriately as lastprivate. value defined inside the parallel construct is not used outside. consider private "source2.c", line 8: Warning: inappropriate scoping variable b may be scoped inappropriately as shared. write at line 12 and write at line 12 may cause data race "source2.c", line 8: Warning: inappropriate scoping variable b may be scoped inappropriately as shared. write at line 12 and read at line 12 may cause data race 1. r + * 2. a PRIVATE PRIVATE 11 a a FIRSTPRIVATE 3. i LASTPRIVATE i i PRIVATE PRIVATE LASTPRIVATE 4. b OpenMP 3.0 79 27-28 b SHARED b SHARED b REDUCTION 7.2 -xo3 -xopenmp=noopt OpenMP BARRIER MASTER 7 61

62

8 OpenMP OpenMP Oracle Solaris Studio OpenMP http://www.oracle.com/technetwork/server-storage/ solarisstudio 8.1 OpenMP BARRIER CRITICAL ORDERED NOWAIT NOWAIT DO CRITICAL FLUSH SPIN SUNW_MP_THR_IDLE DO/FOR 63

8.1!$OMP PARALLEL...!$OMP DO...!$OMP END DO...!$OMP END PARALLEL!$OMP PARALLEL...!$OMP DO...!$OMP END DO...!$OMP END PARALLEL!$OMP PARALLEL...!$OMP DO...!$OMP END DO...!$OMP DO...!$OMP END DO!$OMP END PARALLEL PARALLEL DO/FOR DO/FOR PARALLEL DO/FOR!$OMP PARALLEL!$OMP DO...!$OMP END DO!$OMP END PARALLEL!$OMP PARALLEL DO...!$OMP END PARALLEL Oracle Solaris SUNW_MP_PROCBIND 19 2.3 MASTER SINGLE MASTER BARRIER IF IF(omp_get_thread_num() == 0)... 64 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

8.1 SINGLE SINGLE NOWAIT BARRIER STATIC STATIC DYNAMIC GUIDED LASTPRIVATE DO/FOR malloc() free() / libc malloc() free() libmtmalloc -lmtmalloc libmtmalloc OpenMP PARALLEL if!$omp parallel do do i =......statements_1... end do!$omp parallel do do i =......statements_2... end do!$omp parallel do do i =......statements_1......statements_2... end do OpenMP 11 1.2 8 65

8.2 8.2 OpenMP 8.2.1 UltraSPARC CPU OpenMP 8.2.2 chunksize 66 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

8.3 Oracle Solaris OS 8.3 Oracle Solaris OS Oracle Solaris OpenMP (Memory Placement Optimization, MPO) (Multiple Page Size Support, MPSS) MPO OS SunFire E20K SunFire E25K UniBoard UniBoard MPO UniBoard MPSS Oracle Solaris UltraSPARC 8KB AMD64 Opteron 4KB TLB Oracle Solaris Studio TLB Oracle Solaris OS /usr/bin/pagesize -a pagesize(1) Oracle Solaris OS ppgsz(1) -xpagesize -xpagesize_heap -xpagesize_stack MPSS mpss.so.1(1) 8 67

68

A A 1 Pragma /Pragma parallel do/for sections single parallel do/for parallel sections parallel workshare task if + + + + + private + + + + + + + + shared + + + + + firstprivate + + + + + + + + lastprivate + + + + default + + + + + reduction + + + + + + copyin + + + + copyprivate + (1) ordered + + schedule + + nowait + (2) + (2) + (2) num_threads + + + + untied + final + mergeable + auto + + + + + 69

1. Fortran COPYPRIVATE END SINGLE 2. Fortran NOWAIT END DO END SECTIONS END SINGLE END WORKSHARE 3. Fortran WORKSHARE PARALLEL WORKSHARE 70 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

A auto, 47 48, 48 D default(_auto), 47 48 G guided, 18 O OMP_DYNAMIC, 15 OMP_MAX_ACTIVE_LEVELS, 15, 31 OMP_NESTED, 15, 29 OMP_NUM_THREADS, 15 OMP_PROC_BIND, 15 OMP_SCHEDULE, 15 OMP_STACKSIZE, 15 OMP_THREAD_LIMIT, 15 OMP_WAIT_POLICY, 15 OpenMP API, 11 Oracle Solaris OS, 67 S SLEEP, 16 SPIN, 16 STACKSIZE, 17 -stackvar, 21 SUNW_MP_MAX_POOL_THREADS, 31 SUNW_MP_THR_IDLE, 16 SUNW_MP_WAIT_POLICY, 18 SUNW_MP_WARN, 16 X -xopenmp, 13 OpenMP, 13 22, 51 52, 48 49, 47 58 P PARALLEL, 16 pragma, 12,, 29 71

, OMP_SCHEDULE, 15 (memory placement optimization, MPO), 67, 15, 15, 29, 21, 17, 21,, 49, 15 19, 23, 66, 66, 18,, 7, 7, 16, 66, 16, 17, OMP_NUM_THREADS, 15, 63, 12 72 Oracle Solaris Studio 12.3 OpenMP API 2011 12 E26443-01

, 47 58 73

74