diff --git a/.github/workflows/idefix-ci-jobs.yml b/.github/workflows/idefix-ci-jobs.yml new file mode 100644 index 00000000..c0e62296 --- /dev/null +++ b/.github/workflows/idefix-ci-jobs.yml @@ -0,0 +1,203 @@ +on: + workflow_call: + inputs: + TESTME_OPTIONS: + required: true + type: string + IDEFIX_COMPILER: + required: true + type: string + +# concurrency: +# # auto-cancel any concurrent job *in the same context* +# # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency +# # see https://docs.github.com/en/actions/learn-github-actions/contexts#github-context +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +env: + IDEFIX_COMPILER: ${{ inputs.IDEFIX_COMPILER }} + TESTME_OPTIONS: ${{ inputs.TESTME_OPTIONS }} + PYTHONPATH: ${{ github.workspace }} + IDEFIX_DIR: ${{ github.workspace }} + +jobs: + ShocksHydro: + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Sod test + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/sod -all $TESTME_OPTIONS + - name: Isothermal Sod test + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/sod-iso -all $TESTME_OPTIONS + - name: Mach reflection test + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD//MachReflection -all $TESTME_OPTIONS + + ParabolicHydro: + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Viscous flow past cylinder + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/ViscousFlowPastCylinder -all $TESTME_OPTIONS + - name: Viscous disk + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/ViscousDisk -all $TESTME_OPTIONS + - name: Thermal diffusion + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/thermalDiffusion -all $TESTME_OPTIONS + + ShocksMHD: + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: MHD Sod test + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sod -all $TESTME_OPTIONS + - name: MHD Isothermal Sod test + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sod-iso -all $TESTME_OPTIONS + - name: Orszag Tang + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang -all $TESTME_OPTIONS + - name: Orszag Tang 3D+restart tests + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang3D -all $TESTME_OPTIONS + + ParabolicMHD: + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Ambipolar C Shock + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AmbipolarCshock -all $TESTME_OPTIONS + - name: Ambipolar C Shock 3D + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AmbipolarCshock3D -all $TESTME_OPTIONS + - name: Resistive Alfvén wave + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/ResistiveAlfvenWave -all $TESTME_OPTIONS + - name: Grid coarsening diffusion + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/Coarsening -all $TESTME_OPTIONS + - name: Hall whistler waves + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/HallWhistler -all $TESTME_OPTIONS + + Fargo: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Fargo + planet + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/FargoPlanet -all $TESTME_OPTIONS + - name: Fargo MHD spherical + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/FargoMHDSpherical -all $TESTME_OPTIONS + + ShearingBox: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Hydro shearing box + run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/ShearingBox -all $TESTME_OPTIONS + - name: MHD shearing box + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/ShearingBox -all $TESTME_OPTIONS + + SelfGravity: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Jeans Instability + run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/JeansInstability -all $TESTME_OPTIONS + - name: Random sphere spherical + run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/RandomSphere -all $TESTME_OPTIONS + - name: Random sphere cartesian + run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/RandomSphereCartesian -all $TESTME_OPTIONS + - name: Uniform spherical collapse + run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/UniformCollapse -all $TESTME_OPTIONS + - name: Dusty spherical collapse + run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/DustyCollapse -all $TESTME_OPTIONS + + Planet: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: 3 body + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/Planet3Body -all $TESTME_OPTIONS + - name: migration + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/PlanetMigration2D -all $TESTME_OPTIONS + - name: planet-planet + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/PlanetPlanetRK42D -all $TESTME_OPTIONS + - name: spiral wake + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/PlanetSpiral2D -all $TESTME_OPTIONS + - name: torques + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/PlanetTorque3D -all $TESTME_OPTIONS + - name: RK5 + run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/PlanetsIsActiveRK52D -all $TESTME_OPTIONS + + Dust: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Energy conservation + run: scripts/ci/run-tests $IDEFIX_DIR/test/Dust/DustEnergy -all $TESTME_OPTIONS + - name: Dusty wave + run: scripts/ci/run-tests $IDEFIX_DIR/test/Dust/DustyWave -all $TESTME_OPTIONS + + Braginskii: + needs: [ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: MTI + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/MTI -all $TESTME_OPTIONS + - name: Spherical anisotropic diffusion + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sphBragTDiffusion -all $TESTME_OPTIONS + - name: Spherical anisotropic viscosity + run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sphBragViscosity -all $TESTME_OPTIONS + + Examples: + needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Run examples test + run: cd test && ./checks_examples.sh $TEST_OPTIONS + + Utils: + needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Lookup table + run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/lookupTable -all $TESTME_OPTIONS + - name: Dump Image + run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/dumpImage -all $TESTME_OPTIONS diff --git a/.github/workflows/idefix-ci.yml b/.github/workflows/idefix-ci.yml index e8201828..cb946143 100644 --- a/.github/workflows/idefix-ci.yml +++ b/.github/workflows/idefix-ci.yml @@ -4,23 +4,11 @@ on: push: branches: - master - - v2.0 + - develop pull_request: paths-ignore: - '.github/ISSUE_TEMPLATE/*' -concurrency: - # auto-cancel any concurrent job *in the same context* - # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency - # see https://docs.github.com/en/actions/learn-github-actions/contexts#github-context - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - TESTME_OPTIONS: -cuda -Werror - PYTHONPATH: ${{ github.workspace }} - IDEFIX_DIR: ${{ github.workspace }} - jobs: Linter: # Don't do this in forks @@ -35,261 +23,26 @@ jobs: - uses: pre-commit-ci/lite-action@v1.0.0 if: always() - ShocksHydro: + icc-jobs: needs: Linter - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Sod test - run: | - cd $IDEFIX_DIR/test/HD/sod - ./testme.py -all $TESTME_OPTIONS - - name: Isothermal Sod test - run: | - cd $IDEFIX_DIR/test/HD/sod-iso - ./testme.py -all $TESTME_OPTIONS - - name: Mach reflection test - run: | - cd $IDEFIX_DIR/test/HD//MachReflection - ./testme.py -all $TESTME_OPTIONS + name: CPU Jobs (intel OneApi) + uses: ./.github/workflows/idefix-ci-jobs.yml + with: + TESTME_OPTIONS: -intel -Werror + IDEFIX_COMPILER: icc - ParabolicHydro: + gcc-jobs: needs: Linter - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Viscous flow past cylinder - run: | - cd $IDEFIX_DIR/test/HD/ViscousFlowPastCylinder - ./testme.py -all $TESTME_OPTIONS - - name: Viscous disk - run: | - cd $IDEFIX_DIR/test/HD/ViscousDisk - ./testme.py -all $TESTME_OPTIONS - - name: Thermal diffusion - run: | - cd $IDEFIX_DIR/test/HD/thermalDiffusion - ./testme.py -all $TESTME_OPTIONS + name: CPU Jobs (gcc) + uses: ./.github/workflows/idefix-ci-jobs.yml + with: + TESTME_OPTIONS: -Werror + IDEFIX_COMPILER: gcc - ShocksMHD: + cuda-jobs: needs: Linter - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: MHD Sod test - run: | - cd $IDEFIX_DIR/test/MHD/sod - ./testme.py -all $TESTME_OPTIONS - - name: MHD Isothermal Sod test - run: | - cd $IDEFIX_DIR/test/MHD/sod-iso - ./testme.py -all $TESTME_OPTIONS - - name: Orszag Tang - run: | - cd $IDEFIX_DIR/test/MHD/OrszagTang - ./testme.py -all $TESTME_OPTIONS - - name: Orszag Tang 3D+restart tests - run: | - cd $IDEFIX_DIR/test/MHD/OrszagTang3D - ./testme.py -all $TESTME_OPTIONS - - - ParabolicMHD: - needs: Linter - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Ambipolar C Shock - run: | - cd $IDEFIX_DIR/test/MHD/AmbipolarCshock - ./testme.py -all $TESTME_OPTIONS - - name: Ambipolar C Shock 3D - run: | - cd $IDEFIX_DIR/test/MHD/AmbipolarCshock3D - ./testme.py -all $TESTME_OPTIONS - - name: Resistive Alfvén wave - run: | - cd $IDEFIX_DIR/test/MHD/ResistiveAlfvenWave - ./testme.py -all $TESTME_OPTIONS - - name: Grid coarsening diffusion - run: | - cd $IDEFIX_DIR/test/MHD/Coarsening - ./testme.py -all $TESTME_OPTIONS - - name: Hall whistler waves - run: | - cd $IDEFIX_DIR/test/MHD/HallWhistler - ./testme.py -all $TESTME_OPTIONS - - Fargo: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Fargo + planet - run: | - cd $IDEFIX_DIR/test/HD/FargoPlanet - ./testme.py -all $TESTME_OPTIONS - - name: Fargo MHD spherical - run: | - cd $IDEFIX_DIR/test/MHD/FargoMHDSpherical - ./testme.py -all $TESTME_OPTIONS - - ShearingBox: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Hydro shearing box - run: | - cd $IDEFIX_DIR/test/HD/ShearingBox - ./testme.py -all $TESTME_OPTIONS - - name: MHD shearing box - run: | - cd $IDEFIX_DIR/test/MHD/ShearingBox - ./testme.py -all $TESTME_OPTIONS - - SelfGravity: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Jeans Instability - run: | - cd $IDEFIX_DIR/test/SelfGravity/JeansInstability - ./testme.py -all $TESTME_OPTIONS - - name: Random sphere spherical - run: | - cd $IDEFIX_DIR/test/SelfGravity/RandomSphere - ./testme.py -all $TESTME_OPTIONS - - name: Random sphere cartesian - run: | - cd $IDEFIX_DIR/test/SelfGravity/RandomSphereCartesian - ./testme.py -all $TESTME_OPTIONS - - name: Uniform spherical collapse - run: | - cd $IDEFIX_DIR/test/SelfGravity/UniformCollapse - ./testme.py -all $TESTME_OPTIONS - - name: Dusty spherical collapse - run: | - cd $IDEFIX_DIR/test/SelfGravity/DustyCollapse - ./testme.py -all $TESTME_OPTIONS - - Planet: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: 3 body - run: | - cd $IDEFIX_DIR/test/Planet/Planet3Body - ./testme.py -all $TESTME_OPTIONS - - name: migration - run: | - cd $IDEFIX_DIR/test/Planet/PlanetMigration2D - ./testme.py -all $TESTME_OPTIONS - - name: planet-planet - run: | - cd $IDEFIX_DIR/test/Planet/PlanetPlanetRK42D - ./testme.py -all $TESTME_OPTIONS - - name: spiral wake - run: | - cd $IDEFIX_DIR/test/Planet/PlanetSpiral2D - ./testme.py -all $TESTME_OPTIONS - - name: torques - run: | - cd $IDEFIX_DIR/test/Planet/PlanetTorque3D - ./testme.py -all $TESTME_OPTIONS - - name: RK5 - run: | - cd $IDEFIX_DIR/test/Planet/PlanetsIsActiveRK52D - ./testme.py -all $TESTME_OPTIONS - - Dust: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Energy conservation - run: | - cd $IDEFIX_DIR/test/Dust/DustEnergy - ./testme.py -all $TESTME_OPTIONS - - name: Dusty wave - run: | - cd $IDEFIX_DIR/test/Dust/DustyWave - ./testme.py -all $TESTME_OPTIONS - - Braginskii: - needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: MTI - run: | - cd $IDEFIX_DIR/test/MHD/MTI - ./testme.py -all $TESTME_OPTIONS - - name: Spherical anisotropic diffusion - run: | - cd $IDEFIX_DIR/test/MHD/sphBragTDiffusion - ./testme.py -all $TESTME_OPTIONS - - name: Spherical anisotropic viscosity - run: | - cd $IDEFIX_DIR/test/MHD/sphBragViscosity - ./testme.py -all $TESTME_OPTIONS - - Examples: - needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Run examples test - run: cd test && ./checks_examples.sh $TEST_OPTIONS - - Utils: - needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] - runs-on: self-hosted - steps: - - name: Check out repo - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Lookup table - run: | - cd $IDEFIX_DIR/test/utils/lookupTable - ./testme.py -all $TESTME_OPTIONS - - name: Dump Image - run: | - cd $IDEFIX_DIR/test/utils/dumpImage - ./testme.py -all $TESTME_OPTIONS + name: CUDA Jobs + uses: ./.github/workflows/idefix-ci-jobs.yml + with: + TESTME_OPTIONS: -cuda -Werror + IDEFIX_COMPILER: nvcc diff --git a/pytools/idfx_test.py b/pytools/idfx_test.py index dc2da0a0..25bac76b 100644 --- a/pytools/idfx_test.py +++ b/pytools/idfx_test.py @@ -58,6 +58,10 @@ def __init__ (self): help="Test on Nvidia GPU using CUDA", action="store_true") + parser.add_argument("-intel", + help="Test compiling with Intel OneAPI", + action="store_true") + parser.add_argument("-hip", help="Test on AMD GPU using HIP", action="store_true") @@ -119,6 +123,12 @@ def configure(self,definitionFile=""): # disable Async cuda malloc for tests performed on old UCX implementations comm.append("-DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF") + if self.intel: + # disable fmad operations on Cuda to make it compatible with CPU arithmetics + comm.append("-DIdefix_CXX_FLAGS=-fp-model=strict") + comm.append("-DCMAKE_CXX_COMPILER=icpx") + comm.append("-DCMAKE_C_COMPILER=icx") + if self.hip: comm.append("-DKokkos_ENABLE_HIP=ON") # disable fmad operations on HIP to make it compatible with CPU arithmetics diff --git a/scripts/ci/run-tests b/scripts/ci/run-tests new file mode 100755 index 00000000..32983102 --- /dev/null +++ b/scripts/ci/run-tests @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +if [ "$IDEFIX_COMPILER" == icc ]; then + source /opt/intel/oneapi/setvars.sh +fi +set -ue +cd "$1" +./testme.py "${@:2}"