I ran the simple parallel "hello world" on my system. the output of the programs with N1 and N2 is shown below. I'm not sure how to interpret this - it looks like I am getting a little speedup on the "real time". I'm running the 6.10.4 install package for Mac OS X on a intel core 2 mac book.<div>
<br></div><div>Here is output of ghc --info:</div><div><br></div><div><div>Macintosh-4:~ kevinsmith$ ghc --info</div><div> [("Project name","The Glorious Glasgow Haskell Compilation System")</div><div>
,("Project version","6.10.4")</div><div> ,("Booter version","6.10.3.20090628")</div><div> ,("Stage","2")</div><div> ,("Interface file version","6")</div>
<div> ,("Have interpreter","YES")</div><div> ,("Object splitting","YES")</div><div> ,("Have native code generator","YES")</div><div> ,("Support SMP","YES")</div>
<div> ,("Unregisterised","NO")</div><div> ,("Tables next to code","YES")</div><div> ,("Win32 DLLs","")</div><div> ,("RTS ways"," debug thr thr_p thr_debug")</div>
<div> ,("Leading underscore","YES")</div><div> ,("Debug on","False")</div><div> ]</div><div><br></div><div><br></div><div>Here is output from program:<br><div><br></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><div>
$ time ./paratest +RTS -N1 -s</div><div>./paratest +RTS -N1 -s </div><div>1405006117752879898543142606244511569936384005711076</div><div> 758,080,164 bytes allocated in the heap</div><div> 61,076 bytes copied during GC</div>
<div> 3,044 bytes maximum residency (1 sample(s))</div><div> 16,204 bytes maximum slop</div><div> 1 MB total memory in use (0 MB lost due to fragmentation)</div><div><br></div><div> Generation 0: 1445 collections, 0 parallel, 0.08s, 0.08s elapsed</div>
<div> Generation 1: 1 collections, 0 parallel, 0.00s, 0.00s elapsed</div><div><br></div><div> Task 0 (worker) : MUT time: 0.00s ( 0.00s elapsed)</div><div> GC time: 0.00s ( 0.00s elapsed)</div>
<div><br></div><div> Task 1 (worker) : MUT time: 1.91s ( 1.86s elapsed)</div><div> GC time: 0.00s ( 0.00s elapsed)</div><div><br></div><div> Task 2 (worker) : MUT time: 1.83s ( 1.86s elapsed)</div>
<div> GC time: 0.08s ( 0.08s elapsed)</div><div><br></div><div> INIT time 0.00s ( 0.00s elapsed)</div><div> MUT time 1.83s ( 1.86s elapsed)</div><div> GC time 0.08s ( 0.08s elapsed)</div>
<div> EXIT time 0.00s ( 0.00s elapsed)</div><div> Total time 1.91s ( 1.94s elapsed)</div><div><br></div><div> %GC time 4.1% (4.3% elapsed)</div><div><br></div><div> Alloc rate 413,412,206 bytes per MUT second</div>
<div><br></div><div> Productivity 95.9% of total user, 94.4% of total elapsed</div><div><br></div><div>recordMutableGen_sync: 0</div><div>gc_alloc_block_sync: 0</div><div>whitehole_spin: 0</div><div>gen[0].steps[0].sync_todo: 0</div>
<div>gen[0].steps[0].sync_large_objects: 0</div><div>gen[0].steps[1].sync_todo: 0</div><div>gen[0].steps[1].sync_large_objects: 0</div><div>gen[1].steps[0].sync_todo: 0</div><div>gen[1].steps[0].sync_large_objects: 0</div>
<div><br></div><div>real<span class="Apple-tab-span" style="white-space:pre">        </span>0m1.946s</div><div>user<span class="Apple-tab-span" style="white-space:pre">        </span>0m1.912s</div><div>sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.025s</div>
<div>Macintosh-4:~ kevinsmith$ time ./paratest +RTS -N2 -s</div><div>./paratest +RTS -N2 -s </div><div>1405006117752879898543142606244511569936384005711076</div><div> 758,092,440 bytes allocated in the heap</div><div>
79,084 bytes copied during GC</div><div> 3,076 bytes maximum residency (1 sample(s))</div><div> 14,724 bytes maximum slop</div><div> 2 MB total memory in use (0 MB lost due to fragmentation)</div>
<div><br></div><div> Generation 0: 1024 collections, 0 parallel, 0.08s, 0.08s elapsed</div><div> Generation 1: 1 collections, 0 parallel, 0.00s, 0.00s elapsed</div><div><br></div><div> Parallel GC work balance: nan (0 / 0, ideal 2)</div>
<div><br></div><div> Task 0 (worker) : MUT time: 1.84s ( 1.18s elapsed)</div><div> GC time: 0.08s ( 0.08s elapsed)</div><div><br></div><div> Task 1 (worker) : MUT time: 1.92s ( 1.18s elapsed)</div>
<div> GC time: 0.00s ( 0.00s elapsed)</div><div><br></div><div> Task 2 (worker) : MUT time: 1.92s ( 1.18s elapsed)</div><div> GC time: 0.00s ( 0.00s elapsed)</div>
<div><br></div><div> Task 3 (worker) : MUT time: 1.92s ( 1.18s elapsed)</div><div> GC time: 0.00s ( 0.00s elapsed)</div><div><br></div><div> INIT time 0.00s ( 0.00s elapsed)</div><div>
MUT time 1.84s ( 1.18s elapsed)</div><div> GC time 0.08s ( 0.08s elapsed)</div><div> EXIT time 0.00s ( 0.00s elapsed)</div><div> Total time 1.92s ( 1.27s elapsed)</div><div><br></div><div> %GC time 4.0% (6.5% elapsed)</div>
<div><br></div><div> Alloc rate 411,138,454 bytes per MUT second</div><div><br></div><div> Productivity 95.9% of total user, 145.6% of total elapsed</div><div><br></div><div>recordMutableGen_sync: 0</div><div>gc_alloc_block_sync: 0</div>
<div>whitehole_spin: 0</div><div>gen[0].steps[0].sync_todo: 0</div><div>gen[0].steps[0].sync_large_objects: 0</div><div>gen[0].steps[1].sync_todo: 0</div><div>gen[0].steps[1].sync_large_objects: 0</div><div>gen[1].steps[0].sync_todo: 0</div>
<div>gen[1].steps[0].sync_large_objects: 0</div><div><br></div><div>real<span class="Apple-tab-span" style="white-space:pre">        </span>0m1.269s</div><div>user<span class="Apple-tab-span" style="white-space:pre">        </span>0m1.922s</div>
<div>sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.042s</div><div><br></div></span></font><br><div class="gmail_quote">On Tue, Aug 18, 2009 at 8:17 PM, Don Stewart <span dir="ltr"><<a href="mailto:dons@galois.com">dons@galois.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">k2msmith:<br>
<div><div></div><div class="h5">> I'm using the Control.Parallel package on ghc version 6.10.4 and I don't seem<br>
> to be getting any parallel threads or sparks created at all with the<br>
> "-threaded" compilation option using runtime flags "+RTS -N2". I'm using<br>
> simple examples from the paper "A Tutorial on Parallel and Concurrent<br>
> Programming in Haskell" by Jones and Singh.<br>
><br>
> I'm running on an Intel Mac core 2 duo. Does anyone know how I can check if<br>
> the parallel functionality in ghc is working on my 6.10.4 ghc package installed<br>
> on this platform ? I installed it from the "supported" runtime pkg for OS X<br>
> from the ghc website.<br>
><br>
<br>
</div></div>A simple parallel 'hello world'<br>
<br>
<a href="http://haskell.org/haskellwiki/Haskell_in_5_steps#Write_your_first_parallel_Haskell_program" target="_blank">http://haskell.org/haskellwiki/Haskell_in_5_steps#Write_your_first_parallel_Haskell_program</a><br>
</blockquote></div><br></div></div></div>