all-tests.dh 5.58 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 11 12 13 14 15
in  let argIfTest =
            λ(isTest : Bool)
          → { isTest =
                isTest
            , timeout =
                      if isTest
                
Valentin Reis's avatar
Valentin Reis committed
16
                then  [ 600 ] : Optional Natural
17 18 19 20
                
                else  [] : Optional Natural
            }

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

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