[Haskell-cafe] Control.Parallel on 6.10.4 - Mac OS X version

Kevin Smith k2msmith at gmail.com
Wed Aug 19 23:44:28 EDT 2009


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.
Here is output of ghc --info:

Macintosh-4:~ kevinsmith$ ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("Project version","6.10.4")
 ,("Booter version","6.10.3.20090628")
 ,("Stage","2")
 ,("Interface file version","6")
 ,("Have interpreter","YES")
 ,("Object splitting","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("Win32 DLLs","")
 ,("RTS ways"," debug  thr thr_p thr_debug")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ]


Here is output from program:

$ time ./paratest +RTS -N1 -s
./paratest +RTS -N1 -s
1405006117752879898543142606244511569936384005711076
     758,080,164 bytes allocated in the heap
          61,076 bytes copied during GC
           3,044 bytes maximum residency (1 sample(s))
          16,204 bytes maximum slop
               1 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  1445 collections,     0 parallel,  0.08s,  0.08s elapsed
  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed

  Task  0 (worker) :  MUT time:   0.00s  (  0.00s elapsed)
                      GC  time:   0.00s  (  0.00s elapsed)

  Task  1 (worker) :  MUT time:   1.91s  (  1.86s elapsed)
                      GC  time:   0.00s  (  0.00s elapsed)

  Task  2 (worker) :  MUT time:   1.83s  (  1.86s elapsed)
                      GC  time:   0.08s  (  0.08s elapsed)

  INIT  time    0.00s  (  0.00s elapsed)
  MUT   time    1.83s  (  1.86s elapsed)
  GC    time    0.08s  (  0.08s elapsed)
  EXIT  time    0.00s  (  0.00s elapsed)
  Total time    1.91s  (  1.94s elapsed)

  %GC time       4.1%  (4.3% elapsed)

  Alloc rate    413,412,206 bytes per MUT second

  Productivity  95.9% of total user, 94.4% of total elapsed

recordMutableGen_sync: 0
gc_alloc_block_sync: 0
whitehole_spin: 0
gen[0].steps[0].sync_todo: 0
gen[0].steps[0].sync_large_objects: 0
gen[0].steps[1].sync_todo: 0
gen[0].steps[1].sync_large_objects: 0
gen[1].steps[0].sync_todo: 0
gen[1].steps[0].sync_large_objects: 0

real 0m1.946s
user 0m1.912s
sys 0m0.025s
Macintosh-4:~ kevinsmith$ time ./paratest +RTS -N2 -s
./paratest +RTS -N2 -s
1405006117752879898543142606244511569936384005711076
     758,092,440 bytes allocated in the heap
          79,084 bytes copied during GC
           3,076 bytes maximum residency (1 sample(s))
          14,724 bytes maximum slop
               2 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  1024 collections,     0 parallel,  0.08s,  0.08s elapsed
  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed

  Parallel GC work balance: nan (0 / 0, ideal 2)

  Task  0 (worker) :  MUT time:   1.84s  (  1.18s elapsed)
                      GC  time:   0.08s  (  0.08s elapsed)

  Task  1 (worker) :  MUT time:   1.92s  (  1.18s elapsed)
                      GC  time:   0.00s  (  0.00s elapsed)

  Task  2 (worker) :  MUT time:   1.92s  (  1.18s elapsed)
                      GC  time:   0.00s  (  0.00s elapsed)

  Task  3 (worker) :  MUT time:   1.92s  (  1.18s elapsed)
                      GC  time:   0.00s  (  0.00s elapsed)

  INIT  time    0.00s  (  0.00s elapsed)
  MUT   time    1.84s  (  1.18s elapsed)
  GC    time    0.08s  (  0.08s elapsed)
  EXIT  time    0.00s  (  0.00s elapsed)
  Total time    1.92s  (  1.27s elapsed)

  %GC time       4.0%  (6.5% elapsed)

  Alloc rate    411,138,454 bytes per MUT second

  Productivity  95.9% of total user, 145.6% of total elapsed

recordMutableGen_sync: 0
gc_alloc_block_sync: 0
whitehole_spin: 0
gen[0].steps[0].sync_todo: 0
gen[0].steps[0].sync_large_objects: 0
gen[0].steps[1].sync_todo: 0
gen[0].steps[1].sync_large_objects: 0
gen[1].steps[0].sync_todo: 0
gen[1].steps[0].sync_large_objects: 0

real 0m1.269s
user 0m1.922s
sys 0m0.042s


On Tue, Aug 18, 2009 at 8:17 PM, Don Stewart <dons at galois.com> wrote:

> k2msmith:
> > I'm using the Control.Parallel package on ghc version 6.10.4 and I don't
> seem
> > to be getting any parallel threads or sparks created at all with the
> > "-threaded" compilation option using runtime flags "+RTS -N2".  I'm using
> > simple examples from the paper "A Tutorial on Parallel and Concurrent
> > Programming in Haskell" by Jones and Singh.
> >
> > I'm running on an Intel Mac core 2 duo.  Does anyone know how I can check
> if
> > the parallel functionality in ghc is working on my 6.10.4 ghc package
> installed
> > on this platform ? I installed it from the "supported" runtime pkg for OS
> X
> > from the ghc website.
> >
>
> A simple parallel 'hello world'
>
>
> http://haskell.org/haskellwiki/Haskell_in_5_steps#Write_your_first_parallel_Haskell_program
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090819/bc5c8b58/attachment.html


More information about the Haskell-Cafe mailing list