DAMASK_EICMD/.github/workflows/Fortran.yml

167 lines
5.9 KiB
YAML
Raw Normal View History

2021-09-05 13:53:42 +05:30
name: Grid and Mesh Solver
2021-09-04 22:14:24 +05:30
on: [push]
env:
PETSC_VERSION: '3.20.5'
2021-12-12 03:38:18 +05:30
HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: 'ON'
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON'
HOMEBREW_NO_GITHUB_API: 'ON'
HOMEBREW_NO_INSTALL_CLEANUP: 'ON'
2021-09-04 22:14:24 +05:30
jobs:
2021-09-05 13:53:42 +05:30
gcc_ubuntu:
2021-09-05 13:53:42 +05:30
runs-on: ubuntu-22.04
2021-09-05 13:53:42 +05:30
2021-09-04 22:14:24 +05:30
strategy:
matrix:
2023-11-22 12:31:30 +05:30
gcc_v: [9, 10, 11, 12, 13]
fail-fast: false
2021-09-05 13:53:42 +05:30
2021-09-04 22:14:24 +05:30
env:
GCC_V: ${{ matrix.gcc_v }}
steps:
2021-09-05 13:53:42 +05:30
2022-11-02 20:24:48 +05:30
- uses: actions/checkout@v3
2021-09-04 22:14:24 +05:30
- name: GCC - Install
2021-09-04 22:14:24 +05:30
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} g++-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
2021-09-05 20:16:09 +05:30
- name: PETSc - Cache download
id: petsc-download
2022-11-02 20:24:48 +05:30
uses: actions/cache@v3
2021-09-05 20:16:09 +05:30
with:
path: download
2021-12-12 03:38:18 +05:30
key: petsc-${{ env.PETSC_VERSION }}.tar.gz
2021-09-05 20:16:09 +05:30
- name: PETSc - Download
if: steps.petsc-download.outputs.cache-hit != 'true'
run: |
2023-11-25 14:57:08 +05:30
wget -q https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-${PETSC_VERSION}.tar.gz -P download
2021-09-05 20:16:09 +05:30
- name: PETSc - Prepare
2021-09-04 22:14:24 +05:30
run: |
2021-12-12 03:38:18 +05:30
tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C .
export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION}
2021-09-04 22:14:24 +05:30
export PETSC_ARCH=gcc${GCC_V}
printenv >> $GITHUB_ENV
- name: PETSc - Cache Installation
2021-09-05 20:16:09 +05:30
id: petsc-install
2022-11-02 20:24:48 +05:30
uses: actions/cache@v3
2021-09-04 22:14:24 +05:30
with:
2021-12-12 03:38:18 +05:30
path: petsc-${{ env.PETSC_VERSION }}
key: petsc-${{ env.PETSC_VERSION }}-gcc${{ matrix.gcc_v }}-${{ hashFiles('**/petscversion.h') }}
2021-09-04 22:14:24 +05:30
- name: PETSc - Installation
2021-09-04 22:14:24 +05:30
run: |
2021-12-12 03:38:18 +05:30
cd petsc-${PETSC_VERSION}
2021-09-04 22:14:24 +05:30
./configure --with-fc=gfortran --with-cc=gcc --with-cxx=g++ \
--download-openmpi --download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib \
--with-mpi-f90module-visibility=1
2021-09-04 22:14:24 +05:30
make all
2021-09-05 20:16:09 +05:30
- name: DAMASK - Compile
2021-09-04 22:14:24 +05:30
run: |
cmake -B build/grid -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/grid --parallel
cmake --install build/grid
cmake -B build/mesh -DDAMASK_SOLVER=mesh -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/mesh --parallel
cmake --install build/mesh
2021-09-05 20:16:09 +05:30
- name: DAMASK - Run
2021-09-04 22:14:24 +05:30
run: |
2023-06-27 21:29:14 +05:30
./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -m material.yaml -w examples/grid
2024-01-04 11:43:49 +05:30
./bin/DAMASK_mesh -l tensionZ_3g.yaml -g cube_3grains.msh -m material.yaml -w examples/mesh
2021-09-04 22:14:24 +05:30
2021-09-04 22:14:24 +05:30
intel:
2021-09-05 13:53:42 +05:30
runs-on: ubuntu-22.04
2021-09-05 13:53:42 +05:30
2021-09-04 22:14:24 +05:30
strategy:
fail-fast: false
2021-09-05 13:53:42 +05:30
2021-09-04 22:14:24 +05:30
steps:
2022-11-02 20:24:48 +05:30
- uses: actions/checkout@v3
2021-09-04 22:14:24 +05:30
2021-09-05 20:16:09 +05:30
- name: Intel - Install
2021-09-04 22:14:24 +05:30
run: |
sudo apt-get remove -y \
'^aspnetcore-runtime.*' '^clang.*' '^dotnet.*' '^gfortran.*' '^mono.*' '^llvm.*' '^ruby.*' '^r-cran.*' '^r-base.*' '^dotnet.*' '^apache2.*'
sudo apt-get autoremove -y
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install \
intel-basekit \
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran \
intel-oneapi-openmp intel-oneapi-mkl-devel
source /opt/intel/oneapi/setvars.sh
2021-09-04 22:14:24 +05:30
printenv >> $GITHUB_ENV
- name: PETSc - Cache download
id: petsc-download
uses: actions/cache@v3
with:
path: download
key: petsc-${{ env.PETSC_VERSION }}.tar.gz
2021-09-05 20:16:09 +05:30
- name: PETSc - Download
if: steps.petsc-download.outputs.cache-hit != 'true'
2021-09-05 20:16:09 +05:30
run: |
2023-11-25 14:57:08 +05:30
wget -q https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-${PETSC_VERSION}.tar.gz -P download
2021-09-05 20:16:09 +05:30
- name: PETSc - Prepare
2021-09-04 22:14:24 +05:30
run: |
2021-12-12 03:38:18 +05:30
tar -xf download/petsc-${PETSC_VERSION}.tar.gz -C .
sed -i "1800s/if not os.path.isfile(os.path.join(self.packageDir,self.configureName)):/if True:/g" \
2022-11-03 13:50:14 +05:30
./petsc-${PETSC_VERSION}/config/BuildSystem/config/package.py
2021-12-12 03:38:18 +05:30
export PETSC_DIR=${PWD}/petsc-${PETSC_VERSION}
2023-11-20 21:17:39 +05:30
export PETSC_ARCH=intel
2021-09-04 22:14:24 +05:30
printenv >> $GITHUB_ENV
- name: PETSc - Cache installation
id: petsc-install
uses: actions/cache@v3
with:
path: petsc-${{ env.PETSC_VERSION }}
2023-11-20 21:17:39 +05:30
key: petsc-${{ env.PETSC_VERSION }}-intel-${{ hashFiles('**/petscversion.h') }}
2021-09-04 22:14:24 +05:30
2023-11-20 21:17:39 +05:30
- name: PETSc - Install
2021-09-04 22:14:24 +05:30
run: |
2021-12-12 03:38:18 +05:30
cd petsc-${PETSC_VERSION}
2022-10-13 15:35:43 +05:30
./configure \
2024-01-04 12:14:06 +05:30
--with-fc=mpiifx \
--with-cc=mpiicx \
--with-cxx=mpiicpx \
2021-10-08 19:35:36 +05:30
--download-fftw --download-hdf5 --download-hdf5-fortran-bindings=1 --download-zlib
2021-09-04 22:14:24 +05:30
make all
- name: DAMASK - Compile
run: |
2023-11-22 12:32:31 +05:30
cmake -B build/grid -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/grid --parallel
cmake --install build/grid
2023-11-22 12:32:31 +05:30
cmake -B build/mesh -DDAMASK_SOLVER=mesh -DCMAKE_INSTALL_PREFIX=${PWD}
cmake --build build/mesh --parallel
cmake --install build/mesh
2021-09-05 20:16:09 +05:30
- name: DAMASK - Run
2021-09-04 22:14:24 +05:30
run: |
2023-06-27 21:29:14 +05:30
./bin/DAMASK_grid -l tensionX.yaml -g 20grains16x16x16.vti -m material.yaml -w examples/grid
2024-01-04 11:43:49 +05:30
./bin/DAMASK_mesh -l tensionZ_3g.yaml -g cube_3grains.msh -m material.yaml -w examples/mesh