all-tests.dh 5.85 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
let lib = ./lib.dh
Valentin Reis's avatar
Valentin Reis committed
2

Valentin Reis's avatar
Valentin Reis committed
3
let message = "HelloWorld"
Valentin Reis's avatar
Valentin Reis committed
4

Valentin Reis's avatar
Valentin Reis committed
5
let cn = "testContainer"
Valentin Reis's avatar
Valentin Reis committed
6

Valentin Reis's avatar
Valentin Reis committed
7
let basicManifest = lib.manifestDir ++ "basic.json"
Valentin Reis's avatar
Valentin Reis committed
8

Valentin Reis's avatar
Valentin Reis committed
9 10 11 12 13 14 15
let argIfTest =
        λ(isTest : Bool)
      → { isTest =
            isTest
        , timeout =
            if isTest then [ 600 ] : Optional Natural else [] : Optional Natural
        }
16

Valentin Reis's avatar
Valentin Reis committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
let Powercap = < Cap : Text | NoCap : {} >

let apps =
      { 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
Valentin Reis's avatar
Valentin Reis committed
37
                  }
Valentin Reis's avatar
Valentin Reis committed
38 39 40 41 42 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
              )
            )
            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
Valentin Reis's avatar
Valentin Reis committed
70 71
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
Valentin Reis's avatar
Valentin Reis committed
72
                    [ "-n", if isTest then "2" else "24", "openmc" ]
73
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
74 75
                  ⫽ { passvars =
                        [ "OPENMC_CROSS_SECTIONS" ]
Valentin Reis's avatar
Valentin Reis committed
76 77
                    , cmdavoids =
                        [ "Error", "error", "ERROR" ]
Valentin Reis's avatar
Valentin Reis committed
78 79
                    , powercap =
                        powercap
Valentin Reis's avatar
Valentin Reis committed
80 81
                    }
                )
Valentin Reis's avatar
Valentin Reis committed
82 83 84 85 86 87 88 89 90 91 92 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
              ⫽ { pre =
                    [ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ]
                }
            )
            isTest
      , amg =
            λ(isTest : Bool)
          → λ(powercap : Powercap)
          → lib.extendApp
            ( lib.progressAppTest
              (   lib.emptyProgressAppTestArg
                  "mpiexec"
                  [ "-n"
                  , if isTest then "2" else "24"
                  , "amg"
                  , "-problem"
                  , "2"
                  , "-n"
                  , "90"
                  , "90"
                  , "90"
                  , "-P"
                  , "2"
                  , if isTest then "1" else "12"
                  , "1"
                  ]
                ⫽ argIfTest isTest
                ⫽ { vars =
                      [ { varname = "OMP_NUM_THREADS", value = "1" } ]
                  , cmdavoids =
                      [ "Error", "error", "ERROR" ]
                  , powercap =
                      powercap
                  }
              )
            )
            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
                  }
              )
            )
            isTest
      }
Valentin Reis's avatar
Valentin Reis committed
143

Valentin Reis's avatar
Valentin Reis committed
144 145 146
in  { apps =
        apps
    , hello =
Valentin Reis's avatar
Valentin Reis committed
147
        lib.makeBase
Valentin Reis's avatar
Valentin Reis committed
148
        (   lib.emptyMakeBaseArg "echo" basicManifest cn
149 150 151 152 153 154
          ⫽ { args =
                [ message ]
            , verbose =
                True
            , cmdwants =
                [ message ]
Valentin Reis's avatar
Valentin Reis committed
155 156
            , cmdavoids =
                [ "Traceback" ]
157
            , timeout =
158
                [ 600 ] : Optional Natural
159
            }
Valentin Reis's avatar
Valentin Reis committed
160 161 162
        )
    , listen =
        lib.makeExtended
Valentin Reis's avatar
Valentin Reis committed
163
        (   lib.emptyMakeBaseArg "sleep" basicManifest cn
164 165 166 167 168 169
          ⫽ { args =
                [ "1" ]
            , verbose =
                True
            , cmdwants =
                [] : List Text
Valentin Reis's avatar
Valentin Reis committed
170 171
            , cmdavoids =
                [ "Traceback" ]
172
            , timeout =
173
                [ 600 ] : Optional Natural
174
            }
Valentin Reis's avatar
Valentin Reis committed
175 176 177
        )
        [   lib.values.emptyCmd
            { name =
178
                "nrm"
Valentin Reis's avatar
Valentin Reis committed
179
            , outfile =
180
                "nrmlisten.out"
Valentin Reis's avatar
Valentin Reis committed
181
            , errfile =
182
                "nrmlisten.err"
Valentin Reis's avatar
Valentin Reis committed
183 184 185 186
            }
          ⫽ { args = [ "listen", "-u", cn ] }
        ]
    , power =
187
        lib.appTest
Valentin Reis's avatar
Valentin Reis committed
188
        (   lib.emptyFilterTestArgs "power" "sleep"
189
          ⫽ { timeout =
190
                [ 600 ] : Optional Natural
191 192 193 194 195
            , args =
                [ "15" ]
            , isTest =
                True
            }
196
        )
Valentin Reis's avatar
Valentin Reis committed
197
    , performance =
Valentin Reis's avatar
Valentin Reis committed
198 199 200 201 202 203 204 205 206 207 208 209
        lib.appTest
        (   lib.emptyFilterTestArgs "performance" "sleep"
          ⫽ { timeout =
                [ 600 ] : Optional Natural
            , args =
                [ "15" ]
            , isTest =
                True
            , manifestname =
                "perfwrap.json"
            }
        )
Valentin Reis's avatar
Valentin Reis committed
210
    }