all-tests.dh 8.01 KB
Newer Older
1
  λ(dataDir : Text)
Valentin Reis's avatar
Valentin Reis committed
2 3
-> λ(manifestDir : Text)
→ let lib = ./lib.dh dataDir manifestDir
Valentin Reis's avatar
Valentin Reis committed
4
  
5
  let message = "HelloWorld"
Valentin Reis's avatar
Valentin Reis committed
6
  
7
  let cn = "testContainer"
Valentin Reis's avatar
Valentin Reis committed
8
  
Valentin Reis's avatar
Valentin Reis committed
9
  let basicManifest = manifestDir ++ "basic.yml"
Valentin Reis's avatar
Valentin Reis committed
10
  
Valentin Reis's avatar
Valentin Reis committed
11
  let singularityManifest = manifestDir ++ "singularity.yml"
Valentin Reis's avatar
Valentin Reis committed
12
  
13 14 15 16 17 18
  let argIfTest =
          λ(isTest : Bool)
        → { isTest =
              isTest
          , timeout =
                    if isTest
Valentin Reis's avatar
Valentin Reis committed
19
              
20
              then  [ 600 ] : Optional Natural
Valentin Reis's avatar
Valentin Reis committed
21
              
22 23
              else  [] : Optional Natural
          }
Valentin Reis's avatar
Valentin Reis committed
24
  
25
  let Powercap = < Cap : Text | NoCap : {} >
Valentin Reis's avatar
Valentin Reis committed
26
  
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  in  { run-singularity =
          lib.makeBase
          (   lib.emptyMakeBaseArg "echo" singularityManifest cn
            ⫽ { args =
                  [ message ]
              , verbose =
                  True
              , singularity =
                  True
              , cmdwants =
                  [] : List Text
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              }
43
          )
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
      , run =
          lib.makeBase
          (   lib.emptyMakeBaseArg "echo" basicManifest cn
            ⫽ { args =
                  [ message ]
              , verbose =
                  True
              , cmdwants =
                  [] : List Text
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              }
          )
      , pwd =
          lib.makeBase
          (   lib.emptyMakeBaseArg "pwd" basicManifest cn
            ⫽ { args =
                  [] : List Text
              , verbose =
                  True
              , cmdwants =
                  [ "toto" ] : List Text
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              , runwd =
                  [ "toto" ] : Optional Text
              }
          )
Valentin Reis's avatar
Valentin Reis committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
      , exitcode =
          lib.makeBase
          (   lib.emptyMakeBaseArg "false" basicManifest cn
            ⫽ { args =
                  [] : List Text
              , verbose =
                  True
              , cmdwants =
                  [] : List Text
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              , runExitcode =
                  [ +1 ] : Optional Integer
              }
          )
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
      , hello =
          lib.makeBase
          (   lib.emptyMakeBaseArg "echo" basicManifest cn
            ⫽ { args =
                  [ message ]
              , verbose =
                  True
              , cmdwants =
                  [ message ]
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              }
          )
      , listen =
          lib.makeExtended
          (   lib.emptyMakeBaseArg "sleep" basicManifest cn
            ⫽ { args =
                  [ "1" ]
              , verbose =
                  True
              , cmdwants =
                  [] : List Text
              , cmdavoids =
                  [ "Traceback" ]
              , timeout =
                  [ 600 ] : Optional Natural
              }
          )
          [   lib.values.emptyCmd
              { name =
                  "nrm"
              , outfile =
                  "nrmlisten.out"
              , errfile =
                  "nrmlisten.err"
              }
            ⫽ { args = [ "listen", "-u", cn ] }
          ]
      , power =
          lib.appTest
          (   lib.emptyFilterTestArgs "power" "sleep"
            ⫽ { timeout =
                  [ 600 ] : Optional Natural
              , args =
                  [ "15" ]
              , isTest =
                  True
              }
          )
      , performance =
          lib.appTest
          (   lib.emptyFilterTestArgs "performance" "sleep"
            ⫽ { timeout =
                  [ 600 ] : Optional Natural
              , args =
                  [ "15" ]
              , isTest =
                  True
              , manifestname =
Valentin Reis's avatar
yaml  
Valentin Reis committed
154
                  "perfwrap.yml"
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
              }
          )
      , qmcpack =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            ( lib.progressAppTest
              (   lib.emptyProgressAppTestArg
                  "mpiexec"
                  [ "-n"
                  , if isTest then "2" else "24"
                  , "qmcpack"
                  , lib.qmcPackDir ++ "/simple-H2O.xml"
                  ]
                ⫽ argIfTest isTest
                ⫽ { cmdavoids =
                      [ "Error", "error", "ERROR" ]
                  , powercap =
                      powercap
                  }
              )
            )
            isTest
      , lammps =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            ( lib.progressAppTest
              (   lib.emptyProgressAppTestArg
                  "mpiexec"
                  [ "-n"
                  , if isTest then "2" else "24"
                  , "-bind-to"
                  , "core"
                  , "lmp_mpi"
                  , "-i"
                  , lib.lammpsDir ++ "/modified.lj"
                  ]
                ⫽ argIfTest isTest
                ⫽ { cmdavoids =
                      [ "Error", "error", "ERROR" ]
                  , powercap =
                      powercap
                  }
              )
            )
            isTest
      , openmc =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            (   lib.progressAppTest
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
                    [ "-n", if isTest then "2" else "24", "openmc" ]
                  ⫽ argIfTest isTest
                  ⫽ { passvars =
                        [ "OPENMC_CROSS_SECTIONS" ]
                    , cmdavoids =
                        [ "Error" ]
                    , powercap =
                        powercap
                    }
                )
              ⫽ { pre =
                    [ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ]
221 222
                }
            )
223 224 225 226 227 228
            isTest
      , amg =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            ( lib.progressAppTest
229 230
              (   lib.emptyProgressAppTestArg
                  "mpiexec"
231 232 233 234 235 236 237 238 239 240 241 242 243 244
                  [ "-n"
                  , if isTest then "2" else "24"
                  , "amg"
                  , "-problem"
                  , "2"
                  , "-n"
                  , "90"
                  , "90"
                  , "90"
                  , "-P"
                  , "2"
                  , if isTest then "1" else "12"
                  , "1"
                  ]
245
                ⫽ argIfTest isTest
246 247
                ⫽ { vars =
                      [ { varname = "OMP_NUM_THREADS", value = "1" } ]
248
                  , cmdavoids =
249
                      [ "Error", "error", "ERROR" ]
250 251 252 253 254
                  , powercap =
                      powercap
                  }
              )
            )
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
            isTest
      , stream =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            ( lib.progressAppTest
              (   lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
                ⫽ argIfTest isTest
                ⫽ { vars =
                      [ { varname =
                            "OMP_NUM_THREADS"
                        , value =
                            if isTest then "2" else "24"
                        }
                      , { varname = "OMP_PLACES", value = "cores" }
                      ]
                  , cmdavoids =
                      [ "Error", "error", "ERROR" ]
                  , powercap =
                      powercap
                  }
              )
277
            )
278 279
            isTest
      }