Commit efc7dc07 authored by dterei's avatar dterei

Update and clean makefiles

parent c5702b6e
TOP = ..
include $(TOP)/mk/boilerplate.mk
SUBDIRS= circsim constraints fibheaps fulsom gc_bench happy lcss power spellcheck \
mutstore1 mutstore2
# Bitrotted: ghc
SUBDIRS= circsim constraints fibheaps fulsom gc_bench happy hash lcss \
mutstore1 mutstore2 power spellcheck
# Discount treejoin: runs too quickly to see any speedup beyond a few procs
# Discount linear: heap is too small
......
This diff is collapsed.
TOP = ../..
include $(TOP)/mk/boilerplate.mk
NORM_OPTS = -- -B$(FPTOOLS_TOP) -c Expected.hs -O -fforce-recomp
EXCLUDED_SRCS = Expected.hs
ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H128m -RTS
endif
update ::
(cd $(FPTOOLS_TOP)/compiler; \
rm stage2/ghc.exe; \
make stage=2)
cp $(FPTOOLS_TOP)/compiler/stage2/ghc.exe .
include $(TOP)/mk/target.mk
TOP = ..
include $(TOP)/mk/boilerplate.mk
SUBDIRS = exp3_8 gen_regexps paraffins primes queens rfib tak x2n1 \
wheel-sieve1 wheel-sieve2 integrate bernouilli
OTHER_SUBDIRS = digits-of-e1 digits-of-e2
include $(TOP)/mk/target.mk
TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/target.mk
FAST_OPTS = 450
......
TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/target.mk
FAST_OPTS = 450
......
......@@ -4,22 +4,22 @@ include $(TOP)/mk/boilerplate.mk
SUBDIRS = parfib partree sumeuler matmult ray gray prsa mandel queens \
coins blackscholes minimax nbody transclos
OTHER_SUBDIRS = cfd dcbm linsolv nbody partak quicksort threadfib warshall
# CPP SYMBOLS
#
# -DSTRATEGIES_2 to use the version 2 strategies library (default is 3)
# partak: program needs work to make it parallel
# --------------
# Old benchmarks we need to either update or kill:
#
# NESL: a collection of benchmarks based on NESL examples
# bom: bill of materials?
# minimax: looks like it was written for GRIP, needs a lot of updating
# par001: looks like a test, not a benchmark
# coins: needs updating
# parfact: parallel factorial
# partak: program needs work to make it parallel
# soda, soda7: small word-search algorithm
# minimax: looks like it was written for GRIP, needs a lot of updating
# NESL: a collection of benchmarks based on NESL examples
# --------------
include $(TOP)/mk/target.mk
TOP = ../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -cpp
include $(TOP)/mk/target.mk
{- -------------------------------------------------------------------------
$Id: ParForce.hs,v 1.2 1996/07/25 21:20:04 partain Exp $
Time-stamp: <Sat Apr 27 1996 22:58:48 Stardate: [-31]7419.57 hwloidl>
This is revision: $Revision: 1.2 $
Module for forcing parallelism using par and friends.
It contains three classes of functions:
1) For each _<par-annotation>_ that's hard-wired into the compiler, there is
a function <par-annotation> in this module, doing the same thing as the
annotation but taking boxed values in the annotation positions.
2) Forcing functions like forcelist that cause the evaluation of every
component of the data-structure. The clean way to handle this would be
to define a class Forcable with a force method for each datatype of
interest.
3) Parallel versions of some higher-order functions such as map, filter, zip
etc. Currently par_map is the most often used way to parallelise a program.
The different versions force the argument list in different ways, and have
different ways of expressing the annotation information.
Currently two PP variables are used to decide which versions of the functions
to take:
SEQ ... creates dummy definitions for all annotations and makes the parallel
higher order functions to aliases of their sequential counterparts
GRAN_TNG ... uses the versions of the annotations that provide
sparkname, gran-info, size-info, parallelism-info
different versions of the parallel h.o. fcts pass this info in
different ways
[in the current versions the h.o. fcts just insert dummy values
for the size and parallelism info]
If no PP variable is defined, the parallel version is used, which only
supplies spark names but no gran-, size- or par-info.
Changelog (including older versions not in the correwsponding RCS file):
$Log: ParForce.hs,v $
Revision 1.2 1996/07/25 21:20:04 partain
Bulk of final changes for 2.01
--# Revision 1.3 1994/11/23 01:07:23 hwloidl
--# Version for testing fwd mapping and hom sol.
--#
--# Revision 1.1 1994/11/19 02:00:05 hwloidl
--# Initial revision
--#
---------------------------------------------------------------------- -}
module ParForce (parGlobal, parLocal, parAt, parAtForNow, seq, par,
forcelist, forcelist1,
parmap, parmap0, parmap1, pariterate,
parzip, parzipWith, parfilter,
par_map, par_map0, par_map1, par_iterate,
par_zip, par_zipWith, par_filter ) where
-- import Parallel
-- Basic parallelism annotations
#if defined(SEQ)
parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal _ _ _ _ x y = y
parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
parLocal _ _ _ _ x y = y
parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAt _ _ _ _ w x y = y
parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAtForNow _ _ _ _ w x y = y
seq :: a -> b -> b
seq x y = y
par :: a -> b -> b
par x y = y
#elif defined(GRAN)
parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal (I# n) (I# g) (I# s) (I# p) = _parGlobal_ n g s p
{-
where n' = case (n) of (I# n') -> n'
g' = case (g) of (I# g') -> g'
s' = case (s) of (I# s') -> s'
p' = case (p) of (I# p') -> p'
-}
parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
parLocal (I# n) (I# g) (I# s) (I# p) = _parLocal_ n g s p
parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAt (I# n) (I# g) (I# s) (I# p) = _parAt_ n g s p
parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAtForNow (I# n) (I# g) (I# s) (I# p) = _parAtForNow_ n g s p
{-# INLINE seq #-}
seq :: a -> b -> b
seq = _seq_
{-# INLINE par #-}
par :: a -> b -> b
par = _par_
#elif defined(PAR) /* i.e.GUM */
import Parallel -- includes definitions of par and seq
parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal _ _ _ _ = par
parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
parLocal _ _ _ _ = par
--parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAt _ _ _ _ w = par
--parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAtForNow _ _ _ _ w = par
#else /* e.g. HBCPP */
import Parallel -- renaming (par to hbcpp_par, seq to hbcpp_seq)
{-
--seq :: a -> b -> b
seq = hbcpp_seq
--par :: a -> b -> b
par = hbcpp_par "par"
--parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal n _ _ _ = hbcpp_par (show n)
--parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
parLocal n _ _ _ = hbcpp_par (show n)
--parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAt n _ _ _ w = hbcpp_par (show n)
--parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAtForNow n _ _ _ w = hbcpp_par (show n)
-}
--parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal n _ _ _ x y = par x y
--parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
parLocal n _ _ _ x y = par x y
--parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAt n _ _ _ w x y = par x y
--parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
parAtForNow n _ _ _ w x y = par x y
#endif
forcelist [] = ()
forcelist (x:xs) = seq x (forcelist xs)
forcelist1 0 (x:xs) = ()
forcelist1 n (x:xs) = seq x (forcelist1 (n-1) xs)
#if 0 /* defined(SEQ) */
par_map :: Int -> (a -> b) -> [a] -> [b]
par_map _ = map
par_map0 :: Int -> (a -> b) -> [a] -> [b]
par_map0 _ = map
par_map1 :: (Int -> Int) -> (a -> b) -> [a] -> [b]
par_map1 _ = map
par_iterate :: Int -> (a -> a) -> a -> [a]
par_iterate _ = iterate
par_zipWith :: Int -> (a -> b -> c) -> [a] -> [b] -> [c]
par_zipWith _ = zipWith
par_zip :: Int -> [a] -> [b] -> [(a,b)]
par_zip _ = zip
par_filter :: Int -> (a -> Bool) -> [a] -> [a]
par_filter _ = filter
#else {- !SEQ -}
parmap0 :: Int -> Int -> Int -> (a -> b) -> [a] -> [b]
parmap0 g s p f [] = []
parmap0 g s p f (x:xs) = parGlobal g g s p fx
( parGlobal g g s p (forcelist pmxs)
(fx:pmxs) )
where fx = f x
pmxs = parmap0 g s p f xs
par_map0 :: Int -> (a -> b) -> [a] -> [b]
par_map0 g = parmap0 g 0 0
parmap :: Int -> Int -> Int -> (a -> b) -> [a] -> [b]
parmap g s p f [] = []
parmap g s p f (x:xs) = parGlobal g g s p fx
( parGlobal g g s p (forcelist pmxs)
(fx:pmxs) )
where fx = f x
pmxs = parmap g s p f xs
par_map :: Int -> (a -> b) -> [a] -> [b]
par_map g = parmap g 0 0
parmap1 :: (Int -> Int) -> (Int -> Int) -> (Int -> Int) -> (a -> b) -> [a] -> [b]
parmap1 g s p f l = parmap' 0 l
where parmap' n [] = []
parmap' n (x:xs) = parGlobal gn gn sn pn
pmxs
(parGlobal gn gn sn pn
fx
(fx:pmxs) )
where fx = f x
pmxs = parmap' (n+1) xs
gn = g n
sn = s n
pn = p n
par_map1 :: (Int -> Int) -> (a -> b) -> [a] -> [b]
par_map1 g = parmap1 g ignore ignore
where ignore _ = 0
pariterate :: Int -> Int -> Int -> (a -> a) -> a -> [a]
pariterate g s p f x = parGlobal g g s p fx
{- parGlobal 14# 0# (forcelist rest) -}
(fx : rest)
where fx = f x
rest = pariterate g s p f (f x)
par_iterate :: Int -> (a -> a) -> a -> [a]
par_iterate g = pariterate g 0 0
parzipWith :: Int -> Int -> Int -> (a -> b -> c) -> [a] -> [b] -> [c]
parzipWith g s p z (a:as) (b:bs) = parGlobal g g s p zab
(parGlobal g g s p (forcelist rest)
(zab : rest)
)
where zab = z a b
rest = parzipWith g s p z as bs
parzipWith _ _ _ _ _ _ = []
par_zipWith :: Int -> (a -> b -> c) -> [a] -> [b] -> [c]
par_zipWith g = parzipWith g 0 0
parzip :: Int -> Int -> Int -> [a] -> [b] -> [(a,b)]
parzip g s p = parzipWith g s p (\ a b -> (a,b))
par_zip :: Int -> [a] -> [b] -> [(a,b)]
par_zip g = parzip g 0 0
-- This version is taken from Roe's thesis (p. 38)
parfilter :: Int -> Int -> Int -> (a -> Bool) -> [a] -> [a]
parfilter _ _ _ pred [] = []
parfilter g s p pred (x:xs) = parGlobal g g s p rest l
where rest = parfilter g s p pred xs
l = if pred x then x:rest
else rest
par_filter :: Int -> (a -> Bool) -> [a] -> [a]
par_filter g = parfilter g 0 0
#endif {- SEQ -}
-- ---------------------------------------------------------------------------
-- General way how to force data-stuctures
-- ToDo: Use strategies
-- ---------------------------------------------------------------------------
#if 0
class Forcable a where
force :: a -> ()
instance Forcable [a] where
force = forcelist
#endif
-- Time-stamp: <Sat Jul 20 1996 21:47:15 Stardate: [-31]7839.33 hwloidl>
--
-- Compute all ways in which a certain amount of money can be paid by using
-- a fixed set of coins. In a NUM setup only the number of such possibilities
-- is computed. Use a GRAN setup for compilation under GranSim (i.e. compile
-- time option -DGRAN), a GUM setup to get a real parallel program.
-- This is a pre-strategy version using forcing functions from the module
-- ParForce.hs
-----------------------------------------------------------------------------
#if defined(GUM) || defined(GRAN)
module Main(mainPrimIO) where
import PreludeGlaST
#else
module Main(main) where
#endif
-- import Random (randomInts) -- Just for testing
-- ToDo: Move this into the ParForce module to hide GUM/GrAnSim specifics
#if defined(GUM)
-- Ignore name and priority fields in GUM
parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
parGlobal _ _ _ _ = par
-- Copied from ParForce
seq :: a -> b -> b
seq = _seq_
par :: a -> b -> b
par = _par_
par_map :: Int -> (a -> b) -> [a] -> [b]
par_map p f [] = []
par_map p f (x:xs) = parGlobal p p 1 0 fx
( parGlobal p p 1 0 (forcelist pmxs)
(fx:pmxs) )
where fx = f x
pmxs = par_map p f xs
forcelist [] = ()
forcelist (x:xs) = seq x (forcelist xs)
#elif defined(GRAN)
import ParForce
#else /* HBCPP */
import ParForce
#endif
-- import PreludeMonadicIO
-- import PreludeIOError
-- import LibTime
-- import Util -- quicksort is in there (part of libghc)
#if defined(MAX_PAR)
pay_num :: Int -> Int -> [Int] -> Int
pay_num _ 0 coins = 1 -- [accum]
pay_num _ val [] = 0
pay_num pri val coins =
parGlobal 5 5 1 0 coins' (
parGlobal 4 4 1 0 coins'' (
res
))
where coins' = dropWhile (>val) coins
coins'' = nub coins'
res = sum ( par_map pri
( \ c -> let
xs = dropWhile (>c) coins'
new_coins = xs\\[c]
in
parGlobal 2 2 1 0 xs (
parGlobal 3 3 1 0 new_coins (
pay_num (pri-1)
(val-c)
new_coins
) )
)
coins'' )
pay :: Int -> Int -> [Int] -> [Int] -> [[Int]]
pay pri 0 coins accum = [accum]
pay pri val [] _ = []
pay pri val coins accum =
parGlobal 5 5 1 0 coins' (
parGlobal 4 4 1 0 coins'' (
res
))
where coins' = dropWhile (>val) coins
coins'' = nub coins'
res = concat ( par_map pri
( \ c -> let
new_coins =
((dropWhile (>c) coins')\\[c])
in
parGlobal 3 3 1 0 new_coins (
pay (pri-1)
(val-c)
new_coins
(c:accum)
)
)
coins'' )
#else
pay_num :: Int -> Int -> [Int] -> Int
pay_num _ 0 coins = 1 -- [accum]
pay_num _ val [] = 0
pay_num pri val coins =
res
where coins' = dropWhile (>val) coins
coins'' = nub coins'
res = sum ( par_map pri
( \ c -> let
new_coins =
((dropWhile (>c) coins')\\[c])
in
pay_num (pri-1)
(val-c)
new_coins
)
coins'' )
pay :: Int -> Int -> [Int] -> [Int] -> [[Int]]
pay _ 0 coins accum = [accum]
pay _ val [] _ = []
pay pri val coins accum =
res
where coins' = dropWhile (>val) coins
coins'' = nub coins'
res = concat ( par_map pri
( \ c -> let
new_coins =
((dropWhile (>c) coins')\\[c])
in
pay (pri-1)
(val-c)
new_coins
(c:accum)
)
coins'' )
#endif
#if defined(RANDOM_INPUT)
getRandInt :: Int -> Int
getRandInt bound =
unsafePerformPrimIO (
getClockTime `thenPrimIO` \ t ->
returnPrimIO (
case t of
Left _ -> error "error in getClockTime"
Right b -> let
CalendarTime _ _ _ _ _ _ x _ _ _ _ _ = toCalendarTime b
in
((fromInteger x) `mod` bound) :: Int ) )
#endif
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
count_results :: [[Int]] -> Int
count_results = sum . concat
#if defined(NUM)
jaH :: Int -> Int
jaH = id
#else
jaH :: [[Int]] -> Int
jaH = length -- foldr (\ x y -> if (y==10) then 1 else 0) 0
-- jaH = length . filter (==10) . concat
#endif
#if defined(GRAN) || defined(GUM)
#ifdef ARGS
args_to_IntList a = map (\ a1 -> fst ((readDec a1) !! 0)) a
mainPrimIO = getArgsPrimIO `thenPrimIO` \ a ->
munch_input a
#else
mainPrimIO = munch_input []
#endif
#ifdef PRINT
munch_input a = appendChanPrimIO stdout ("\nCoins:\n" ++ (show coinsz)) `seqPrimIO`
appendChanPrimIO stdout ("\nValue: " ++ (show value)) `seqPrimIO`
appendChanPrimIO stdout ("\nResult: " ++ (pp res)) `seqPrimIO`
appendChanPrimIO stdout "\n" `seqPrimIO`
returnPrimIO ()
#else
# ifdef ARGS
munch_input a = if null a
then appendChanPrimIO stdout usage `seqPrimIO`
returnPrimIO ()
else
# else
munch_input _ =
# endif
seq (jaH res) (returnPrimIO ())
#endif
#else /* no PrimIO i.e. std Haskell 1.2 */
#ifdef ARGS
args_to_IntList a = map (\ a1 -> fst ((readDec a1) !! 0)) a
main = getArgs exit ( \ a -> munch_input a )
#else
main = munch_input []
#endif
#ifdef PRINT
munch_input a = appendChan stdout ("\nCoins:\n" ++ (show coinsz)) abort $
appendChan stdout ("\nValue: " ++ (show value)) abort $
appendChan stdout ("\nResult: " ++ (pp res)) abort $
appendChan stdout "\n" abort done
#else
# ifdef ARGS
munch_input a = if null a
then appendChan stdout usage abort done
else
# else
munch_input _ =
# endif
seq (jaH res) (appendChan stdout "done" abort done)
#endif
#endif /* PrimIO? */
where
#ifdef ARGS
-- usage = "Usage: coins <value> <coin1> <qty1> <coin2> <qty2> ...\n"
usage = "Usage: coins <value> \n"
value = head (args_to_IntList a) -- 14
{-
coins_flat = tail (args_to_IntList a) -- 14
zipify [] = []
zipify (c:q:xs) = (c,q) : zipify xs
coinsz = zipify coins_flat
coins = concat (map (\(v,q) -> [v | i <- [1..q]]) coinsz)
-}
#else
#if defined(RANDOM_INPUT)
value = (getRandInt 100) + 150 -- i.e. [150, 250]
#else
value = 179 -- 279
#endif
#endif
vals = [250, 100, 25, 10, 5, 1]
-- quants = [1, 3, 2, 5, 7, 12] -- std setup
quants = [5, 8, 8, 9, 12, 17]
coinsz = zip vals quants
coins = concat (map (\(v,q) -> [v | i <- [1..q]]) coinsz)
#if defined(NUM)
res = pay_num 100 value coins
#else
res = pay 100 value coins []
#endif
#if defined(NUM)
pp :: Int -> String
pp = show
#else
pp = unlines . reverse . snd .
foldr (\ l (n,q) ->
(n+1, ("<" ++ (show (n, length l, sum l)) ++ "> " ++ (show l)):q ))
(1,[])
#endif
TOP = ../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -package parallel -package random
SRCS = Board.hs \
Game.hs \
Prog.hs \
Tree.hs \
Wins.hs \
Main.hs
HC_OPTS += -package parallel -package random
PROG_ARGS = 4 6
......
TOP = ..
include $(TOP)/mk/boilerplate.mk
SSUBDIRS = anna bspt cacheprof compress compress2 fem fluid fulsom gamteb gg \
SUBDIRS = anna bspt cacheprof compress compress2 fem fluid fulsom gamteb gg \
grep hidden hpg infer lift maillist mkhprog parser pic prolog \
reptile rsa scs symalg veritas
# Omitted:
# HMMS binary file endian-ness problems
ifneq "$(HWL_NOFIB_HACK)" ""
NOT_THESE += cacheprof hidden pic
# cacheprof: **** expected exit status 0 not seen ; got 139
# hidden: expected stdout not matched by reality
# expected stdout not matched by reality
# HWL: tmp disabled for testing GUM-merged version (20/3/01)
SUBDIRS = $(filter-out $(NOT_THESE), $(SSUBDIRS))
else
SUBDIRS = $(SSUBDIRS)
endif
OTHER_SUBDIRS = HMMS PolyGP ebnf2ps linear rx
include $(TOP)/mk/target.mk
......@@ -11,12 +11,9 @@ SUBDIRS = \