all-tests.dh 4.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 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 34 35 36 37 38 39 40 41 42 43 44 45 46
                )
          , 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"
                    ]
47
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
48 49 50 51 52 53 54
                )
          , openmc =
                λ(isTest : Bool)
              →   lib.progressAppTest
                  (   lib.emptyProgressAppTestArg
                      "mpiexec"
                      [ "-n", if isTest then "2" else "24", "openmc" ]
55
                    ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
56
                    ⫽ { passvars = [ "OPENMC_CROSS_SECTIONS" ] }
Valentin Reis's avatar
Valentin Reis committed
57
                  )
Valentin Reis's avatar
Valentin Reis committed
58
                ⫽ { pre = [ "cp -r " ++ lib.openmcDir ++ " ." ] }
Valentin Reis's avatar
Valentin Reis committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
          , amg =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg
                    "mpiexec"
                    [ "-n"
                    , if isTest then "2" else "24"
                    , "amg"
                    , "-problem"
                    , "2"
                    , "-n"
                    , "90"
                    , "90"
                    , "90"
                    , "-P"
                    , "2"
                    , "12"
                    , "1"
                    ]
78 79
                  ⫽ argIfTest isTest
                  ⫽ { vars = [ { varname = "OMP_NUM_THREADS", value = "1" } ] }
Valentin Reis's avatar
Valentin Reis committed
80 81 82 83 84
                )
          , stream =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
85
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
                  ⫽ { vars =
                        [ { varname =
                              "OMP_NUM_THREADS"
                          , value =
                              if isTest then "2" else "24"
                          }
                        , { varname = "OMP_PLACES", value = "cores" }
                        ]
                    }
                )
          }

in  { hello =
        lib.makeBase
        (   lib.emptyMakeBaseArgs "echo" basicManifest cn
101 102 103 104 105 106 107 108 109
          ⫽ { args =
                [ message ]
            , verbose =
                True
            , cmdwants =
                [ message ]
            , timeout =
                [ 60 ] : Optional Natural
            }
Valentin Reis's avatar
Valentin Reis committed
110 111 112 113
        )
    , listen =
        lib.makeExtended
        (   lib.emptyMakeBaseArgs "sleep" basicManifest cn
114 115 116 117 118 119 120 121 122
          ⫽ { args =
                [ "1" ]
            , verbose =
                True
            , cmdwants =
                [] : List Text
            , timeout =
                [ 60 ] : Optional Natural
            }
Valentin Reis's avatar
Valentin Reis committed
123 124 125 126 127 128 129 130 131 132 133 134
        )
        [   lib.values.emptyCmd
            { name =
                "cmd"
            , outfile =
                "cmdlisten.out"
            , errfile =
                "cmdlisten.err"
            }
          ⫽ { args = [ "listen", "-u", cn ] }
        ]
    , power =
135
        lib.appTest
Valentin Reis's avatar
Valentin Reis committed
136 137
        (   lib.emptyFilterTestArgs "power" "sleep"
          ⫽ { timeout = [ 60 ] : Optional Natural, args = [ "15" ] }
138
        )
Valentin Reis's avatar
Valentin Reis committed
139
    , performance =
140
        lib.appTest
Valentin Reis's avatar
Valentin Reis committed
141 142
        (   lib.emptyFilterTestArgs "performance" "sleep"
          ⫽ { timeout = [ 60 ] : Optional Natural, args = [ "15" ] }
143
        )
Valentin Reis's avatar
Valentin Reis committed
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
    , 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
    }