正在加载图片...
If a construct creates a data environment,the data environment is created at the time the 23 construct is encountered.Whether a construct creates a data environment is defined in the description of the construct. 45 When any thread encounters a parallel construct,the thread creates a team of itself and zero or more additional threads and becomes the master of the new team.A set of 67 implicit tasks,one per thread,is generated.The code for each task is defined by the code 89 parallel construct.Each task is assigned to a different threa assigned.The task region of the task being executed by the encountering thread is suspended,and each member of the new team executes its implicit task.There is an 11 implicit barrier at the end of the parallel construct.Only the master thread resumes 1 execution beyond the end of the parallel construct,resuming the task region that 1314 was suspended upon encountering the parallel construct.Any number of can be specified in a single program parallel regions may be arbitrarily nested inside each other.If nested parallelism is 16 disabled,or is not supported by the OpenMP implementation,then the new team that is 71819 countering a parallel construct inside a paralle wrea.However.if nested paralle and enabled,then the new team can consist of more than one thread.A parallel construct may include a proc_bind clause to specify the places to use for the threads 1 in the team within the parallel region. 2223 When any team encounters a worksharing construct,the work inside the construct is divided among the members of the team,and executed cooperatively instead of being executed by every thread.There is a default barrier at the end of each worksharing construct unless the nowait clause is present.Redundant execution of code by every 26 thread in the team resumes after the end of the worksharing construct. 272 When any thread encounters a task construct,a new explicit task is generated Execution of explicitly generated tasks is assigned to one of the threads in the current team,subject to the thread's availability to execute work.Thus,execution of the new 3 task could be immediate,or deferred until later according to task scheduling constraints 31233 and thread availability.Threads are allowed to suspend the current task region at a task scheduling point in rder to exec nded task region is for a tied tas the initially assined threopot the suspernded tasl 34 region.If the suspended task region is for an untied task,then any thread may resume its execution.Completion of all explicit tasks bound to a given parallel region is guaranteed 36 before the master thread leaves the implicit barrier at the end of the region.Completion 73839 of a subset of all explicit tasks bound to a given parallel region may be specified through the of task s cons ompletion of all explicit tasks bound to the implicit parallel region is guaranteed by the time the program exits. 40 When any thread encounters a simd construct,the iterations of the loop associated with the construct may be executed concurrently using the SIMD lanes that are available to 4 the thread. Chapter 1 Introduction 15Chapter 1 Introduction 15 If a construct creates a data environment, the data environment is created at the time the construct is encountered. Whether a construct creates a data environment is defined in the description of the construct. When any thread encounters a parallel construct, the thread creates a team of itself and zero or more additional threads and becomes the master of the new team. A set of implicit tasks, one per thread, is generated. The code for each task is defined by the code inside the parallel construct. Each task is assigned to a different thread in the team and becomes tied; that is, it is always executed by the thread to which it is initially assigned. The task region of the task being executed by the encountering thread is suspended, and each member of the new team executes its implicit task. There is an implicit barrier at the end of the parallel construct. Only the master thread resumes execution beyond the end of the parallel construct, resuming the task region that was suspended upon encountering the parallel construct. Any number of parallel constructs can be specified in a single program. parallel regions may be arbitrarily nested inside each other. If nested parallelism is disabled, or is not supported by the OpenMP implementation, then the new team that is created by a thread encountering a parallel construct inside a parallel region will consist only of the encountering thread. However, if nested parallelism is supported and enabled, then the new team can consist of more than one thread. A parallel construct may include a proc_bind clause to specify the places to use for the threads in the team within the parallel region. When any team encounters a worksharing construct, the work inside the construct is divided among the members of the team, and executed cooperatively instead of being executed by every thread. There is a default barrier at the end of each worksharing construct unless the nowait clause is present. Redundant execution of code by every thread in the team resumes after the end of the worksharing construct. When any thread encounters a task construct, a new explicit task is generated. Execution of explicitly generated tasks is assigned to one of the threads in the current team, subject to the thread's availability to execute work. Thus, execution of the new task could be immediate, or deferred until later according to task scheduling constraints and thread availability. Threads are allowed to suspend the current task region at a task scheduling point in order to execute a different task. If the suspended task region is for a tied task, the initially assigned thread later resumes execution of the suspended task region. If the suspended task region is for an untied task, then any thread may resume its execution. Completion of all explicit tasks bound to a given parallel region is guaranteed before the master thread leaves the implicit barrier at the end of the region. Completion of a subset of all explicit tasks bound to a given parallel region may be specified through the use of task synchronization constructs. Completion of all explicit tasks bound to the implicit parallel region is guaranteed by the time the program exits. When any thread encounters a simd construct, the iterations of the loop associated with the construct may be executed concurrently using the SIMD lanes that are available to the thread. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有