all-tests.dh 3.9 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 70 71 72 73 74 75 76 77 78 79 80 81 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
    let lib = ./lib.dh

in  let message = "HelloWorld"

in  let cn = "testContainer"

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

in  let apps =
          { qmcpack =
                λ(isTest : Bool)
              → lib.progressAppTest
                ( lib.emptyProgressAppTestArg
                  "mpiexec"
                  [ "-n"
                  , if isTest then "2" else "24"
                  , "qmcpack"
                  , lib.qmcPackDir ++ "/simple-H2O.xml"
                  ]
                )
          , 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"
                    ]
                  ⫽ { isTest = isTest }
                )
          , openmc =
                λ(isTest : Bool)
              →   lib.progressAppTest
                  (   lib.emptyProgressAppTestArg
                      "mpiexec"
                      [ "-n", if isTest then "2" else "24", "openmc" ]
                    ⫽ { isTest = isTest }
                  )
                ⫽ { 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"
                    ]
                  ⫽ { vars =
                        [ { varname = "OMP_NUM_THREADS", value = "1" } ]
                    , isTest =
                        isTest
                    }
                )
          , stream =
                λ(isTest : Bool)
              → lib.progressAppTest
                (   lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
                  ⫽ { vars =
                        [ { varname =
                              "OMP_NUM_THREADS"
                          , value =
                              if isTest then "2" else "24"
                          }
                        , { varname = "OMP_PLACES", value = "cores" }
                        ]
                    , isTest =
                        isTest
                    }
                )
          }

in  { hello =
        lib.makeBase
        (   lib.emptyMakeBaseArgs "echo" basicManifest cn
          ⫽ { args = [ message ], verbose = True, cmdwants = [ message ] }
        )
    , listen =
        lib.makeExtended
        (   lib.emptyMakeBaseArgs "sleep" basicManifest cn
          ⫽ { args = [ "1" ], verbose = True, cmdwants = [] : List Text }
        )
        [   lib.values.emptyCmd
            { name =
                "cmd"
            , outfile =
                "cmdlisten.out"
            , errfile =
                "cmdlisten.err"
            }
          ⫽ { args = [ "listen", "-u", cn ] }
        ]
    , power =
        lib.appTest (lib.emptyFilterTestArgs "power")
    , performance =
        lib.appTest (lib.emptyFilterTestArgs "performance")
    , 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
    }