Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonidem2.0 -- merge non-idempotent branch once it is fixed #96

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions haskell/DEVLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,42 @@ Haven't seen this one before, a compile failure on the cfa package:
...
ld: symbol(s) not found for architecture x86_64


[2014.01.24] {Failure after recent nonidem merge}
-------------------------------------------------

Failed to install lvish-1.2.0.0
Last 10 lines of the build log ( /ffh/ryan/cloud_drive/working_copies/lvars/lvars/haskell/.cabal-sandbox/logs/lvish-1.2.0.0.log ):
Passed 5 64 69
Failed 0 1 1
Total 5 65 70
[*] test-framework exiting with: ExitFailure 1
[*] GC finished on main thread.
[*] Main thread exiting.
Test suite test-lvish: FAIL
Test suite logged to:
dist/dist-sandbox-38f74c87/test/lvish-1.2.0.0-test-lvish.log
0 of 1 test suites (0 of 1 test cases) passed.

Specifically, the failure is:

ThreadKilled exception inside child thread, ThreadId 79270 (not propagating!): "worker thread"
v4: [Failed]
Bad test outcome--exception: PutAfterFreezeExn "Attempt to change a frozen LVar"

It's proving a bit hard to reproduce, however.

Also... test after i9h is apparently deadlocking on -N4. Hmm.. why
are timeouts not working?
(And I'm getting plenty of the blocked-indefinitely errors in
various papers... these are probably the same failure but sometimes
the GC turns it into an exception. Not sure why timeouts aren't
working consistently on this branch. I see them sometimes.)

Ah, ok, I can get failures on AddRemoveSetTests



[2014.01.24] {More scheduler debugging}
----------------------------------------

Expand Down Expand Up @@ -669,6 +705,8 @@ default, and I got this:
ERROR: Final continuation of Par computation was duplicated, in spite of GET_ONCE!




[2014.10.24] {Criterion Microbenchmarking}
------------------------------------------

Expand Down Expand Up @@ -829,3 +867,38 @@ because this is a loop IN the par monad rather than the IO monad....
True -> lvl1_rcQD `cast` ...
}; }




[2014.10.26] {Debugging nonidem branch}
----------------------------------------

On the main (2.0) branch we're having some trouble with duplicated
gets inspite of `-fgetonce`. I wanted to try (finally) merging the
nonidem branch instead. I've done most of the merges to bring it up
to speed. However, not only does it still have errors like this:

"Bad test outcome--exception: Final continuation of Par computation
was duplicated, in spite of GET_ONCE!"

But, it also has some divergences. Timeouts on the following:

v3b: [Failed]
ERROR: <<timeout>>

i3c: [Failed]
Got the wrong exception, expected one of the strings: ["Attempt to change a frozen LVar"]
Instead got this exception:
"<<timeout>>"

v3d: [Failed]
ERROR: <<timeout>>

v3e: [Failed]
ERROR: <<timeout>>

v8a: [Failed]
ERROR: <<timeout>>

v8b: [Failed]
ERROR: <<timeout>>
5 changes: 3 additions & 2 deletions haskell/lvish/Control/LVish.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ import Control.LVish.Types
import Control.LVish.Internal as I
import Control.LVish.Basics as B
import Control.LVish.Logical
import qualified Internal.Control.LVish.SchedIdempotent as L
import Control.LVish.SchedIdempotentInternal (State)
import qualified Internal.Control.LVish.Sched as L
import Control.LVish.SchedQueue (State)

import Control.Par.EffectSigs
import Control.LVish.Logging (OutDest(..))
import Data.LVar.IVar
Expand Down
2 changes: 1 addition & 1 deletion haskell/lvish/Control/LVish/Basics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import qualified Data.Foldable as F
import Control.Exception (Exception, SomeException)
import Control.LVish.Internal as I
import Control.LVish.DeepFrz.Internal (Frzn, Trvrsbl)
import qualified Internal.Control.LVish.SchedIdempotent as L
import qualified Internal.Control.LVish.Sched as L
import qualified Control.LVish.Logging as Lg
import Control.LVish.Types
import Control.Par.EffectSigs
Expand Down
2 changes: 1 addition & 1 deletion haskell/lvish/Control/LVish/DeepFrz.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import GHC.Prim (unsafeCoerce#)
import Control.LVish.DeepFrz.Internal (DeepFrz(..), NonFrzn, Frzn, Trvrsbl)
import Control.LVish.Internal (Par(WrapPar))
import Control.Par.EffectSigs
import Internal.Control.LVish.SchedIdempotent (runPar, runParIO)
import Internal.Control.LVish.Sched (runPar, runParIO)
--------------------------------------------------------------------------------

-- | Under normal conditions, calling a `freeze` operation inside a
Expand Down
4 changes: 2 additions & 2 deletions haskell/lvish/Control/LVish/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Control.LVish.Internal

import Control.LVish.MonadToss
import Control.Applicative
import qualified Internal.Control.LVish.SchedIdempotent as L
import qualified Internal.Control.LVish.Sched as L
import Control.LVish.DeepFrz.Internal (Frzn, Trvrsbl)
import Control.Par.EffectSigs

Expand Down Expand Up @@ -74,7 +74,7 @@ newtype Par :: EffectSig -> * -> * -> * where
-- to.

-- LK: I don't care if we use `a` and `d` or `all` and `delt`, but why
-- not be consistent between here and SchedIdempotent.hs? Also, what
-- not be consistent between here and Sched.hs? Also, what
-- does `all` mean?
newtype LVar s all delt = WrapLVar { unWrapLVar :: L.LVar all delt }

Expand Down
2 changes: 1 addition & 1 deletion haskell/lvish/Control/LVish/Logical.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Control.LVish.Logical (asyncAnd, asyncOr, andMap, orMap) where
import Control.Par.EffectSigs
import Control.LVish.Basics
import Control.LVish.Internal (Par(WrapPar), unsafeDet)
import Internal.Control.LVish.SchedIdempotent (liftIO, HandlerPool)
import Internal.Control.LVish.Sched (liftIO, HandlerPool)
import Data.LVar.IVar as IV

import qualified Data.Atomics.Counter as C
Expand Down
194 changes: 0 additions & 194 deletions haskell/lvish/Control/LVish/SchedClass.hs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
{-# LANGUAGE NamedFieldPuns, BangPatterns #-}
{-# LANGUAGE RecursiveDo #-}

module Control.LVish.SchedIdempotentInternal (
State(logger, no),
new, number, next, pushWork, nullQ, yieldWork, currentCPU, setStatus, await, prng

module Control.LVish.SchedQueue (
State(logger, no),
new, number, idemp, next, pushWork, yieldWork, currentCPU, setStatus, await, prng
) where


Expand Down Expand Up @@ -85,6 +86,7 @@ popOther = popMine
-- All the state relevant to a single worker thread
data State a s = State
{ no :: {-# UNPACK #-} !Int, -- ^ The number of this worker
idemp :: Bool, -- ^ are we assuming task idempotence?
numWorkers :: Int, -- ^ Total number of workers in this runPar
prng :: IORef StdGen, -- ^ core-local random number generation
status :: IORef s, -- ^ A thread-local flag
Expand Down Expand Up @@ -189,7 +191,13 @@ new DbgCfg{dbgDests,dbgRange,dbgScheduling} numWorkers s = do
workpool <- newDeque
status <- newIORef s
prng <- newIORef $ mkStdGen i
return State { no = i, workpool, idle, status, states, prng, logger, numWorkers }
return State { no = i,
#ifdef LVISH_DEDUP
idemp = False,
#else
idemp = True,
#endif
workpool, idle, status, states, prng, logger, numWorkers }
rec states <- forM [0..(numWorkers-1)] $ mkState states
return (logger,states)

Expand Down
2 changes: 1 addition & 1 deletion haskell/lvish/Control/LVish/Unsafe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Control.LVish.Unsafe() where

import Control.LVish.Internal
import Control.Monad.IO.Class
import qualified Internal.Control.LVish.SchedIdempotent as L
import qualified Internal.Control.LVish.Sched as L

instance MonadIO (Par e s) where
liftIO = WrapPar . L.liftIO
2 changes: 1 addition & 1 deletion haskell/lvish/Control/Reagent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ postCommit :: Reagent a -> (a -> IO b) -> Reagent b
postCommit r f succ fail = r (\x -> f x >>= succ) fail

choice :: Reagent a -> Reagent a -> Reagent a
choice = error "TODO"
choice = error "TODO"
Loading