blob: 317c6ede33c084dcdc82c8ea1b5fb05a40dcc033 [file] [log] [blame]
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Impala: be/src/experiments/hashing/prefetch/growing-test.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Impala
</div>
<div id="projectbrief">Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('prefetch_2growing-test_8cc_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">growing-test.cc</div> </div>
</div><!--header-->
<div class="contents">
<a href="prefetch_2growing-test_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#include &lt;gtest/gtest.h&gt;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &quot;hash-store.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="preprocessor">#include &quot;standard-hash-table.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &quot;tuple-types.h&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cpu-info_8h.html">util/cpu-info.h</a>&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="debug-util_8h.html">util/debug-util.h</a>&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="stopwatch_8h.html">util/stopwatch.h</a>&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="keyword">using namespace </span>impala;</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="keyword">namespace </span>impala {</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// Tests performance of hash aggregation with HashStore, which grows to contain multiple</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">// hash tables as needed. Allows exploring how buffer size and size of the keyspace</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// affect performance.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="keyword">class </span><a class="code" href="classimpala_1_1GrowingTest.html">GrowingTest</a> : <span class="keyword">public</span> <a class="code" href="cache-hash-test_8cc.html#a18269e3eecadb27e79614c02d898173e">testing::Test</a> {</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classuint64__t.html">uint64_t</a> <a class="code" href="classimpala_1_1GrowingTest.html#a50edab0a09bca91d335a968243b1df61">NUM_PROBE_TUPLES</a> = 100000000; <span class="comment">// 10^8</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> buffer_size&gt;</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classimpala_1_1GrowingTest.html#ad18833ec7593982e80375fed4af22426"> 22</a></span>&#160; <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="classuint64__t.html">uint64_t</a> <a class="code" href="classimpala_1_1GrowingTest.html#ad18833ec7593982e80375fed4af22426">AggregateTest</a>(<a class="code" href="classuint64__t.html">uint64_t</a> num_probe_tuples, <span class="keywordtype">int</span> max_id,</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <span class="keywordtype">int</span> num_tables) {</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; ProbeTuple* <a class="code" href="partitioning-throughput-test_8cc.html#ae4b10d42a9e46f75d00a40862197374e">tuples</a> = GenTuples(num_probe_tuples, max_id);</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; HashStore&lt;buffer_size&gt; hs;</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <a class="code" href="classimpala_1_1StopWatch.html">StopWatch</a> watch;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; watch.<a class="code" href="classimpala_1_1StopWatch.html#a811ac5c8ae0f5de261c62aba58d911f6">Start</a>();</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; hs.Aggregate(tuples, num_probe_tuples);</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; watch.<a class="code" href="classimpala_1_1StopWatch.html#abb3886869c34e8e9a3d2d43a41631dac">Stop</a>();</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; SanityCheck&lt;buffer_size&gt;(hs, num_probe_tuples, max_id, num_tables);</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; free(tuples);</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keywordflow">return</span> watch.Ticks();</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; }</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="comment">// Confirm that hs appears to be the correct result of aggregating num_probe_tuples,</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="comment">// with a keyspace of size max_id, with a fanout into num_tables tables.</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> buffer_size&gt;</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classimpala_1_1GrowingTest.html#abb3a288cfd6e791c374f01a8ec3151c3"> 38</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classimpala_1_1GrowingTest.html#abb3a288cfd6e791c374f01a8ec3151c3">SanityCheck</a>(<span class="keyword">const</span> HashStore&lt;buffer_size&gt; &amp; hs,</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <a class="code" href="classuint64__t.html">uint64_t</a> num_probe_tuples, <span class="keywordtype">int</span> max_id, <span class="keywordtype">int</span> num_tables) {</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <a class="code" href="classuint64__t.html">uint64_t</a> total_count = 0;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; hs.num_tables_; ++i) {</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; StandardHashTable&amp; ht = hs.tables_[i];</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordflow">for</span> (StandardHashTable::Iterator it = ht.Begin(); it.HasNext(); it.Next()) {</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; total_count += it.GetRow()-&gt;count;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; }</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; }</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; ASSERT_EQ(num_probe_tuples, total_count);</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; ASSERT_EQ(num_tables, hs.num_tables_)</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; &lt;&lt; <span class="stringliteral">&quot;You do not have the number of tables that you hoped.\n&quot;</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; &lt;&lt; <span class="stringliteral">&quot;This could mean that there weren&#39;t enough probe tuples to fill the keyspace, &quot;</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; &lt;&lt; <span class="stringliteral">&quot;skewed hashing lead a hash table that we expected not to overflow to overflow, &quot;</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; &lt;&lt; <span class="stringliteral">&quot;or a genuine bug.&quot;</span>;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordflow">if</span> (buffer_size &gt; 0) {</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; ASSERT_EQ(buffer_size, <span class="keyword">sizeof</span>(<span class="keyword">typename</span> <a class="code" href="partitioning-throughput-test_8cc.html#a21a2991bad371e69e271208a9349d895">HashStore&lt;buffer_size&gt;::Buffer</a>));</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; }</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; }</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> buffer_size&gt;</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classimpala_1_1GrowingTest.html#a9b19d39017848bcd50d540f913f14a38"> 59</a></span>&#160; <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="classuint64__t.html">uint64_t</a> <a class="code" href="classimpala_1_1GrowingTest.html#a9b19d39017848bcd50d540f913f14a38">NextTestCase</a>(<span class="keywordtype">int</span> build_tuples, <a class="code" href="classuint64__t.html">uint64_t</a> prev, <span class="keywordtype">int</span> num_tables) {</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <a class="code" href="classuint64__t.html">uint64_t</a> time = AggregateTest&lt;buffer_size&gt;(<a class="code" href="classimpala_1_1GrowingTest.html#a50edab0a09bca91d335a968243b1df61">NUM_PROBE_TUPLES</a>, build_tuples, num_tables);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; int64_t delta;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">if</span> (prev == 0) {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// just print 0 for the delta the first time.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; delta = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; }</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; delta = <span class="keyword">static_cast&lt;</span>int64_t<span class="keyword">&gt;</span>(time) - static_cast&lt;int64_t&gt;(prev);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; }</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; LOG(ERROR) &lt;&lt; build_tuples &lt;&lt; <span class="stringliteral">&quot;\t&quot;</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; &lt;&lt; <a class="code" href="classimpala_1_1PrettyPrinter.html#a6e5f06a1ce274f747cc4f9928b797c5a">PrettyPrinter::Print</a>(time, TUnit::CPU_TICKS)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; &lt;&lt; <span class="stringliteral">&quot;\t&quot;</span> &lt;&lt; <a class="code" href="classimpala_1_1PrettyPrinter.html#a6e5f06a1ce274f747cc4f9928b797c5a">PrettyPrinter::Print</a>(delta, TUnit::CPU_TICKS);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">return</span> time;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="comment">// Run a test aggregation with buffers of size buffer_size bytes.</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// Try the full range of working set size (and thus fanout) that we can do with</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="comment">// single-level fanout.</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> buffer_size&gt;</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classimpala_1_1GrowingTest.html#a7913e83703745b66a43355420406f1bb"> 79</a></span>&#160; <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classimpala_1_1GrowingTest.html#a7913e83703745b66a43355420406f1bb">Test</a>() {</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; LOG(ERROR) &lt;&lt; <span class="stringliteral">&quot;Buffer size &quot;</span> &lt;&lt; <a class="code" href="perf-counters_8cc.html#a6b20d41d6252e9871430c242cb1a56e7">HashStore&lt;buffer_size&gt;::BUFFER_SIZE</a> &lt;&lt; <span class="stringliteral">&quot; tuples (&quot;</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; &lt;&lt; <a class="code" href="classimpala_1_1PrettyPrinter.html#a6e5f06a1ce274f747cc4f9928b797c5a">PrettyPrinter::Print</a>(buffer_size, TUnit::BYTES)</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; &lt;&lt; <span class="stringliteral">&quot;):&quot;</span>;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; LOG(ERROR) &lt;&lt; <span class="stringliteral">&quot;#BuildTuples\tTime\tdTime&quot;</span>;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="classuint64__t.html">uint64_t</a> prev = 0;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// only go up to 2^12 hashtables because after that, there are at least as many</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// buffers as L2 cache lines. We won&#39;t let this happen; we&#39;ll do multi-level fanout.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Note that we should probably allow 2 cache lines per buffer (since a write might</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="comment">// span a line break), plus we need some memory aside from the buffers, so we&#39;ll</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// actually stop at 2^11, or maybe 2^12. And we might want to keep them in L1,</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// in which case we&#39;ll stop at 2^7 or so.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> num_tables = 1; num_tables &lt;= 1&lt;&lt;12; num_tables *= 2) {</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// how many total build tuples we&#39;ll use to fill num_tables tables</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment">// Needs to be comfortably less than the total capacity of num_tables tables</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="comment">// (the below expression without the constant factor multiplied by it)</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="comment">// because the hashes will not be spread perfectly.</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// But should be more than 1/2 of that expression because otherwise if the hashes</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="comment">// spread out perfectly, it will fit in num_tables / 2 and not give us the fanout</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// we expect. (A test will fail in this case so that we know.)</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordtype">int</span> build_tuples = (StandardHashTable::NODES * num_tables / 10) * 8;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; prev = NextTestCase&lt;buffer_size&gt;(build_tuples, prev, num_tables);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; }</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; }</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;};</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;}</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="prefetch_2growing-test_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627"> 107</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="growing-test_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv) {</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; google::InitGoogleLogging(argv[0]);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; ::testing::InitGoogleTest(&amp;argc, argv);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <a class="code" href="classimpala_1_1CpuInfo.html#ab63b1a50201fc23934e209f407945674">CpuInfo::Init</a>();</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; LOG(ERROR) &lt;&lt; <span class="stringliteral">&quot;Testing with &quot;</span> &lt;&lt; <a class="code" href="classimpala_1_1GrowingTest.html#a50edab0a09bca91d335a968243b1df61">GrowingTest::NUM_PROBE_TUPLES</a> &lt;&lt; <span class="stringliteral">&quot; tuples.&quot;</span>;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">return</span> RUN_ALL_TESTS();</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;}</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="prefetch_2growing-test_8cc.html#a8b4caf6a89c7e708c0ccd42ecd78584d"> 115</a></span>&#160;<a class="code" href="namespaceimpala.html#a81e39acff5a125a058cc0c2dc4a125c6">TEST</a>(<a class="code" href="classimpala_1_1GrowingTest.html">GrowingTest</a>, All) {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">// test without buffers</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; GrowingTest::Test&lt;0&gt;();</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">// test with one of the best buffer sizes</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Make it slightly more than a power of 2 cache lines so that they are offset.</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; GrowingTest::Test&lt; (1 &lt;&lt; 13) + 3 * 64 &gt;();</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;}</div>
<div class="ttc" id="classimpala_1_1GrowingTest_html_a7913e83703745b66a43355420406f1bb"><div class="ttname"><a href="classimpala_1_1GrowingTest.html#a7913e83703745b66a43355420406f1bb">impala::GrowingTest::Test</a></div><div class="ttdeci">static void Test()</div><div class="ttdef"><b>Definition:</b> <a href="prefetch_2growing-test_8cc_source.html#l00079">growing-test.cc:79</a></div></div>
<div class="ttc" id="classimpala_1_1GrowingTest_html_abb3a288cfd6e791c374f01a8ec3151c3"><div class="ttname"><a href="classimpala_1_1GrowingTest.html#abb3a288cfd6e791c374f01a8ec3151c3">impala::GrowingTest::SanityCheck</a></div><div class="ttdeci">static void SanityCheck(const HashStore&lt; buffer_size &gt; &amp;hs, uint64_t num_probe_tuples, int max_id, int num_tables)</div><div class="ttdef"><b>Definition:</b> <a href="prefetch_2growing-test_8cc_source.html#l00038">growing-test.cc:38</a></div></div>
<div class="ttc" id="partitioning-throughput-test_8cc_html_ae4b10d42a9e46f75d00a40862197374e"><div class="ttname"><a href="partitioning-throughput-test_8cc.html#ae4b10d42a9e46f75d00a40862197374e">tuples</a></div><div class="ttdeci">ProbeTuple tuples[BUFFER_TUPLES]</div><div class="ttdef"><b>Definition:</b> <a href="partitioning-throughput-test_8cc_source.html#l00034">partitioning-throughput-test.cc:34</a></div></div>
<div class="ttc" id="classimpala_1_1StopWatch_html_a811ac5c8ae0f5de261c62aba58d911f6"><div class="ttname"><a href="classimpala_1_1StopWatch.html#a811ac5c8ae0f5de261c62aba58d911f6">impala::StopWatch::Start</a></div><div class="ttdeci">void Start()</div><div class="ttdef"><b>Definition:</b> <a href="stopwatch_8h_source.html#l00035">stopwatch.h:35</a></div></div>
<div class="ttc" id="namespaceimpala_html_a81e39acff5a125a058cc0c2dc4a125c6"><div class="ttname"><a href="namespaceimpala.html#a81e39acff5a125a058cc0c2dc4a125c6">impala::TEST</a></div><div class="ttdeci">TEST(AtomicTest, Basic)</div><div class="ttdef"><b>Definition:</b> <a href="atomic-test_8cc_source.html#l00028">atomic-test.cc:28</a></div></div>
<div class="ttc" id="perf-counters_8cc_html_a6b20d41d6252e9871430c242cb1a56e7"><div class="ttname"><a href="perf-counters_8cc.html#a6b20d41d6252e9871430c242cb1a56e7">BUFFER_SIZE</a></div><div class="ttdeci">#define BUFFER_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="perf-counters_8cc_source.html#l00034">perf-counters.cc:34</a></div></div>
<div class="ttc" id="stopwatch_8h_html"><div class="ttname"><a href="stopwatch_8h.html">stopwatch.h</a></div></div>
<div class="ttc" id="classimpala_1_1StopWatch_html"><div class="ttname"><a href="classimpala_1_1StopWatch.html">impala::StopWatch</a></div><div class="ttdef"><b>Definition:</b> <a href="stopwatch_8h_source.html#l00028">stopwatch.h:28</a></div></div>
<div class="ttc" id="classimpala_1_1PrettyPrinter_html_a6e5f06a1ce274f747cc4f9928b797c5a"><div class="ttname"><a href="classimpala_1_1PrettyPrinter.html#a6e5f06a1ce274f747cc4f9928b797c5a">impala::PrettyPrinter::Print</a></div><div class="ttdeci">static std::string Print(bool value, TUnit::type ignored, bool verbose=false)</div><div class="ttdef"><b>Definition:</b> <a href="pretty-printer_8h_source.html#l00033">pretty-printer.h:33</a></div></div>
<div class="ttc" id="classimpala_1_1GrowingTest_html_a9b19d39017848bcd50d540f913f14a38"><div class="ttname"><a href="classimpala_1_1GrowingTest.html#a9b19d39017848bcd50d540f913f14a38">impala::GrowingTest::NextTestCase</a></div><div class="ttdeci">static uint64_t NextTestCase(int build_tuples, uint64_t prev, int num_tables)</div><div class="ttdef"><b>Definition:</b> <a href="prefetch_2growing-test_8cc_source.html#l00059">growing-test.cc:59</a></div></div>
<div class="ttc" id="classimpala_1_1GrowingTest_html_a50edab0a09bca91d335a968243b1df61"><div class="ttname"><a href="classimpala_1_1GrowingTest.html#a50edab0a09bca91d335a968243b1df61">impala::GrowingTest::NUM_PROBE_TUPLES</a></div><div class="ttdeci">static const uint64_t NUM_PROBE_TUPLES</div><div class="ttdef"><b>Definition:</b> <a href="growing-test_8cc_source.html#l00020">growing-test.cc:20</a></div></div>
<div class="ttc" id="debug-util_8h_html"><div class="ttname"><a href="debug-util_8h.html">debug-util.h</a></div></div>
<div class="ttc" id="classimpala_1_1GrowingTest_html"><div class="ttname"><a href="classimpala_1_1GrowingTest.html">impala::GrowingTest</a></div><div class="ttdef"><b>Definition:</b> <a href="growing-test_8cc_source.html#l00018">growing-test.cc:18</a></div></div>
<div class="ttc" id="classuint64__t_html"><div class="ttname"><a href="classuint64__t.html">uint64_t</a></div></div>
<div class="ttc" id="cache-hash-test_8cc_html_a18269e3eecadb27e79614c02d898173e"><div class="ttname"><a href="cache-hash-test_8cc.html#a18269e3eecadb27e79614c02d898173e">Test</a></div><div class="ttdeci">uint64_t Test(T *ht, const ProbeTuple *input, uint64_t num_tuples)</div><div class="ttdef"><b>Definition:</b> <a href="cache-hash-test_8cc_source.html#l00067">cache-hash-test.cc:67</a></div></div>
<div class="ttc" id="classimpala_1_1StopWatch_html_abb3886869c34e8e9a3d2d43a41631dac"><div class="ttname"><a href="classimpala_1_1StopWatch.html#abb3886869c34e8e9a3d2d43a41631dac">impala::StopWatch::Stop</a></div><div class="ttdeci">void Stop()</div><div class="ttdef"><b>Definition:</b> <a href="stopwatch_8h_source.html#l00042">stopwatch.h:42</a></div></div>
<div class="ttc" id="growing-test_8cc_html_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="growing-test_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="growing-test_8cc_source.html#l00108">growing-test.cc:108</a></div></div>
<div class="ttc" id="classimpala_1_1CpuInfo_html_ab63b1a50201fc23934e209f407945674"><div class="ttname"><a href="classimpala_1_1CpuInfo.html#ab63b1a50201fc23934e209f407945674">impala::CpuInfo::Init</a></div><div class="ttdeci">static void Init()</div><div class="ttdoc">Initialize CpuInfo. </div><div class="ttdef"><b>Definition:</b> <a href="cpu-info_8cc_source.html#l00075">cpu-info.cc:75</a></div></div>
<div class="ttc" id="partitioning-throughput-test_8cc_html_a21a2991bad371e69e271208a9349d895"><div class="ttname"><a href="partitioning-throughput-test_8cc.html#a21a2991bad371e69e271208a9349d895">Buffer</a></div><div class="ttdeci">Buffer()</div><div class="ttdef"><b>Definition:</b> <a href="partitioning-throughput-test_8cc_source.html#l00039">partitioning-throughput-test.cc:39</a></div></div>
<div class="ttc" id="classimpala_1_1GrowingTest_html_ad18833ec7593982e80375fed4af22426"><div class="ttname"><a href="classimpala_1_1GrowingTest.html#ad18833ec7593982e80375fed4af22426">impala::GrowingTest::AggregateTest</a></div><div class="ttdeci">static uint64_t AggregateTest(uint64_t num_probe_tuples, int max_id, int num_tables)</div><div class="ttdef"><b>Definition:</b> <a href="prefetch_2growing-test_8cc_source.html#l00022">growing-test.cc:22</a></div></div>
<div class="ttc" id="cpu-info_8h_html"><div class="ttname"><a href="cpu-info_8h.html">cpu-info.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_e5d120be6b5e8a44336cbfd013b25604.html">be</a></li><li class="navelem"><a class="el" href="dir_68cf7cafb51a962d5bc4848b83cab0de.html">src</a></li><li class="navelem"><a class="el" href="dir_c9df84a671cd91d3c29aa4a38e7587c0.html">experiments</a></li><li class="navelem"><a class="el" href="dir_367816a830a7d40c657b425d9d1f547b.html">hashing</a></li><li class="navelem"><a class="el" href="dir_78ea23c62c10c1f2a33737eb0ed3ac3e.html">prefetch</a></li><li class="navelem"><a class="el" href="prefetch_2growing-test_8cc.html">growing-test.cc</a></li>
<li class="footer">Generated on Thu May 7 2015 16:10:35 for Impala by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>