all-tests.dh 5.7 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1 2 3 4 5 6
    let lib = ./lib.dh

in  let message = "HelloWorld"

in  let cn = "testContainer"

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

9 10
in  let perfManifest = lib.manifestDir ++ "perfwrap.json"

11 12 13 14 15 16 17
in  let argIfTest =
            λ(isTest : Bool)
          → { isTest =
                isTest
            , timeout =
                      if isTest
                
Valentin Reis's avatar
Valentin Reis committed
18
                then  [ 600 ] : Optional Natural
19 20 21 22
                
                else  [] : Optional Natural
            }

Valentin Reis's avatar
Valentin Reis committed
23 24 25 26
in  let apps =
          { qmcpack =
                λ(isTest : Bool)
              → lib.progressAppTest
27 28 29 30 31 32 33 34
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
                    [ "-n"
                    , if isTest then "2" else "24"
                    , "qmcpack"
                    , lib.qmcPackDir ++ "/simple-H2O.xml"
                    ]
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
35
                  ⫽ { cmdavoids = [ "Error", "error", "ERROR" ] }
Valentin Reis's avatar
Valentin Reis committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49
                )
          , lammps =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
                    [ "-n"
                    , if isTest then "2" else "24"
                    , "-bind-to"
                    , "core"
                    , "lmp_mpi"
                    , "-i"
                    , lib.lammpsDir ++ "/modified.lj"
                    ]
50
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
51
                  ⫽ { cmdavoids = [ "Error", "error", "ERROR" ] }
Valentin Reis's avatar
Valentin Reis committed
52 53 54 55 56 57 58
                )
          , openmc =
                λ(isTest : Bool)
              →   lib.progressAppTest
                  (   lib.emptyProgressAppTestArg
                      "mpiexec"
                      [ "-n", if isTest then "2" else "24", "openmc" ]
59
                    ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
60 61 62 63 64
                    ⫽ { passvars =
                          [ "OPENMC_CROSS_SECTIONS" ]
                      , cmdavoids =
                          [ "Error", "error", "ERROR" ]
                      }
Valentin Reis's avatar
Valentin Reis committed
65
                  )
Valentin Reis's avatar
Valentin Reis committed
66 67 68
                ⫽ { pre =
                      [ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ]
                  }
Valentin Reis's avatar
Valentin Reis committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
          , amg =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
                    [ "-n"
                    , if isTest then "2" else "24"
                    , "amg"
                    , "-problem"
                    , "2"
                    , "-n"
                    , "90"
                    , "90"
                    , "90"
                    , "-P"
                    , "2"
Valentin Reis's avatar
Valentin Reis committed
85
                    , if isTest then "1" else "12"
Valentin Reis's avatar
Valentin Reis committed
86 87
                    , "1"
                    ]
88
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
89 90 91
                  ⫽ { vars =
                        [ { varname = "OMP_NUM_THREADS", value = "1" } ]
                    , cmdavoids =
Valentin Reis's avatar
Valentin Reis committed
92
                        [ "Error", "error", "ERROR" ]
Valentin Reis's avatar
Valentin Reis committed
93
                    }
Valentin Reis's avatar
Valentin Reis committed
94 95 96 97 98
                )
          , stream =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
99
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
100 101 102 103 104 105 106 107
                  ⫽ { vars =
                        [ { varname =
                              "OMP_NUM_THREADS"
                          , value =
                              if isTest then "2" else "24"
                          }
                        , { varname = "OMP_PLACES", value = "cores" }
                        ]
Valentin Reis's avatar
Valentin Reis committed
108 109
                    , cmdavoids =
                        [ "Error", "error", "ERROR" ]
Valentin Reis's avatar
Valentin Reis committed
110 111 112 113 114 115 116
                    }
                )
          }

in  { hello =
        lib.makeBase
        (   lib.emptyMakeBaseArgs "echo" basicManifest cn
117 118 119 120 121 122
          ⫽ { args =
                [ message ]
            , verbose =
                True
            , cmdwants =
                [ message ]
Valentin Reis's avatar
Valentin Reis committed
123 124
            , cmdavoids =
                [ "Traceback" ]
125
            , timeout =
126
                [ 600 ] : Optional Natural
127
            }
Valentin Reis's avatar
Valentin Reis committed
128 129 130 131
        )
    , listen =
        lib.makeExtended
        (   lib.emptyMakeBaseArgs "sleep" basicManifest cn
132 133 134 135 136 137
          ⫽ { args =
                [ "1" ]
            , verbose =
                True
            , cmdwants =
                [] : List Text
Valentin Reis's avatar
Valentin Reis committed
138 139
            , cmdavoids =
                [ "Traceback" ]
140
            , timeout =
141
                [ 600 ] : Optional Natural
142
            }
Valentin Reis's avatar
Valentin Reis committed
143 144 145
        )
        [   lib.values.emptyCmd
            { name =
146
                "nrm"
Valentin Reis's avatar
Valentin Reis committed
147
            , outfile =
148
                "nrmlisten.out"
Valentin Reis's avatar
Valentin Reis committed
149
            , errfile =
150
                "nrmlisten.err"
Valentin Reis's avatar
Valentin Reis committed
151 152 153 154
            }
          ⫽ { args = [ "listen", "-u", cn ] }
        ]
    , power =
155
        lib.appTest
Valentin Reis's avatar
Valentin Reis committed
156
        (   lib.emptyFilterTestArgs "power" "sleep"
157
          ⫽ { timeout =
158
                [ 600 ] : Optional Natural
159 160 161 162 163
            , args =
                [ "15" ]
            , isTest =
                True
            }
164
        )
Valentin Reis's avatar
Valentin Reis committed
165
    , performance =
166 167 168 169 170 171 172 173 174 175 176
          lib.appTest
          (   lib.emptyFilterTestArgs "performance" "sleep"
            ⫽ { timeout =
                  [ 600 ] : Optional Natural
              , args =
                  [ "15" ]
              , isTest =
                  True
              }
          )
        ⫽ { manifest = perfManifest }
Valentin Reis's avatar
Valentin Reis committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
    , stream =
        apps.stream True
    , openmc =
        apps.openmc True
    , lammps =
        apps.lammps True
    , qmcpack =
        apps.qmcpack True
    , amg =
        apps.amg True
    , streamRun =
        apps.stream False
    , openmcRun =
        apps.openmc False
    , lammpsRun =
        apps.lammps False
    , qmcpackRun =
        apps.qmcpack False
    , amgRun =
        apps.amg False
    }