diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index f21f77c9a6..f65f4e442d 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - + get_git_diff: runs-on: ubuntu-latest outputs: @@ -24,41 +24,201 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Get git diff + - name: Get git diff and determine whether to run testpackage id: gitdiff run: | cd $GITHUB_WORKSPACE #chmod +x ./.github/workflows/CI_git_diff.sh echo Comparing PR branch against ${{ github.base_ref }} - if [[ $(./.github/workflows/CI_git_diff.sh ${{ github.base_ref }} ) = "no_test" ]]; then + if [[ $(./.github/workflows/CI_git_diff.sh ${{ github.base_ref }} ) == "no_test" ]]; then echo "RUN_TP=False" >> $GITHUB_OUTPUT echo "Not running testpackage" exit 0 fi echo "Running testpackage" - get_git_diff_check: - runs-on: ubuntu-latest + + + testpackage: + strategy: &strategy + fail-fast: false + matrix: + include: + - name: prod + runner: hile #Tag of the github runner to run on + + arch: hile_gpu #Architecture flag + + compile_tp: false #Whether to compile with testpackage flag, can also add specific compile flags, see compile_flags_tp in slurm_run.sh + #otherwise will use prod flags + + run_tp: false #Whether to run the testpackage, note that the github ci + #testpackage has to be implemented for that platform + + debug: false #compile with debug flags, see compile_flags_prod and compile_flags_tp in slurm_run.sh + + - name: testpackage run + runner: hile + arch: hile_cpu + compile_tp: true + run_tp: true + debug: false + + # commented for now because why do we need this? + # - name: testpackage + # runner: ukko + # arch: ukko_dgx + # compile_tp: true + # run_tp: false + # debug: false + + - name: prod_WA_debug + runner: ukko + arch: ukko_dgx + compile_tp: false + run_tp: false + debug: true + + - name: testpackage_debug + runner: ukko + arch: ukko_dgx + compile_tp: true + run_tp: false + debug: true + + - name: testpackage run + runner: carrington + arch: carrington_gcc_openmpi + compile_tp: true + run_tp: true + debug: false + + - name: prod + runner: risc-v + arch: pioneer + compile_tp: false + run_tp: false + debug: false + + runs-on: ${{ matrix.runner }} needs: get_git_diff - if: ${{ needs.get_git_diff.outputs.RUN_TP != 'False' }} + if: github.repository_owner == 'fmihpc' + env: + VLASIATOR_ARCH: ${{ matrix.arch }} steps: - - name: Checking whether to run tests - run: | - echo "Running testpackage" - + #The & tags can be reused in other job steps with `- *tagname` scroll down for examples on how *checkoutSource has been used + - &checkoutSource + name: Checkout source + uses: actions/checkout@v4 + with: + submodules: true + - &cleanWorkspace + name: Clean workspace + run: | + ./.github/workflows/slurm_run.sh "CLEANUP" + git reset --hard HEAD #cleanup nukes testpackage folder, resetting here so things work again + - &makeClean + name: Make clean + run: make clean + - uses: ursg/gcc-problem-matcher@master + - &buildLibs + name: Run library build script ${{ matrix.arch }} + run: | + ./.github/workflows/slurm_run.sh "BUILD_LIBS" + - &packageLibraries + name: Packaging libraries + continue-on-error: true + run: tar -zcf libraries-${{ matrix.arch }}.tar.gz libraries-${{ matrix.arch }}/ + - &compileTP + name: Compile vlasiator (Testpackage build) + if: ${{ matrix.compile_tp }} + background: true + run: | + ./.github/workflows/slurm_run.sh "COMPILE_TP" ${{ matrix.debug }} + - &compileProd + name: Compile prod + if: ${{ ! matrix.compile_tp }} + background: true + run: | + ./.github/workflows/slurm_run.sh "COMPILE_PROD" ${{ matrix.debug }} + - &compileTools + name: Compile tools + background: true + run: | + ./.github/workflows/slurm_run.sh "BUILD_TOOLS" + - name: Wait for tools and tp to compile + wait-all: true + - &checkVlasiatorBinaryVisibility + name: Make sure the output binary is visible in lustre + uses: nick-fields/retry@v3 + with: + timeout_seconds: 15 + max_attempts: 3 + retry_on: error + command: ls vlasiator + - &runTP + name: Run TP + id: run + if: ${{ matrix.run_tp && matrix.compile_tp && needs.get_git_diff.outputs.RUN_TP != 'False' }} + run: | + ./.github/workflows/slurm_run.sh "RUN_TP" + - name: Scancel dangling job upon cancellation + if: cancelled() + run: | + # Try canceling with job name + scancel -n "CI_TP_${{ steps.run.outputs.TP_PID }}" --user $(whoami) + # Try accessing the job id echoed by the job script. + scancel ${{ steps.run.outputs.SLURM_JOB_ID }} + - &uploadTestpackageOutput + name: Upload testpackage output + continue-on-error: true + uses: actions/upload-artifact@v4 + if: always() + with: + name: testpackage-output + path: testpackage-output.tar.gz + - &fluxTest + name: Run fluxfunction test + if: ${{ matrix.run_tp }} + run: | + ./.github/workflows/slurm_run.sh "FLUXTEST" + - &uploadTools + name: Upload tools binaries + uses: actions/upload-artifact@v4 + with: + name: vlasiator-tools-${{ matrix.arch }} + path: | + vlsvextract_DP + vlsvdiff_DP + fluxfunction + if-no-files-found: error + - &uploadTP + name: Upload testpackage binary + uses: actions/upload-artifact@v4 + with: + name: vlasiator-testpackage + path: vlasiator + if-no-files-found: error + - &uploadLibs + name: Upload libraries as artifact + uses: actions/upload-artifact@v4 + with: + name: libraries-${{ matrix.arch }} + path: libraries-${{ matrix.arch }}.tar.gz + retention-days: 5 + if-no-files-found: error build_libraries_github: # Build libraries for the current version of the docker image # (to be used in any subsequent compilation and run jobs on said image) + runs-on: ubuntu-latest container: ursg/vlasiator_ci:20250909_1 steps: - uses: lukka/get-cmake@latest - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Install build dependencies + - *checkoutSource + - &githubLibs + name: Install build dependencies run: | apt-get update apt-get install -y g++ build-essential cmake make libopenmpi-dev openmpi-bin libboost-program-options-dev zstd @@ -74,80 +234,11 @@ jobs: retention-days: 5 if-no-files-found: error - build_libraries_hile-g: - # Build libraries for hile-g - # (to be used in any subsequent compilation and run jobs on hile-g) - runs-on: hile - # if: false - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Run library build script - run: srun --interactive -C g -J build_libs_hile-g -n 1 -c 16 bash -c "hostname ; realpath modules/modules.sh ; source modules/hile_gpu.sh ; ./fetch_and_build_libraries.sh hile_gpu" - - name: Build libraries tar - run: tar -zcf libraries-hile_gpu.tar.gz libraries-hile_gpu/ - - name: Upload libraries as artifact - uses: actions/upload-artifact@v4 - with: - name: libraries-hile_gpu - path: libraries-hile_gpu.tar.gz - retention-days: 5 - if-no-files-found: error - - build_libraries_ukkoGPU: - # Build libraries for the GPU builds on ukko below - runs-on: carrington - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Run library build script - run: srun --interactive --constraint="v100" --gres="gpu:V100" -p gpu -J build_libs -n 1 -c 64 bash -c "hostname ; realpath modules/modules.sh ; source modules/ukko_dgx.sh ; ./fetch_and_build_libraries.sh ukko_dgx" - - name: Build libraries tar - run: tar -zcf libraries-ukko_dgx.tar.gz libraries-ukko_dgx/ - - name: Upload libraries as artifact - uses: actions/upload-artifact@v4 - with: - name: libraries-ukko_dgx - path: libraries-ukko_dgx.tar.gz - retention-days: 5 - if-no-files-found: error - - build_libraries_carrington: - # Build libraries for the testpackage build and run on the carrington cluster (also, ukko CPU side) - runs-on: carrington - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Run library build script - run: srun --interactive --constraint "carrington|ukko" -J build_libs -n 1 -c 64 bash -c "hostname ; realpath modules/modules.sh ; ./fetch_and_build_libraries.sh carrington_gcc_openmpi" - - name: Build libraries tar - run: tar -zcf libraries-carrington_gcc_openmpi.tar.gz libraries-carrington_gcc_openmpi/ - - name: Upload libraries as artifact - uses: actions/upload-artifact@v4 - with: - name: libraries-carrington_gcc_openmpi - path: libraries-carrington_gcc_openmpi.tar.gz - retention-days: 5 - if-no-files-found: error - - build_libraries_arm64: - # Build libraries on macos with M1 hardware, to test both macOS and aarch64 compatibility + build_arm64: runs-on: ubuntu-24.04-arm steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true + - *checkoutSource - name: Install build dependencies run: | sudo apt-get update @@ -164,74 +255,24 @@ jobs: path: libraries-arm64.tar.zstd retention-days: 5 if-no-files-found: error - - build_libraries_riscv: - # Build libraries for the current version of the docker image - # (to be used in any subsequent compilation and run jobs on said image) - runs-on: risc-v - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Clean workspace - run: | - rm -rf libraries library-build libraries-pioneer.tar.gz - - name: Submit library job + - name: Make clean + run: VLASIATOR_ARCH=github_actions_arm64 make clean + - name: Compile vlasiator (Release build) run: | - srun --interactive -p pioneer -J vlasiator-libs -n 1 -c 64 -t 01:00:00 bash -lc 'hostname ; realpath modules/modules.sh ; source modules/pioneer.sh ; ./fetch_and_build_libraries.sh pioneer' - #ssh synth-hca 'source /etc/profile.d/lmod.sh; export PATH=$PATH:$HOME/bin; module load llvm/cross/EPI-0.7-development; cd '$GITHUB_WORKSPACE'; ./fetch_and_build_libraries.sh pioneer' - - name: Build libraries tar - run: tar -czvf libraries-pioneer.tar.gz libraries-pioneer/ - - name: Upload libraries as artifact - uses: actions/upload-artifact@v4 - with: - name: libraries-pioneer - path: libraries-pioneer.tar.gz - retention-days: 5 - if-no-files-found: error - - build_prod: - # Build Vlasiator with production flags - runs-on: ubuntu-latest - container: ursg/vlasiator_ci:20250909_1 - needs: build_libraries_github - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Download libraries - uses: actions/download-artifact@v5 - with: - name: libraries-docker - - name: Unpack libraries - run: tar --zstd -xf libraries-docker.tar.zstd - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Release build) - run: | - VLASIATOR_ARCH=github_actions make clean - VLASIATOR_ARCH=github_actions make -j 3 - - name: Upload release binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-release - path: vlasiator - if-no-files-found: error + VLASIATOR_ARCH=github_actions_arm64 make -j 4 - build_prod_ord1_time: - # Build Vlasiator with production flags + build_github: + strategy: + fail-fast: false + matrix: + compile_flags: ["prod","prod_debug","ord1_time","ord1_space"] runs-on: ubuntu-latest container: ursg/vlasiator_ci:20250909_1 needs: build_libraries_github - + env: + VLASIATOR_ARCH: github_actions steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true + - *checkoutSource - name: Download libraries uses: actions/download-artifact@v5 with: @@ -239,858 +280,39 @@ jobs: - name: Unpack libraries run: tar --zstd -xf libraries-docker.tar.zstd - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Release build) - run: | - VLASIATOR_ARCH=github_actions make clean - VLASIATOR_ARCH=github_actions COMPFLAGS="-DFS_1ST_ORDER_TIME" make -j 3 - - name: Upload release binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-1st_order_time - path: vlasiator - if-no-files-found: error - build_prod_ord1_space: - # Build Vlasiator with production flags - runs-on: ubuntu-latest - container: ursg/vlasiator_ci:20250909_1 - needs: build_libraries_github - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Download libraries - uses: actions/download-artifact@v5 - with: - name: libraries-docker - - name: Unpack libraries - run: tar --zstd -xf libraries-docker.tar.zstd - - uses: ursg/gcc-problem-matcher@master - name: Compile vlasiator (Release build) + shell: bash run: | - VLASIATOR_ARCH=github_actions make clean - VLASIATOR_ARCH=github_actions COMPFLAGS="-DFS_1ST_ORDER_SPACE" make -j 3 - - name: Upload release binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-1st_order_space - path: vlasiator - if-no-files-found: error - - build_prod_debug: - # Build Vlasiator with production flags and all the debug flags enabled to check the debug code is still ok - runs-on: ubuntu-latest - container: ursg/vlasiator_ci:20250909_1 - needs: build_libraries_github + make clean + compile_flag=${{ matrix.compile_flags }} + if [[ "$compile_flag" == "prod" ]]; then + make -j 3 + elif [[ "$compile_flag" == "ord1_time" ]]; then + COMPFLAGS="-DFS_1ST_ORDER_TIME" make -j 3 + elif [[ "$compile_flag" == "ord1_space" ]]; then + COMPFLAGS="-DFS_1ST_ORDER_SPACE" make -j 3 + elif [[ "$compile_flag" == "prod_debug" ]]; then + COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC" make -j 3 + else + echo "Unknown compile_flags entry: $compile_flag" + exit 1 + fi - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Download libraries - uses: actions/download-artifact@v5 - with: - name: libraries-docker - - name: Unpack libraries - run: tar --zstd -xf libraries-docker.tar.zstd - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Release, debug build) - run: | - VLASIATOR_ARCH=github_actions make clean - VLASIATOR_ARCH=github_actions COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC" make -j 3 - name: Upload release binary uses: actions/upload-artifact@v4 with: - name: vlasiator-debug - path: vlasiator - if-no-files-found: error - - build_TP: - # Build Vlasiator with testpackage flags, on the carrington cluster - # (for subsequent running of the integration test package) - runs-on: carrington - needs: build_libraries_carrington - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-carrington_gcc_openmpi.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint "carrington|ukko" bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-carrington_gcc_openmpi - - name: Unpack libraries - run: tar -zxf libraries-carrington_gcc_openmpi.tar.gz - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Testpackage build) - run: | - export VLASIATOR_ARCH=carrington_gcc_openmpi - srun --constraint "carrington|ukko" --job-name CI_tp_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=carrington_gcc_openmpi; source modules/modules.sh ; make -j 16 testpackage; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-testpackage - path: vlasiator - if-no-files-found: error - #- name: Upload build log - # uses: actions/upload-artifact@v4 - # with: - # name: Testpackage build log - # path: build.log - - build_TP_ukkoGPU: - # Build Vlasiator with testpackage flags, on the ukko cluster using - # its nvidia gpus - runs-on: carrington - needs: build_libraries_ukkoGPU - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-ukko_dgx.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint ukko bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=ukko_dgx make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-ukko_dgx - - name: Unpack libraries - run: tar -zxf libraries-ukko_dgx.tar.gz - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Testpackage build w/ CUDA) - run: | - export VLASIATOR_ARCH=ukko_dgx - srun --constraint="ukko" -p gpu --job-name CI_tp_compile --interactive --nodes=1 -n 1 -c 8 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=ukko_dgx ; source modules/modules.sh ; make -j 9 testpackage; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-testpackage-ukkoGPU - path: vlasiator - if-no-files-found: error - - build_TP_HILE-G: - # Build Vlasiator with testpackage flags, on the HILE cluster using - # its AMD gpus - runs-on: hile - # if: false - needs: build_libraries_hile-g - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-hile_gpu.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun -C g bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=hile_gpu make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-hile_gpu - - name: Unpack libraries - run: tar -zxf libraries-hile_gpu.tar.gz - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Testpackage build w/ HIP) - run: | - srun -C g --job-name CI_tp_G_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=hile_gpu ; source modules/modules.sh ; make -j 16 testpackage; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-testpackage-HILE-G - path: vlasiator - if-no-files-found: error - - # build_prod_debug_HILE-G: # TODO: activate debug flags once that's supported on HILE, still doing regular production compilation. - build_prod_HILE-G: - # Build Vlasiator with production flags and all the debug flags enabled, on the HILE cluster using - # its AMD gpus - runs-on: hile - # if: false - needs: build_libraries_hile-g - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-hile_gpu.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun -C g bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=hile_gpu make clean - - uses: ursg/gcc-problem-matcher@master - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-hile_gpu - - name: Unpack libraries - run: tar -zxf libraries-hile_gpu.tar.gz - - - name: Compile vlasiator (Release, debug build w/ HIP) - run: | - # srun -C g --job-name CI_debug_G_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'module load papi; module load rocm/6.2.0; module load cray-pmi; module load craype-accel-amd-gfx90a; module load libfabric/1.22.0; export MPICH_GPU_SUPPORT_ENABLED=1; export VLASIATOR_ARCH=hile_gpu; make COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC " -j 16; sleep 10s' - srun -C g --job-name CI_debug_G_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=hile_gpu ; source modules/modules.sh ; make -j 16; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-debug-HILE-G - path: vlasiator - if-no-files-found: error - - build_TP_HILE-C: - # Build Vlasiator with testpackage flags, on the HILE cluster using - # its CPUs - # NOTE doesn't fetch and unpack libraries at the moment - runs-on: hile - # if: false - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-hile_cpu.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun -C c bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=hile_cpu make clean - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Testpackage build w/ HIP) - run: | - srun -C c --job-name CI_tp_C_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=hile_cpu ; source modules/modules.sh ; make -j 16 testpackage; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-testpackage-HILE-C - path: vlasiator - if-no-files-found: error - - # build_prod_debug_HILE-C: # TODO: activate debug flags once that's supported on HILE, still doing regular production compilation. - build_prod_HILE-C: - # Build Vlasiator with production flags and all the debug flags enabled, on the HILE cluster using - # its CPUs - # NOTE doesn't fetch and unpack libraries at the moment - runs-on: hile - # if: false - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-hile_cpu.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun -C c bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=hile_cpu make clean - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Release, debug build w/ HIP) - run: | - # srun -C c --job-name CI_debug_C_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'module load papi; module load cray-pmi; module load libfabric/1.22.0; export VLASIATOR_ARCH=hile_cpu; make COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC " -j 16; sleep 10s' - srun -C c --job-name CI_debug_C_compile --interactive --nodes=1 -n 1 -c 16 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=hile_cpu ; source modules/modules.sh ; make -j 16; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-debug-HILE-C - path: vlasiator - if-no-files-found: error - - build_TP_debug_ukkoGPU: - # Build Vlasiator with testpackage and debug flags, on the ukko cluster using - # its nvidia gpus - runs-on: carrington - needs: build_libraries_ukkoGPU - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-ukko_dgx.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint="ukko" bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=ukko_dgx make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-ukko_dgx - - name: Unpack libraries - run: tar -zxf libraries-ukko_dgx.tar.gz - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Testpackage build w/ CUDA, debug) - run: | - export VLASIATOR_ARCH=ukko_dgx - srun --constraint="ukko" -p gpu --job-name CI_dbg_compile --interactive --nodes=1 -n 1 -c 8 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=ukko_dgx ; source modules/modules.sh ; COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DHASHINATOR_DEBUG -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC " make -j 9 testpackage ; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload testpackage debug binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-testpackage-debug-ukkoGPU - path: vlasiator - if-no-files-found: error - - build_prod_debug_WA_ukkoGPU: - # Build Vlasiator with production, debug, and warp accessor flags, on the ukko cluster using - # its nvidia gpus. - runs-on: carrington - needs: build_libraries_ukkoGPU - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-ukko_dgx.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint="ukko" bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=ukko_dgx make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-ukko_dgx - - name: Unpack libraries - run: tar -zxf libraries-ukko_dgx.tar.gz - - uses: ursg/gcc-problem-matcher@master - - name: Compile vlasiator (Production build w/ CUDA, debug, WA) - run: | - export VLASIATOR_ARCH=ukko_dgx - srun --constraint="ukko" -p gpu --job-name CI_tp_compile --interactive --nodes=1 -n 1 -c 8 --mem-per-cpu=2G -t 0:20:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=ukko_dgx ; source modules/modules.sh ; COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DHASHINATOR_DEBUG -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC -DUSE_WARPACCESSORS " make -j 9 ; sleep 10s' - - name: Make sure the output binary is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls vlasiator - - name: Upload production debug warp accessor binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-production-debug-WA-ukkoGPU - path: vlasiator - if-no-files-found: error - - build_riscv: - runs-on: risc-v - needs: build_libraries_riscv - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Clean workspace - run: | - rm -rf libraries library-build libraries-pioneer.tar.gz - rm -f stdout.txt stderr.txt metrics.txt - rm -f *.xml - - name: Download libraries - uses: actions/download-artifact@v5 - with: - name: libraries-pioneer - - name: Unpack libraries - run: tar -xzvf libraries-pioneer.tar.gz - - name: Make clean - run: VLASIATOR_ARCH=pioneer make clean - - name: Compile vlasiator (RISC-V) - run: | - srun --interactive -p pioneer -J vlasiator_build -n 1 -c 64 --pty -t 01:00:00 bash -lc 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=pioneer ; source modules/modules.sh ; make -j64' - #ssh synth-hca 'source /etc/profile.d/lmod.sh; export PATH=$PATH:$HOME/bin; module load llvm/cross/EPI-0.7-development; export VLASIATOR_ARCH=pioneer; cd '$GITHUB_WORKSPACE'; make -j 12' - - name: Upload riscv binary - uses: actions/upload-artifact@v4 - with: - name: vlasiator-riscv + name: vlasiator-${{ matrix.compile_flags }} path: vlasiator if-no-files-found: error - build_arm64: - runs-on: ubuntu-24.04-arm - needs: build_libraries_arm64 - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Install boost - run: | - sudo apt-get update - sudo apt-get install -y g++ build-essential cmake make libopenmpi-dev openmpi-bin libboost-program-options-dev zstd - - name: Download libraries - uses: actions/download-artifact@v5 - with: - name: libraries-arm64 - - name: Unpack libraries - run: tar --zstd -xf libraries-arm64.tar.zstd - - name: Make clean - run: VLASIATOR_ARCH=github_actions_arm64 make clean - - name: Compile vlasiator (Release build) - run: | - VLASIATOR_ARCH=github_actions_arm64 make -j 4 - - build_tools: - # Build vlsvdiff, vlsvextract, and fluxfunction for testpackage use - runs-on: carrington - needs: build_libraries_carrington - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-carrington_gcc_openmpi.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint "carrington|ukko" bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - uses: ursg/gcc-problem-matcher@master - - name: Make clean - run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-carrington_gcc_openmpi - - name: Unpack libraries - run: tar -zxf libraries-carrington_gcc_openmpi.tar.gz - - name: Compile tools - run: | - export VLASIATOR_ARCH=carrington_gcc_openmpi - srun --constraint "carrington|ukko" --job-name CI_tools_compile --interactive --nodes=1 -n 1 -c 1 --mem=4G -p short -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=carrington_gcc_openmpi ; source modules/modules.sh ; make vlsvextract vlsvdiff fluxfunction' - - name: Upload tools binaries - uses: actions/upload-artifact@v4 - with: - name: vlasiator-tools - path: | - vlsvextract_DP - vlsvdiff_DP - fluxfunction - if-no-files-found: error - - build_tools_ukkoGPU: - # Build vlsvdiff and vlsvextract for testpackage use - runs-on: carrington - needs: build_libraries_ukkoGPU - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-ukko_dgx.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun --constraint ukko bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - uses: ursg/gcc-problem-matcher@master - - name: Make clean - run: VLASIATOR_ARCH=ukko_dgx make clean - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-ukko_dgx - - name: Unpack libraries - run: tar -zxf libraries-ukko_dgx.tar.gz - - name: Compile tools - run: | - export VLASIATOR_ARCH=ukko_dgx - srun --constraint="ukko" -p gpu --job-name CI_tools_compile --interactive --nodes=1 -n 1 -c 1 --mem-per-cpu=2G -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=ukko_dgx ; source modules/modules.sh ; make vlsvextract vlsvdiff; sleep 10s' - - name: Upload tools binaries - uses: actions/upload-artifact@v4 - with: - name: vlasiator-tools-ukkoGPU - path: | - vlsvextract_DP - vlsvdiff_DP - if-no-files-found: error - - build_tools_HILE-C: - # Build vlsvdiff and vlsvextract for testpackage use - # NOTE is lacking libraries at the moment - runs-on: hile - # if: false - - steps: - - name: Clean workspace - run: | - RUN_STRING=$( cat << MORO - rm -rf libraries library-build testpackage - rm -f libraries-hile_cpu.tar.gz testpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt - rm -f *.xml - MORO - ) - srun -C c bash -c "$RUN_STRING" - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - name: Make clean - run: VLASIATOR_ARCH=hile_cpu make clean - - uses: ursg/gcc-problem-matcher@master - - name: Compile tools - run: | - srun -C c --job-name CI_tools_HILE-C_compile --interactive --nodes=1 -n 1 -c 1 --mem-per-cpu=2G -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; export VLASIATOR_ARCH=hile_cpu ; source modules/modules.sh ; make vlsvextract vlsvdiff fluxfunction; sleep 10s' - - name: Upload tools binaries - uses: actions/upload-artifact@v4 - with: - name: vlasiator-tools-HILE-C - path: | - vlsvextract_DP - vlsvdiff_DP - fluxfunction - if-no-files-found: error - - run_TP: - # Run the testpackage on the carrington cluster - runs-on: carrington - needs: [build_TP, build_tools, get_git_diff_check, build_libraries_carrington] - - continue-on-error: true - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: false - - name: Download testpackage binary - uses: actions/download-artifact@v5 - with: - name: vlasiator-testpackage - - name: Download tools - uses: actions/download-artifact@v5 - with: - name: vlasiator-tools - - name: Fetch libraries - uses: actions/download-artifact@v5 - with: - name: libraries-carrington_gcc_openmpi - - name: Unpack libraries - run: tar -zxf libraries-carrington_gcc_openmpi.tar.gz - - name: Run testpackage - id: run - run: | - chmod +x $GITHUB_WORKSPACE/vlasiator - chmod +x $GITHUB_WORKSPACE/vlsv*_DP - cd testpackage - # Delete any old run directories - rm -rf run_20* - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-carrington_gcc_openmpi/lib - sbatch -W -o testpackage_run_output.txt ./small_test_carrington_github_ci.sh || true - PARSE_OUTPUT_CMD=$( cat << MORO - echo "Job finished, checking output." - cat testpackage_run_output.txt - cat $GITHUB_STEP_SUMMARY > $GITHUB_WORKSPACE/testpackage_check_description.txt - cd $GITHUB_WORKSPACE - ls -halB testpackage_check_description.txt - tar -czf testpackage-output.tar.gz testpackage_check_description.txt testpackage_output_variables.txt - MORO - ) - srun --job-name CI_package_results --constraint "carrington|ukko" -N 1 -c 1 --mem=3G bash -c "$PARSE_OUTPUT_CMD" - if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then - # Fail this step if any test failed. - exit 1 - fi - - name: Scancel dangling job upon cancellation - if: cancelled() - run: | - # Try accessing the job id echoed by the job script. - scancel ${{ steps.run.outputs.SLURM_JOB_ID }} - - name: Make sure the output tarball is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls $GITHUB_WORKSPACE/testpackage-output.tar.gz - - name: Upload testpackage output - uses: actions/upload-artifact@v4 - if: always() - with: - name: testpackage-output - path: testpackage-output.tar.gz - # Note: Testpackage output is further processed in the pr_report.yml workflow - # (to produce Checks against pull requests) - - name: Run fluxfunction test - run: | - chmod +x $GITHUB_WORKSPACE/fluxfunction - srun --job-name fluxtest --constraint "carrington|ukko" -N 1 -c 1 --mem=1G bash -c "hostname ; realpath modules/modules.sh ; source modules/carrington_gcc_openmpi.sh ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_small/bulk.0000001.vlsv equatorial.bin" - srun --job-name fluxtest --constraint "carrington|ukko" -N 1 -c 1 --mem=1G bash -c "hostname ; realpath modules/modules.sh ; source modules/carrington_gcc_openmpi.sh ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_polar_small/bulk.0000001.vlsv polar.bin" - diff -q equatorial.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/equatorial.bin || if [ $? -eq 1 ] ; then true; else false; fi - diff -q polar.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/polar.bin || if [ $? -eq 1 ] ; then true; else false; fi - - run_TP_HILE-C: - # Run the testpackage on the HILE-C cluster - runs-on: hile - needs: [build_TP_HILE-C, build_tools_HILE-C, get_git_diff_check] - continue-on-error: true - - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: false - - name: Download testpackage binary - uses: actions/download-artifact@v4 - with: - name: vlasiator-testpackage-HILE-C - - name: Download tools - uses: actions/download-artifact@v4 - with: - name: vlasiator-tools-HILE-C - - name: Run testpackage - id: run - run: | - chmod +x $GITHUB_WORKSPACE/vlasiator - chmod +x $GITHUB_WORKSPACE/vlsv*_DP - cd testpackage - # Delete any old run directories - rm -rf run_20* - # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-hile_cpu/lib - sbatch -W -o testpackage_run_output.txt ./small_test_hile_cpu_github_ci.sh - PARSE_OUTPUT_CMD=$( cat << MORO - echo "Job finished, checking output." - cat testpackage_run_output.txt - cat $GITHUB_STEP_SUMMARY > $GITHUB_WORKSPACE/testpackage_check_description.txt - cd $GITHUB_WORKSPACE - ls -halB testpackage_check_description.txt - tar -czf testpackage-output-HILE-C.tar.gz testpackage_check_description.txt testpackage_output_variables.txt - MORO - ) - srun --job-name CI_package_results -C c -N 1 -c 1 --mem=1G bash -c "$PARSE_OUTPUT_CMD" - if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then - # Fail this step if any test failed. - exit 1 - fi - - name: Scancel dangling job upon cancellation - if: cancelled() - run: | - # Try accessing the job id echoed by the job script. - scancel ${{ steps.run.outputs.SLURM_JOB_ID }} - - name: Make sure the output tarball is visible in lustre - uses: nick-fields/retry@v3 - with: - timeout_seconds: 15 - max_attempts: 3 - retry_on: error - command: ls $GITHUB_WORKSPACE/testpackage-output-HILE-C.tar.gz - - name: Upload testpackage output - uses: actions/upload-artifact@v4 - if: always() - with: - name: testpackage-output-HILE-C - path: testpackage-output-HILE-C.tar.gz - # Note: Testpackage output is further processed in the pr_report_HILE_C.yml workflow - # (to produce Checks against pull requests) - - name: Run fluxfunction test - run: | - chmod +x $GITHUB_WORKSPACE/fluxfunction - srun -C c --job-name fluxtest --nodes=1 -n 1 -c 1 --mem-per-cpu=2G -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; source modules/hile_cpu.sh ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_small/bulk.0000001.vlsv equatorial.bin' - srun -C c --job-name fluxtest --nodes=1 -n 1 -c 1 --mem-per-cpu=2G -t 0:10:0 bash -c 'hostname ; realpath modules/modules.sh ; source modules/hile_cpu.sh ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_polar_small/bulk.0000001.vlsv polar.bin' - diff -q equatorial.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/equatorial.bin || if [ $? -eq 1 ] ; then true; else false; fi - diff -q polar.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/polar.bin || if [ $? -eq 1 ] ; then true; else false; fi - - # run_TP_ukkoGPU: - # # Run the testpackage on the Ukko GPU cluster (via Carrington frontend) - # runs-on: carrington - # needs: [build_TP_ukkoGPU, build_tools_ukkoGPU, build_libraries_ukkoGPU] - # continue-on-error: true - - # steps: - # - name: Checkout source - # uses: actions/checkout@v4 - # with: - # submodules: false - # - name: Download testpackage binary - # uses: actions/download-artifact@v5 - # with: - # name: vlasiator-testpackage-ukkoGPU - # - name: Download tools - # uses: actions/download-artifact@v5 - # with: - # name: vlasiator-tools-ukkoGPU - # - name: Fetch libraries - # uses: actions/download-artifact@v5 - # with: - # name: libraries-ukko_dgx - # - name: Unpack libraries - # run: tar -zxf libraries-ukko_dgx.tar.gz - # - name: Run GPU testpackage - # id: run - # run: | - # chmod +x $GITHUB_WORKSPACE/vlasiator - # chmod +x $GITHUB_WORKSPACE/vlsv*_DP - # cd testpackage - # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-ukko_dgx/lib - # sbatch -W -o testpackage_run_output.txt ./small_test_ukko_dgx_github_ci.sh - # PARSE_OUTPUT_CMD=$( cat << MORO - # echo "Job finished, checking output." - # cat testpackage_run_output.txt - # cat $GITHUB_STEP_SUMMARY > $GITHUB_WORKSPACE/testpackage_check_description.txt - # cd $GITHUB_WORKSPACE - # ls -halB testpackage_check_description.txt - # tar -czf testpackage-output-ukkoGPU.tar.gz testpackage_check_description.txt testpackage_output_variables.txt - # MORO - # ) - # srun --job-name CI_package_results --constraint="ukko" -N 1 -c 1 --mem=1G bash -c "$PARSE_OUTPUT_CMD" - # if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then - # # Fail this step if any test failed. - # exit 1 - # fi - # - name: Scancel dangling job upon cancellation - # if: cancelled() - # run: | - # # Try accessing the job id echoed by the job script. - # scancel ${{ steps.run.outputs.SLURM_JOB_ID }} - # - name: Make sure the output tarball is visible in lustre - # uses: nick-fields/retry@v3 - # with: - # timeout_seconds: 15 - # max_attempts: 3 - # retry_on: error - # command: ls $GITHUB_WORKSPACE/testpackage-output-ukkoGPU.tar.gz - # - name: Upload testpackage output - # uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: testpackage-output-ukkoGPU - # path: testpackage-output-ukkoGPU.tar.gz - # # Note: Testpackage output is further processed in the pr_report.yml workflow - # # (to produce Checks against pull requests) - - build_ionosphereTests: + ionosphereTests_github: # Build IonosphereSolverTests miniApp runs-on: ubuntu-latest container: ursg/vlasiator_ci:20250909_1 needs: build_libraries_github steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - # - name: Download libraries - # uses: actions/download-artifact@v5 - # with: - # name: libraries - # - name: Unpack libraries - # run: tar --zstd -xf libraries.tar.zstd - # - uses: ursg/gcc-problem-matcher@master + - *checkoutSource - name: Download libraries uses: actions/download-artifact@v5 with: @@ -1110,20 +332,6 @@ jobs: mini-apps/ionosphereSolverTests/differentialFlux mini-apps/ionosphereSolverTests/sigmaProfiles if-no-files-found: error - - run_ionosphere_LFMtest: - runs-on: ubuntu-latest - container: ursg/vlasiator_ci:20250909_1 - needs: [build_ionosphereTests, get_git_diff_check] - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: false - - name: Download ionosphereTests - uses: actions/download-artifact@v5 - with: - name: ionosphereTests - name: Set up Python uses: actions/setup-python@v3 - name: Install uv @@ -1132,7 +340,7 @@ jobs: run: | apt update apt -y install gnuplot-nox - - name: checkout Analysator + - name: checkout & install Analysator run: | cd mini-apps/ionosphereSolverTests/ git clone https://github.com/fmihpc/analysator @@ -1142,9 +350,9 @@ jobs: uv pip install --editable analysator - name: Run LFMtest run: | - chmod +x $GITHUB_WORKSPACE/main + chmod +x $GITHUB_WORKSPACE/mini-apps/ionosphereSolverTests/main cd mini-apps/ionosphereSolverTests/ - OMP_NUM_THREADS=1 $GITHUB_WORKSPACE/main -N 2000 -r 40 90 -r 50 90 -r 60 80 -sigma 10 -fac merkin2010 -gaugeFix equator45 -o LFMtest.vlsv -maxIter 10000 + OMP_NUM_THREADS=1 ./main -N 2000 -r 40 90 -r 50 90 -r 60 80 -sigma 10 -fac merkin2010 -gaugeFix equator45 -o LFMtest.vlsv -maxIter 10000 export TMPDIR=$RUNNER_TEMP . CI_env/bin/activate export PTNONINTERACTIVE=1 @@ -1152,11 +360,11 @@ jobs: ./plot_LFMtest.gp - name: Run atmospheric profile test run: | - chmod +x $GITHUB_WORKSPACE/sigmaProfiles + chmod +x $GITHUB_WORKSPACE/mini-apps/ionosphereSolverTests/sigmaProfiles cd mini-apps/ionosphereSolverTests/ - $GITHUB_WORKSPACE/sigmaProfiles 1e6 1.16046e7 > atmosphere.dat - $GITHUB_WORKSPACE/sigmaProfiles 1e6 1.16046e8 > atmosphere10.dat - $GITHUB_WORKSPACE/sigmaProfiles 1e6 1.16046e9 > atmosphere100.dat + ./sigmaProfiles 1e6 1.16046e7 > atmosphere.dat + ./sigmaProfiles 1e6 1.16046e8 > atmosphere10.dat + ./sigmaProfiles 1e6 1.16046e9 > atmosphere100.dat ./plotAtmosphere.gp - name: Upload ionosphereTest result images uses: actions/upload-artifact@v4 @@ -1170,7 +378,7 @@ jobs: check_cfg_files: runs-on: ubuntu-latest container: ursg/vlasiator_ci:20250909_1 - needs: [build_libraries_github, build_prod] + needs: build_github steps: - name: Checkout source uses: actions/checkout@v4 @@ -1185,15 +393,17 @@ jobs: - name: Download release binary uses: actions/download-artifact@v5 with: - name: vlasiator-release - - name: Make release binary executable + name: vlasiator-prod + - name: Ensure the binary is executable run: | chmod +x $GITHUB_WORKSPACE/vlasiator - name: Check cfg files in projects/ - run: | + env: + CFGFOLDER: projects + run: &checkCfg | retval=0 set +e - for cfg in `find projects -name \*.cfg`; do + for cfg in `find $CFGFOLDER -name \*.cfg`; do echo -n "Testing cfg file $cfg... " PRINT_ONLY_ERRORS=true LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-docker/lib tools/check_vlasiator_cfg.sh $GITHUB_WORKSPACE/vlasiator $cfg 2>&1 > cfgtest.out if [ $? != 0 ]; then @@ -1210,34 +420,11 @@ jobs: done exit $retval - name: Check cfg files in samples/ - run: | - retval=0 - set +e - for cfg in `find samples -name \*.cfg`; do - echo -n "Testing cfg file $cfg... " - PRINT_ONLY_ERRORS=true LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-docker/lib tools/check_vlasiator_cfg.sh $GITHUB_WORKSPACE/vlasiator $cfg 2>&1 > cfgtest.out - if [ $? != 0 ]; then - echo "FAILED:"; - cat cfgtest.out; - retval=127 - else - echo "ok." - fi; - done - exit $retval + env: + CFGFOLDER: samples + run: *checkCfg - name: Check cfg files in testpackage/ - run: | - retval=0 - set +e - for cfg in `find testpackage -name \*.cfg`; do - echo -n "Testing cfg file $cfg... " - PRINT_ONLY_ERRORS=true LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries-docker/lib tools/check_vlasiator_cfg.sh $GITHUB_WORKSPACE/vlasiator $cfg 2>&1 > cfgtest.out - if [ $? != 0 ]; then - echo "FAILED:"; - cat cfgtest.out; - retval=127 - else - echo "ok." - fi; - done - exit $retval + env: + CFGFOLDER: testpackage + run: *checkCfg + diff --git a/.github/workflows/slurm_run.sh b/.github/workflows/slurm_run.sh new file mode 100755 index 0000000000..386d71d8b7 --- /dev/null +++ b/.github/workflows/slurm_run.sh @@ -0,0 +1,162 @@ +#!/usr/bin/env bash + +#This will echo the bash commands in the github view +set -x + +if [[ -z $VLASIATOR_ARCH ]]; then + echo "VLASIATOR_ARCH not set!" + exit 1 +fi + +#Flags for core/node counts etc for compiling/heavier srun calls +declare -A core_flags +core_flags["carrington_gcc_openmpi"]="-n 1 -c 16" +core_flags["ukko_dgx"]="-n 1 -c 64" +core_flags["pioneer"]="-n 1 -c 64" +core_flags["hile_gpu"]="-n 1 -c 16" +core_flags["hile_cpu"]="-n 1 -c 16" + +#Constraints for compiling stuff +declare -A constraint +constraint["carrington_gcc_openmpi"]="--constraint=ukko|carrington -p short" +# constraint["ukko_dgx"]="--constraint="v100" -gres="gpu:V100" -p gpu" +constraint["ukko_dgx"]="--constraint=ukko -p gpu" +constraint["pioneer"]="--constraint=pioneer -p pioneer" #not sure if pty needed for pioneer +constraint["hile_gpu"]="-C g" +constraint["hile_cpu"]="-C c" + +#Constraints used for smaller jobs like compiling/removing files/catting etc +declare -A constraint_small +constraint_small["carrington_gcc_openmpi"]="--constraint=ukko|carrington" +constraint_small["ukko_dgx"]="--constraint=ukko" +constraint_small["pioneer"]="--constraint=pioneer" +constraint_small["hile_gpu"]="-C g" +constraint_small["hile_cpu"]="-C c" + +#Memory flags for compiling, note that with --exclusive it is better to use --mem since --mem-per-cpu counts the whole node apparently +declare -A mem_flags + +#Could be unified with core_flags but it's nice to have them here separately and maybe this separation has a future use +mem_flags["carrington_gcc_openmpi"]="--mem=40G" +mem_flags["ukko_dgx"]="--mem=64G" +mem_flags["pioneer"]="" +mem_flags["hile_gpu"]="--mem=32G" +mem_flags["hile_cpu"]="--mem=32G" + +#Production compile flags +declare -A compile_flags_prod +declare -A compile_flags_tp + +#This is for `debug: true` entry in workflow +if [[ $2 == "true" ]]; then + #testpackage/debug compile flags + compile_flags_prod["ukko_dgx"]='COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DHASHINATOR_DEBUG -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC "' + compile_flags_tp["ukko_dgx"]='COMPFLAGS="-DDEBUG_VLASIATOR -DDEBUG_SOLVERS -DDEBUG_IONOSPHERE -DHASHINATOR_DEBUG -DDEBUG_SPATIAL_CELL -DDEBUG_VMESH -DDEBUG_VBC -DDEBUG_ACC -DUSE_WARPACCESSOR "' +fi +#Module load part +modules="hostname; realpath modules/modules.sh; source modules/$VLASIATOR_ARCH.sh" + +#--------------------------------different srun calls------------------------------ + +#0++++++++++++++++++++++++++++++0 +#| CLEANUP | +#0++++++++++++++++++++++++++++++0 +if [[ $1 == "CLEANUP" ]]; then + CLEAN_STRING=$( + cat <> $GITHUB_OUTPUT + sbatch -W -o testpackage_run_output.txt -J "CI_TP_$$" ./small_test_${VLASIATOR_ARCH}_github_ci.sh || true + PARSE_OUTPUT_CMD=$( + cat < $GITHUB_WORKSPACE/testpackage_check_description.txt +cd $GITHUB_WORKSPACE +ls -halB testpackage_check_description.txt +tar -czf testpackage-output-$VLASIATOR_ARCH.tar.gz testpackage_check_description.txt testpackage_output_variables.txt +MORO + ) + srun --job-name CI_package_results ${constraint_small[$VLASIATOR_ARCH]} -N 1 -c 1 --mem=3G bash -c "$PARSE_OUTPUT_CMD" + if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then + # Fail this step if any test failed. + exit 1 + fi + else + echo "RUN_TP for $VLASIATOR_ARCH not implemented" + exit 1 + fi +fi + +#0++++++++++++++++++++++++++++++0 +#| RUN FLUXTEST | +#0++++++++++++++++++++++++++++++0 +if [[ $1 == "FLUXTEST" ]]; then + FLUXTEST_STRING="$modules ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_small/bulk.0000001.vlsv equatorial.bin ; $GITHUB_WORKSPACE/fluxfunction testpackage/run_*/Magnetosphere_polar_small/bulk.0000001.vlsv polar.bin" + chmod +x $GITHUB_WORKSPACE/fluxfunction + srun ${constraint_small[$VLASIATOR_ARCH]} --job-name CI_FLUXTEST -N 1 -c 1 --mem=2G -t 0:10:0 bash -c "$FLUXTEST_STRING" + + diff -q equatorial.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/equatorial.bin || if [ $? -eq 1 ]; then true; else false; fi + diff -q polar.bin /turso/group/spacephysics/vlasiator/testpackage/CI_reference/polar.bin || if [ $? -eq 1 ]; then true; else false; fi +fi diff --git a/MAKE/Makefile.hile_cpu b/MAKE/Makefile.hile_cpu index 8cc774736d..e1bd790359 100644 --- a/MAKE/Makefile.hile_cpu +++ b/MAKE/Makefile.hile_cpu @@ -71,7 +71,7 @@ testpackage: CXXFLAGS += -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE #======== Libraries =========== -LIBRARY_PREFIX = /turso/group/spacephysics/vlasiator/libraries/libraries-hile_cpu +LIBRARY_PREFIX = $(CURDIR)/libraries-hile_cpu # System boost LIB_BOOST = -lboost_program_options -L/usr/lib64 -Wl,-rpath=/usr/lib64 diff --git a/testpackage/small_test_carrington_github_ci.sh b/testpackage/small_test_carrington_gcc_openmpi_github_ci.sh similarity index 100% rename from testpackage/small_test_carrington_github_ci.sh rename to testpackage/small_test_carrington_gcc_openmpi_github_ci.sh