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

📄 81.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>Measuring Parallel Performance</title>	<meta name="Generator" content="ATutor">	<meta name="Keywords" content=""></head><body> <p>The most important measure of a parallel application's performance is the <em><a href="../glossary.html#speedup+factor" target="body" class="at-term">speedup factor</a></em>, the ratio of the execution time on one processor to that on n processors. This is, after all, what parallel programming is all about: decreasing the time to obtain the solution of a problem. </p>

<p>Note that we are usually interested in taking a ratio of elapsed, or wallclock, times, rather than CPU times. When aggregated over all processors, the total CPU time used in a parallel application will generally be <em>higher</em> than that used by the corresponding serial code. This is because the total amount of computation is basically fixed but, in addition, there are overheads coming from the need for communication, synchronization, etc. This is usually not important, however; what we are really interested in is how much faster the solution is obtained in <em>real</em> time. </p>

<p>The speedup factor typically increases as the number of processors is increased (for fixed problem size), until at some point a maximum is reached and the performance begins to decrease. This reflects that as processors are added, the portion of "useful" work done by each decreases (it sees a smaller and smaller portion of the total problem), while the communication overheads are generally increasing. Eventually the latter comes to dominate and adding additional processors gains nothing. </p>

<p>In addition to the speedup, one can examine the <em><a href="../glossary.html#parallel+efficiency" target="body" class="at-term">parallel efficiency</a></em>, which is simply the speedup for <em>n</em> processors divided by <em>n</em>. 
It measures how much of each processor is being effectively used in parallel. An efficiency of one indicates <i>perfect scaling</i>; that is, with n processors the code speeds up by a factor of n. An efficiency greater than one indicates 
<em>superlinear scaling</em> which is possible in some cases because of cache effects. As the number of processors is increased, the smaller datasets seen by each processor fit more readily into cache, leading to improved performance. 
</p>

<p>There are many other interesting questions you can ask about the performance of a parallel application. For example, it may be useful to determine what fraction of the execution time is spent on communication versus computation, how much idle time individual processors may experience, and so on. When attempting to tune parallel applications, detailed information like this may be very helpful in identifying bottlenecks and diagnosing problems. </p>

<p>Different systems may provide tools for measuring the overall executing time of an application. To obtain more detailed information, a useful technique is to measure the time before and after some critical section of code and then 
compute the difference to get the elapsed time. A particularly convenient function for obtaining real clock times is MPI_WTIME. The following pseudo-code shows how it is typically used: </p>

<pre><code>...
t_start = MPI_WTIME()

[section of code to be timed]

t_end = MPI_WTIME()
elapsed_time = tend - tstart
...</code></pre>
    
<p>Keep in mind that in an MPI environment, each process measures its own elapsed time. Variations in this time are expected, but large differences may indicate 
<em><a href="../glossary.html#load+balancing" target="body" class="at-term">load balancing</a></em> problems. </p></body></html>

⌨️ 快捷键说明

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