📄 46.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>Messages</title> <meta name="Generator" content="ATutor"> <meta name="Keywords" content=""></head><body> <p>So far, we have learned how to write a parallel program without data exchanged between processes.</p>
<p>One of the most popular communication techniques for sharing data between processors in a distributed memory environment is message passing. With message passing, when the programmer wishes to share a piece of data with
another processor, a library routine is called that instructs the system to take a sequence of memory locations and send them to another processor. Depending on the protocol, the receiving processor may or may not have
to make a library call that initiates a receive.</p>
<p>You can see that while OpenMP uses shared variables as its communication protocol, message passing requires a higher degree of effort to share data between processes. This is a key difference between MPI and OpenMP.</p>
<p class="codelang">
OpenMP</p>
<ul>
<li>
Pro - communication via shared variables easier to program</li>
<li>
Con - restricted to shared memory machines</li>
</ul>
<p class="codelang">
MPI</p>
<ul>
<li>
Pro - allows programs to scale to multiple machines and much higher processor
counts</li>
<li>
Con - communication via message passing significantly harder</li>
</ul>
<p>A message contains two pieces of information:</p>
<ul>
<li>
Address information about the sending and receiving process</li>
<li>
Data to be transferred between processes</li>
</ul>
<p>The message data consists of an array of elements of some particular MPI datatype. MPI datatypes will be explained in the next section.
</p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -