<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Parallel Hashlist was updated to version 1.43 in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-Hashlist-was-updated-to-version-1-43/m-p/769827#M120</link>
    <description>&lt;BR /&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Parallel Hashlist was updated to version 
1.43&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the previous version i have set the number of lightweight 
&lt;BR /&gt;MREWs(multiple-readers-exclusive-writer)&lt;BR /&gt;to 128 but i have decided to 
change that in version 1.43 so that you can &lt;BR /&gt;give a variable number of 
MREWS, this will scale better and now the &lt;BR /&gt;constructor will look like 
this:&lt;BR /&gt;&lt;BR /&gt;hash1:=TParallelHashList.create(trait, Hashnize, 
number_of_MREWS);&lt;BR /&gt;&lt;BR /&gt;and the number_of_MREWS must be less or equal to the 
Hashsize&lt;BR /&gt;&lt;BR /&gt;also i have given you two examples inside the zipfile, but 
please note that&lt;BR /&gt;the IntToStr() that i am using insode the test files don't 
scale well, but &lt;BR /&gt;in reality&lt;BR /&gt;and in fact parallel hashlist does scale very 
well if you don't use &lt;BR /&gt;IntToStr()..&lt;BR /&gt;&lt;BR /&gt;Description:&lt;BR /&gt;&lt;BR /&gt;A parallel 
HashList with O(1) best case and O(log(n)) worst case access that&lt;BR /&gt;uses lock 
striping and lightweight MREWs(multiple-readers-exclusive-writer) &lt;BR /&gt;,&lt;BR /&gt;this 
allows multiple threads to write and read concurently. also 
&lt;BR /&gt;parallelhashlist&lt;BR /&gt;maintains an independant counter , that counts the 
number of entries , for &lt;BR /&gt;each&lt;BR /&gt;segment of the hashtable and uses a lock for 
each counter, this is also for &lt;BR /&gt;better scalability.&lt;BR /&gt;&lt;BR /&gt;Note: When i have 
done those benchmarks , there was not enough/much items&lt;BR /&gt;organized as a 
self-balancing tree in the individual chains of the &lt;BR /&gt;hashtable, so 
,&lt;BR /&gt;almost all the items was found and inserted in O(1) , so the parallel part 
&lt;BR /&gt;in the&lt;BR /&gt;Amdahl equation was not much bigger compared to to the serial 
part. But you&lt;BR /&gt;will notice in pratice that as soon as you will have more items 
on the &lt;BR /&gt;chains of&lt;BR /&gt;the Hash table , organized as self-balancing tree, with 
a worst case log(n) &lt;BR /&gt;, the&lt;BR /&gt;parallel part will become bigger in the Amdahl 
equation and you will have &lt;BR /&gt;better&lt;BR /&gt;performance and scalability than the 
numbers in the graph of the benchmarks &lt;BR /&gt;...&lt;BR /&gt;Please pass a hashsize and the 
number of mrews in power of 2 to the &lt;BR /&gt;constructor&lt;BR /&gt;by using the shl 
operation for example like 
this&lt;BR /&gt;&lt;BR /&gt;trait:=TCaseinsensitiveTraits.create;;&lt;BR /&gt;hash1:=TParallelHashList.create(trait,1 
shl 25,1 shl 25);&lt;BR /&gt;&lt;BR /&gt;Why do you have to use a power of 2 ?&lt;BR /&gt;&lt;BR /&gt;Please 
read this:&lt;BR /&gt;&lt;BR /&gt;"Power-of-Two Hash Table Size&lt;BR /&gt;&lt;BR /&gt;Any data structures 101 
book will say choose a prime for the number of &lt;BR /&gt;buckets,&lt;BR /&gt;so that the 
bucket's index can easily be computed by h(k) = k mod m, where k &lt;BR /&gt;is&lt;BR /&gt;the 
key value and m is the bucket size. While this approach is 
&lt;BR /&gt;straight-forward,&lt;BR /&gt;there are a number of issues with it, including slow 
modulo performance.&lt;BR /&gt;ConcurrentHashMap instead uses a power-of-two 
rule&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://work.tinou.com/2008/09/performance-optimization-in-concurrenthashmap.html"&gt;http://work.tinou.com/2008/09/performance-optimization-in-concurrenthashmap.html&lt;/A&gt; 
"&lt;BR /&gt;&lt;BR /&gt;I am using modulo functions inside parallelhashlist, and using a number 
of &lt;BR /&gt;locks in power of 2,&lt;BR /&gt;so you have to use hashsize in power of 2 , this 
will make the modulo &lt;BR /&gt;function of the delphi&lt;BR /&gt;and freepascal compilers 10X 
faster.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download parallel hashlist from:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine 
Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 10 Aug 2012 01:00:43 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2012-08-10T01:00:43Z</dc:date>
    <item>
      <title>Parallel Hashlist was updated to version 1.43</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-Hashlist-was-updated-to-version-1-43/m-p/769827#M120</link>
      <description>&lt;BR /&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Parallel Hashlist was updated to version 
1.43&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the previous version i have set the number of lightweight 
&lt;BR /&gt;MREWs(multiple-readers-exclusive-writer)&lt;BR /&gt;to 128 but i have decided to 
change that in version 1.43 so that you can &lt;BR /&gt;give a variable number of 
MREWS, this will scale better and now the &lt;BR /&gt;constructor will look like 
this:&lt;BR /&gt;&lt;BR /&gt;hash1:=TParallelHashList.create(trait, Hashnize, 
number_of_MREWS);&lt;BR /&gt;&lt;BR /&gt;and the number_of_MREWS must be less or equal to the 
Hashsize&lt;BR /&gt;&lt;BR /&gt;also i have given you two examples inside the zipfile, but 
please note that&lt;BR /&gt;the IntToStr() that i am using insode the test files don't 
scale well, but &lt;BR /&gt;in reality&lt;BR /&gt;and in fact parallel hashlist does scale very 
well if you don't use &lt;BR /&gt;IntToStr()..&lt;BR /&gt;&lt;BR /&gt;Description:&lt;BR /&gt;&lt;BR /&gt;A parallel 
HashList with O(1) best case and O(log(n)) worst case access that&lt;BR /&gt;uses lock 
striping and lightweight MREWs(multiple-readers-exclusive-writer) &lt;BR /&gt;,&lt;BR /&gt;this 
allows multiple threads to write and read concurently. also 
&lt;BR /&gt;parallelhashlist&lt;BR /&gt;maintains an independant counter , that counts the 
number of entries , for &lt;BR /&gt;each&lt;BR /&gt;segment of the hashtable and uses a lock for 
each counter, this is also for &lt;BR /&gt;better scalability.&lt;BR /&gt;&lt;BR /&gt;Note: When i have 
done those benchmarks , there was not enough/much items&lt;BR /&gt;organized as a 
self-balancing tree in the individual chains of the &lt;BR /&gt;hashtable, so 
,&lt;BR /&gt;almost all the items was found and inserted in O(1) , so the parallel part 
&lt;BR /&gt;in the&lt;BR /&gt;Amdahl equation was not much bigger compared to to the serial 
part. But you&lt;BR /&gt;will notice in pratice that as soon as you will have more items 
on the &lt;BR /&gt;chains of&lt;BR /&gt;the Hash table , organized as self-balancing tree, with 
a worst case log(n) &lt;BR /&gt;, the&lt;BR /&gt;parallel part will become bigger in the Amdahl 
equation and you will have &lt;BR /&gt;better&lt;BR /&gt;performance and scalability than the 
numbers in the graph of the benchmarks &lt;BR /&gt;...&lt;BR /&gt;Please pass a hashsize and the 
number of mrews in power of 2 to the &lt;BR /&gt;constructor&lt;BR /&gt;by using the shl 
operation for example like 
this&lt;BR /&gt;&lt;BR /&gt;trait:=TCaseinsensitiveTraits.create;;&lt;BR /&gt;hash1:=TParallelHashList.create(trait,1 
shl 25,1 shl 25);&lt;BR /&gt;&lt;BR /&gt;Why do you have to use a power of 2 ?&lt;BR /&gt;&lt;BR /&gt;Please 
read this:&lt;BR /&gt;&lt;BR /&gt;"Power-of-Two Hash Table Size&lt;BR /&gt;&lt;BR /&gt;Any data structures 101 
book will say choose a prime for the number of &lt;BR /&gt;buckets,&lt;BR /&gt;so that the 
bucket's index can easily be computed by h(k) = k mod m, where k &lt;BR /&gt;is&lt;BR /&gt;the 
key value and m is the bucket size. While this approach is 
&lt;BR /&gt;straight-forward,&lt;BR /&gt;there are a number of issues with it, including slow 
modulo performance.&lt;BR /&gt;ConcurrentHashMap instead uses a power-of-two 
rule&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://work.tinou.com/2008/09/performance-optimization-in-concurrenthashmap.html"&gt;http://work.tinou.com/2008/09/performance-optimization-in-concurrenthashmap.html&lt;/A&gt; 
"&lt;BR /&gt;&lt;BR /&gt;I am using modulo functions inside parallelhashlist, and using a number 
of &lt;BR /&gt;locks in power of 2,&lt;BR /&gt;so you have to use hashsize in power of 2 , this 
will make the modulo &lt;BR /&gt;function of the delphi&lt;BR /&gt;and freepascal compilers 10X 
faster.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download parallel hashlist from:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine 
Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Aug 2012 01:00:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-Hashlist-was-updated-to-version-1-43/m-p/769827#M120</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2012-08-10T01:00:43Z</dc:date>
    </item>
    <item>
      <title>Parallel Hashlist was updated to version 1.43</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-Hashlist-was-updated-to-version-1-43/m-p/769828#M121</link>
      <description>&lt;DIV&gt;&lt;BR /&gt;Hello,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have updated parallelhashlist to version 1.44&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;What have changed in version 1.44 ?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have corrected a bug in the constructor, &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Before, itwas: &lt;/DIV&gt;
&lt;DIV&gt; &lt;BR /&gt;if (AHashSize mod size2) &amp;lt;&amp;gt; 0 then size2:=size2+1;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;In version 1.44 i have corrected the bug by changing size2 to size1: &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;if (AHashSize mod size1) &amp;lt;&amp;gt; 0 then size2:=size2+1;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;And after that i am setting correctly the array fcount1(the independant 
counters , &lt;/DIV&gt;
&lt;DIV&gt;that count the number of entries , for each segment of the hashtable) and 
the &lt;/DIV&gt;
&lt;DIV&gt;array mrew((multiple-readers-exclusive-writer locks) like this:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;setlength(fcount1,size2);&lt;BR /&gt;for i:=0 to size2-1 do fcount1&lt;I&gt;:=0; &lt;/I&gt;&lt;/DIV&gt;
&lt;DIV&gt;for i:=0 to size2-1 do mrew&lt;I&gt;:=TOmniMREW.create; &lt;/I&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;You can download parallel hashlist from:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;Sincerely,&lt;/DIV&gt;
&lt;DIV&gt;Amine Moulay Ramdane&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Aug 2012 16:38:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-Hashlist-was-updated-to-version-1-43/m-p/769828#M121</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2012-08-10T16:38:12Z</dc:date>
    </item>
  </channel>
</rss>

