Browse files

Added submodule for benchmarks

  • Loading branch information...
1 parent 769f8d7 commit 4891ee27579a0aac53a73b4094ae40be4d5c35c2 @dmpots committed Aug 19, 2010
Showing with 17 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 .gitmodules
  3. +12 −6 FibonFind.hs
  4. +1 −0 benchmarks/Fibon/Benchmarks
View
1 .gitignore
@@ -117,3 +117,4 @@ run/
config/
log/
_T
+benchmarks/Fibon/Benchmarks.hs
View
3 .gitmodules
@@ -0,0 +1,3 @@
+[submodule "benchmarks/Fibon/Benchmarks"]
+ path = benchmarks/Fibon/Benchmarks
+ url = dmp4866@orion.cs.rice.edu:repos/fibon-benchmarks
View
18 FibonFind.hs
@@ -1,11 +1,12 @@
module FibonFind(findLocalBenchmarks) where
--module Main where
-import System.Directory
import Control.Exception
+import Control.Monad (filterM)
+import Data.List
+import System.Directory
import System.FilePath
import System.IO
-import Data.List
{-
-- for standalone testing
@@ -49,16 +50,21 @@ bmGroups baseDir = do
dirs <- try (getDirectoryContents baseDir) :: IO (Either IOError [FilePath])
case dirs of
Left _ -> return []
- Right ds -> return $ removeDotDirs ds
+ Right ds -> removeBadEntries ds
bmInstances :: FilePath -> [FilePath] -> IO [[String]]
bmInstances baseDir groups = do
let paths = map (baseDir</>) groups
bms <- mapM getDirectoryContents paths
- return (map removeDotDirs bms)
+ mapM removeBadEntries bms
+
+removeDotFiles :: [FilePath] -> [FilePath]
+removeDotFiles = filter (\d -> not ("." `isPrefixOf` d))
-removeDotDirs :: [FilePath] -> [FilePath]
-removeDotDirs = filter (\d -> d /= "." && d /= "..")
+removeBadEntries :: [FilePath] -> IO [FilePath]
+removeBadEntries dirs = do
+ noFiles <- filterM doesDirectoryExist dirs
+ return (removeDotFiles noFiles)
moduleHeader :: String
moduleHeader = join "\n" [
1 benchmarks/Fibon/Benchmarks
@@ -0,0 +1 @@
+Subproject commit c358597cbda3cd9783ccb82e878375e189280493

0 comments on commit 4891ee2

Please sign in to comment.