Commit 85274f0d authored by Valentin Reis's avatar Valentin Reis

propagating hwloc to the runtime

parent 9d6d6b75
Pipeline #5185 passed with stage
in 28 seconds
......@@ -7,7 +7,8 @@ let
hpkgs = pkgs.haskellPackages.override {
overrides = self: super: rec {
argotk = self.callCabal2nix "argotk" (filterHdevTools ./.) {};
argotk = (self.callCabal2nix "argotk" (filterHdevTools ./.) {}).overrideAttrs
(old:{propagatedBuildInputs=old.buildInputs ++ [pkgs.hwloc];});
};
};
......
# 3d Lennard-Jones melt
variable x index 100
variable y index 100
variable z index 100
variable t index 10000
variable x index 1
variable y index 1
variable z index 1
variable t index 100
variable xx equal 20*$x
variable yy equal 20*$y
......
......@@ -14,7 +14,7 @@
{
"name": "argo/container",
"value": {
"cpus": "24",
"cpus": "48",
"mems": "1"
}
},
......
# 3d Lennard-Jones melt
variable x index 100000
variable y index 100000
variable z index 100000
variable t index 10000
variable x index 5
variable y index 5
variable z index 10
variable t index 100
variable xx equal 20*$x
variable yy equal 20*$y
......
......@@ -19,7 +19,7 @@ data StackArgs = StackArgs
, args :: [AppArg]
, containerName :: ContainerName
, workingDirectory :: WorkingDirectory
, shareDir :: ShareDir
, shareDir :: ShareDir
, manifestName :: ManifestName
, daemon :: ProcessBehavior
, cmdrun :: ProcessBehavior
......@@ -27,10 +27,12 @@ data StackArgs = StackArgs
, cmdlistenprogress :: ProcessBehavior
, cmdlistenperformance :: ProcessBehavior
, cmdlistenpower :: ProcessBehavior
, hwThreadCount :: HwThreadCount
} deriving (Show)
{-data OutputFiles = OutputFiles FilePath FilePath-}
data Verbosity = Normal | Verbose deriving (Show,Read,Eq)
newtype HwThreadCount = HwThreadCount Int deriving (Show, Read, Eq)
newtype AppArg = AppArg Text deriving (IsString, Show, Read)
newtype WorkingDirectory = WorkingDirectory FilePath deriving (IsString, Show)
newtype AppName = AppName Text deriving (IsString, Show, Read)
......@@ -71,6 +73,7 @@ instance Default StackArgs where
, cmdlistenprogress = DontRun
, cmdlistenperformance = DontRun
, cmdlistenpower = DontRun
, hwThreadCount = HwThreadCount 1
}
parseExtendStackArgs :: StackArgs -> Parser StackArgs
......@@ -156,6 +159,13 @@ parseExtendStackArgs sa = do
<> showDefault
<> value (cmdlistenpower sa)
)
hwThreadCount <- option auto
( long "threadCount"
<> metavar "THREADS"
<> help "Number of threads to use when running the stack."
<> showDefault
<> value (hwThreadCount sa)
)
args <- some (argument str (metavar "ARGS" <> help "Application arguments."))
<|> pure (args sa)
pure StackArgs {..}
......@@ -4,6 +4,7 @@
{-# LANGUAGE QuasiQuotes #-}
import NeatInterpolation
import Data.Coerce (coerce)
import Argo.Stack
import Argo.Utils
import Argo.Args
......@@ -192,22 +193,37 @@ configureTest = \case
|]
, isTest = IsTest
}
RunAMG -> runAppSpec
(AppName "mpiexec")
[ AppArg "-n"
, AppArg "24"
, AppArg "amg"
, AppArg "-problem"
, AppArg "2"
, AppArg "-n"
, AppArg "3"
, AppArg "3"
, AppArg "3"
, AppArg "-P"
, AppArg "8"
, AppArg "3"
, AppArg "1"
]
RunAMG ->
TestSpec
{ stackArgsUpdate = \sa -> sa
{ app = AppName "mpiexec"
, args = let tc = coerce (hwThreadCount sa):: Int in
[ AppArg "-n"
, AppArg $ repr tc
, AppArg "amg"
, AppArg "-problem"
, AppArg "2"
, AppArg "-n"
, AppArg "3"
, AppArg "3"
, AppArg "3"
, AppArg "-P"
, AppArg "8"
, AppArg $ repr $ quot tc 8
, AppArg "1"
]
, manifestName = "parallel.json"
, daemon = daemonBehavior
, cmdrun = runBehavior
, cmdlistenperformance = JustRun (StdOutLog "performance.csv")
(StdErrLog "performance.log")
, cmdlistenpower = JustRun (StdOutLog "power.csv") (StdErrLog "power.log")
, cmdlistenprogress = JustRun (StdOutLog "progress.csv")
(StdErrLog "progress.log")
}
, description = "Set up and start daemon, run app in a container."
, isTest = NotTest
}
RunSTREAM -> runAppSpec (AppName "stream_c_2000") []
RunLAMMPS -> TestSpec
{ stackArgsUpdate = \sa -> sa
......@@ -216,7 +232,7 @@ configureTest = \case
let (ShareDir dirn) = shareDir sa
Right inpath = toText (dirn </> "modified.lj")
in [ AppArg "-n"
, AppArg "24"
, AppArg $ repr (coerce (hwThreadCount sa):: Int)
, AppArg "lmp_mpi"
, AppArg "-i"
, AppArg inpath
......@@ -313,6 +329,8 @@ clean StackArgs {..} = cleanLeftovers workingDirectory
main :: IO ()
main = do
argonixShare <- getEnv "ARGOTK_SHARE"
let a = def { shareDir = ShareDir $ decodeString argonixShare }
hwlocTC <- single $ inshell "hwloc-calc machine:0 -N PU" empty
let a = def { shareDir = ShareDir $ decodeString argonixShare
, hwThreadCount = HwThreadCount (read $ unpack $ lineToText hwlocTC) }
turtle <- execParser (info (opts a <**> helper) idm)
sh turtle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment