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

in  let message = "HelloWorld"

in  let cn = "testContainer"

in  let basicManifest = lib.argopkgsManifestDirPath ++ "basic.json"

9 10 11 12 13 14 15 16 17 18 19 20
in  let argIfTest =
            λ(isTest : Bool)
          → { isTest =
                isTest
            , timeout =
                      if isTest
                
                then  [ 60 ] : Optional Natural
                
                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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
                  )
                ⫽ { pre = [ "cp -r \$OPENMC_PWD/* ." ] }
          , 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"
                    ]
77 78
                  ⫽ argIfTest isTest
                  ⫽ { vars = [ { varname = "OMP_NUM_THREADS", value = "1" } ] }
Valentin Reis's avatar
Valentin Reis committed
79 80 81 82 83
                )
          , stream =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
84
                  ⫽ argIfTest isTest
Valentin Reis's avatar
Valentin Reis committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
                  ⫽ { 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
100 101 102 103 104 105 106 107 108
          ⫽ { args =
                [ message ]
            , verbose =
                True
            , cmdwants =
                [ message ]
            , timeout =
                [ 60 ] : Optional Natural
            }
Valentin Reis's avatar
Valentin Reis committed
109 110 111 112
        )
    , listen =
        lib.makeExtended
        (   lib.emptyMakeBaseArgs "sleep" basicManifest cn
113 114 115 116 117 118 119 120 121
          ⫽ { args =
                [ "1" ]
            , verbose =
                True
            , cmdwants =
                [] : List Text
            , timeout =
                [ 60 ] : Optional Natural
            }
Valentin Reis's avatar
Valentin Reis committed
122 123 124
        )
        [   lib.values.emptyCmd
            { name =
125
                "nrm"
Valentin Reis's avatar
Valentin Reis committed
126
            , outfile =
127
                "nrmlisten.out"
Valentin Reis's avatar
Valentin Reis committed
128
            , errfile =
129
                "nrmlisten.err"
Valentin Reis's avatar
Valentin Reis committed
130 131 132 133
            }
          ⫽ { args = [ "listen", "-u", cn ] }
        ]
    , power =
134 135 136 137
        lib.appTest
        (   lib.emptyFilterTestArgs "power"
          ⫽ { timeout = [ 60 ] : Optional Natural }
        )
Valentin Reis's avatar
Valentin Reis committed
138
    , performance =
139 140 141 142
        lib.appTest
        (   lib.emptyFilterTestArgs "performance"
          ⫽ { timeout = [ 60 ] : Optional Natural }
        )
Valentin Reis's avatar
Valentin Reis committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
    , 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
    }