25.html

来自「国外MPI教材」· HTML 代码 · 共 21 行

HTML
21
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />	<style type="text/css">	body { font-family: Verdana, Arial, Helvetica, sans-serif;}	a.at-term {	font-style: italic; }	</style>	<title>Operation of a Parallel Region</title>	<meta name="Generator" content="ATutor">	<meta name="Keywords" content=""></head><body> <h3>Setting the Number of Threads</h3>

<p>The number of threads created when entering parallel regions is controlled by the value of the environment variable OMP_NUM_THREADS. The number of threads can also be set by a function call from within the program, which takes precedence over the environment variable. It is possible to vary the number of threads created in subsequent parallel regions. Each thread executes the block of code enclosed by the parallel region.</p>

<h3>Synchronizing Threads</h3>

<p>In general, there is no synchronization between threads! Different threads may reach the end of the parallel region at different times.  OpenMP does provide constructs for synchronization, but code should not be written in such a way that its output depends upon different threads executing statements at particular times. When all threads reach the end of the parallel region, all but the master thread go out of existence and the master continues alone.</p></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?