module Main where import System.Libhwloc main :: IO () main = do initialise >>= \case Nothing -> error "Couldn't initialise topology" Just topology -> load topology >>= \case False -> error "Couldn't load topology" True -> do packages <- getNumberOfObjectsByType topology Package pus <- getNumberOfObjectsByType topology PU putStrLn $ "# of processor packages: " <> show packages putStrLn $ "# of processing units: " <> show pus