Skip to content

Commit

Permalink
Added explicit error condition in Chameneos:complement
Browse files Browse the repository at this point in the history
  • Loading branch information
kayceesrk committed May 12, 2013
1 parent cfb7a56 commit 3eea595
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/Benchmarks/ChameneosRedux/FairShare.hs
Expand Up @@ -221,7 +221,8 @@ fork task on kind = do
sc <- getSCont;
setSContSwitchReason sc Completed;
switchToNext <- getYieldControlAction;
switchToNext
switchToNext;
return ()
}
let makeSCont = case kind of
Bound -> newBoundSCont
Expand Down
2 changes: 1 addition & 1 deletion tests/Benchmarks/ChameneosRedux/Makefile
Expand Up @@ -4,7 +4,7 @@ include ../../config.mk

TOP := ../../../
EXTRA_LIBS=/scratch/chandras/install
GHC_OPTS_EXTRA=-O2 -threaded -XDeriveDataTypeable -XBangPatterns -XCPP -XGeneralizedNewtypeDeriving -funbox-strict-fields -optc-O3 -ipqueue-1.2.1 -debug
GHC_OPTS_EXTRA=-O2 -threaded -XDeriveDataTypeable -XBangPatterns -XCPP -XGeneralizedNewtypeDeriving -funbox-strict-fields -ipqueue-1.2.1 -optc-O3

PROFILE_FLAGS := -DPROFILE_ENABLED -prof -fprof-auto -auto -auto-all

Expand Down
3 changes: 2 additions & 1 deletion tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
Expand Up @@ -36,6 +36,7 @@ complement !a !b = case a of
B -> case b of R -> Y; B -> B; _ -> R
R -> case b of B -> Y; R -> R; _ -> B
Y -> case b of B -> R; Y -> Y; _ -> B
_ -> error "complement: impossible"

type Chameneous = Ptr Color
data MP = Nobody !Int | Somebody !Int !Chameneous !(MVar Chameneous)
Expand Down Expand Up @@ -94,11 +95,11 @@ initSched = do
replicateM_ (n-1) newCapability

main = do
initSched
putStrLn . map toLower . unlines $
[unwords [show a, "+", show b, "->", show $ complement a b]
| a <- [B..Y], b <- [B..Y]]

n <- readIO . head =<< getArgs
initSched
actions <- zipWithM (run n) [0..] [[B..Y],[B,R,Y,R,Y,B,R,Y,R,B]]
sequence_ actions

0 comments on commit 3eea595

Please sign in to comment.