⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 75.html

📁 国外MPI教材
💻 HTML
字号:
<!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>OpenMP Threads Created</title>	<meta name="Generator" content="ATutor">	<meta name="Keywords" content=""></head><body> <h3>Confirming the OpenMP threads</h3>

<p>As discussed in the last section, when the parallel search program was executed, 4 MPI processes were requested. The name of the parallel program run was mark. In addition, three of the MPI processes (the workers) created 4 OpenMP threads. The second ps call should show that the proper threads were created. Here is the output from the second ps call: </p>

<pre><code> R: 2 T: 0  ps within OpenMP
       PID       PPID    STIME     ELAPSED  P COMMAND
   1255106    1265106 15:55:22        0:02  * sh 
   1120158    1135850 10:28:28     5:26:56  * sh 
<em><FONT COLOR=red>   1263527    1264866 15:55:24        0:00  2 mark 
</FONT></em>
   1247528    1256632 15:33:53       21:31  * sh 
   1264741    1255106 15:55:23        0:01  * mpirun 
<em><FONT COLOR=red>   1264817    1264866 15:55:24        0:00 21 mark 
</FONT></em>
<em><FONT COLOR=#6600CC>   1264866    1264945 15:55:23        0:01 14 mark 
</FONT></em>
   1264945    1264741 15:55:23        0:01  * mark 
<em><FONT COLOR=#6600CC>   1265077    1264945 15:55:23        0:01 18 mark
</FONT></em> 
   1265106    1265399 15:55:21        0:03  * sh 
<em><FONT COLOR=#6600CC>   1265121    1264945 15:55:23        0:01  * mark 
</FONT></em>
<em><FONT COLOR=red>   1265274    1264866 15:55:24        0:00  7 mark 
</FONT></em>
<em><FONT COLOR=blue>   1265296    1265121 15:55:24        0:00  * mark 
   1265297    1265121 15:55:24        0:00 26 ps 
   1265299    1265121 15:55:24        0:00 13 mark 
</FONT></em>
<em><FONT COLOR=green>   1265312    1265333 15:55:24        0:00  3 mark 
</font></em>
   1265314    1265121 15:55:24        0:00 27 mark 
<em><FONT COLOR=#6600CC>   1265333    1264945 15:55:23        0:01 16 mark 
</FONT></em>
<em><FONT COLOR=red>   1265338    1264866 15:55:24        0:00  * mark 
</FONT></em>
<em><FONT COLOR=green>   1265392    1265333 15:55:24        0:00 17 mark 
</FONT></em>
<em><FONT COLOR=blue>   1265407    1265121 15:55:24        0:00  0 mark 
</FONT></em>
<em><FONT COLOR=green>   1265421    1265333 15:55:24        0:00  * mark
</FONT></em> 
<em><FONT COLOR=green>   1251653    1265333 15:55:24        0:00  4 mark 
</FONT></em></code></pre>


<p>As expected the four MPI processes (shown in <FONT COLOR=#6600CC>purple</FONT>) are still in existence; this is comforting since the program is still running. But what can also be seen in this ps output is there are now three sets of 4 OpenMP threads, as well. We know this to be true in the same manner as before. Each set of OpenMP threads has the same Parent Process ID and has the same name (i.e., mark-the program name). For convenience we have marked the three sets of OpenMP threads with colors:</p>

<ul>
  <li>Threads shown in <FONT COLOR=green>green</FONT> have PPID 1265333 </li>
  <li>Threads shown in <FONT COLOR=blue>blue</FONT> have PPID 1265121</li>
  <li>Threads shown in <FONT COLOR=red>red</FONT> have PPID 1264866</li>
</ul>

<p>But as in the last section, the critical column is labelled P because it shows that when a thread or process is executing it is doing so on a <em>separate</em> processor.</p></body></html>

⌨️ 快捷键说明

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