meaning of __PARALLEL_HASKELL__ and -parallel

25 views
Skip to first unread message

Facundo Domínguez

unread,
Apr 13, 2012, 11:54:13 AM4/13/12
to parallel...@googlegroups.com
Hi,

 I've found the following definition in [1], and I am wondering what
the __PARALLEL_HASKELL__ flag stands for. A simple test program
compiled with ghc 7.0.3 and base-4.3.1.0 works just fine when using
makeStableName. So I don't understand in which scenario makeStableName
is unimplemented.

-- | Makes a 'StableName' for an arbitrary object.  The object passed as
-- the first argument is not evaluated by 'makeStableName'.
makeStableName  :: a -> IO (StableName a)
#if defined(__PARALLEL_HASKELL__)
makeStableName a =
 error "makeStableName not implemented in parallel Haskell"
#else
makeStableName a = IO $ \ s ->
   case makeStableName# a s of (# s', sn #) -> (# s', StableName sn #)
#endif

I found a reference in [2], but then I don't know what the flag
"-parallel" is for. Any hints?

Thanks,
Facundo


[1] http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/src/System-Mem-StableName.html#StableName
[2] http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/options-phases.html#c-pre-processor

Jost Berthold

unread,
Apr 14, 2012, 12:27:17 AM4/14/12
to facundo....@parsci.com, parallel...@googlegroups.com
Hi Facundo,

Both items relate to the parallel version of GHC with parallel runtime
system extensions for GpH (par/seq) and Eden (process, (#), ($#) ) on
distributed memory platforms.

On 2012-04-13 17:54, Facundo Dom�nguez wrote:
> I've found the following definition in [1], and I am wondering what
> the __PARALLEL_HASKELL__ flag stands for. A simple test program


__PARALLEL_HASKELL__ is defined when compiling a program in a parallel
"way", i.e. linking it to a runtime system which supports GpH or Eden on
distributed memory.
In the parallel system with distributed heaps, data can move from one
heap to another. In this scenario, it might occur that a stable name is
moved away to a machine where the data pointed at by it is not present.
The runtime system apparently did not cope with this, instead, it was
disabled at the Haskell level.

> I found a reference in [2], but then I don't know what the flag
> "-parallel" is for. Any hints?

Flag -parallel enables (or, enabled) GpH support when compiling and
linking. Eden uses flags -parpvm, -parmpi, -parcp, depending on the
communication layer used.
As mentioned, all this refers to the parallel runtime system for
physically distributed heaps. This runtime system for distributed heaps
with GpH support is currently not available (there is an unstable
prototype). An Eden version based on GHC 7.4.1 is available.

Cheers
Jost

Reply all
Reply to author
Forward
0 new messages