tester mpi_init action #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and run mpi init with ifx NCAR HPC Container | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - cirrus_actions | |
| jobs: | |
| mpi-init: | |
| strategy: | |
| fail-fast: false # This prevents the matrix from cancelling other jobs if one fails | |
| matrix: | |
| compiler: [gfortran, nvhpc, ifx] | |
| include: | |
| # Container image per compiler | |
| - compiler: gfortran | |
| container: docker.io/ncarcisl/hpcdev-x86_64:almalinux9-gcc-openmpi-latest | |
| - compiler: nvhpc | |
| container: docker.io/ncarcisl/hpcdev-x86_64:almalinux9-nvhpc-openmpi-latest | |
| - compiler: ifx | |
| container: docker.io/ncarcisl/hpcdev-x86_64:almalinux9-oneapi-openmpi-latest | |
| # Runner instance OS | |
| runs-on: | |
| group: cirrus-4x8 | |
| # The 'ncarcisl' containers initialize their software environment | |
| # through 'sourcing' a common configuration file (/container/config_env.sh). | |
| # This is done by starting a bash *login* shell (bash -l [...]) | |
| defaults: | |
| run: | |
| shell: bash -elo pipefail {0} | |
| # Deploy container on top of runner instance | |
| container: | |
| image: ${{ matrix.container }} | |
| steps: | |
| - name: Create mpi init program | |
| run: | | |
| echo 'program mpi_inits' > mpi_inits.f90 | |
| echo ' use mpi, only: MPI_Init, MPI_Finalize' >> mpi_inits.f90 | |
| echo ' implicit none' >> mpi_inits.f90 | |
| echo ' integer :: ierr' >> mpi_inits.f90 | |
| echo ' call MPI_Init(ierr)' >> mpi_inits.f90 | |
| echo ' print *, "Hello, World!"' >> mpi_inits.f90 | |
| echo ' call MPI_Finalize(ierr)' >> mpi_inits.f90 | |
| echo 'end program mpi_inits' >> mpi_inits.f90 | |
| - name: Compile program with ifx | |
| run: | | |
| source "/container/config_env.sh" | |
| which mpif90 | |
| case ${{ inputs.compiler }} in | |
| gfortran) | |
| mpif90 -g -Wuninitialized -Wunused -ffree-line-length-none -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow -o mpi_init mpi_inits.f90 | |
| ;; | |
| nvhpc) | |
| mpif90 -gopt -C -traceback -Ktrap=fp -Mbackslash -Kieee -o mpi_init mpi_inits.f90 | |
| ;; | |
| ifx) | |
| mpif90 -g -O0 -C -check noarg_temp_created -check nouninit -fpe0 -fp-model precise -ftrapuv -traceback -warn declarations,uncalled,unused -o mpi_init mpi_inits.f90 | |
| ;; | |
| *) | |
| echo "Unknown or unsupported compiler: ${{ inputs.compiler }}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Run hello world program | |
| run: | | |
| which mpirun | |
| mpirun -n 2 ./mpi_init |