📄 56.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>Barrier Synchronization</title> <meta name="Generator" content="ATutor"> <meta name="Keywords" content=""></head><body> <p>Since each process in a parallel program executes some percentage of different paths in the program compared to other processes, the processes generally fall out of synchronization. With certain commands, the processes
will synchronize by nature of the procedure. One of these is the barrier routine.</p>
<dl>
<dt>Barrier Synchronization</dt>
<dd>Red light for each processor: turns green when all processors
have arrived</dd>
</dl>
<img SRC="barrier.gif" height=330 width=618>
<p>The purpose of the barrier routine is to get all of the processes at the same position in the code before allowing them to continue. This is often needed in parallel algorithms.</p>
<p>In most MPI implementations, the barrier routine is implemented in software. In some machines, however, hardware barriers allow for very efficient performance (Example: Cray T3E)</p>
<p class="codelang">
C:</p>
<pre><code>int MPI_Barrier (MPI_Comm comm)</code></pre>
<p class="codelang">
Fortran:</p>
<pre><code>CALL MPI_BARRIER(COMM,IERROR)
INTEGER COMM,IERROR</code></pre></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -