-- main function for using single-threaded arrays
-- providing a baseline for performance

import System.Environment (getArgs)
import Control.Concurrent.STM
import Data.Array.MArray

import Base
import Cluster
import ContigEnds

main :: IO ()
main = do
  [bam] <- getArgs -- use a single bam file
  timestamp "start"  
  (n,ls,rs) <- collect_links bam
  timestamp "links collected"  
  as <- initializeSTM n
  timestamp "initialized"  
  mapM_ (atomically . scaffold1 rs ls as) [0..n-1]  -- uh, n threads?
  timestamp "scaffolded"
  printSTM (snd as)
  timestamp "done!"



