Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] New compilation options #11790

Merged
merged 42 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
68b89bd
Adding core and dep exclusions
roigcarlo Nov 2, 2023
37f66cf
Split build script
roigcarlo Nov 2, 2023
013300a
Adding new CI rules
roigcarlo Nov 2, 2023
6a8ac3c
Fixed Depend condition warning
roigcarlo Nov 2, 2023
f7c8a94
Fixing forgeting how booleans work
roigcarlo Nov 2, 2023
a9a8be4
Updated app classification and core libraries
roigcarlo Nov 2, 2023
357deb2
Remove this commit
roigcarlo Nov 2, 2023
88895b8
Fixes for build dir removal
roigcarlo Nov 10, 2023
58ca747
Adding missing includes for rom taken from LinearSolvers dependency
roigcarlo Nov 10, 2023
b9cbba6
Testing for local build
roigcarlo Nov 10, 2023
adb3e4f
I don't know how to code
roigcarlo Nov 10, 2023
d7a16fc
More missing deps
roigcarlo Nov 10, 2023
64feea2
Adding 'dependencies' category'
roigcarlo Nov 10, 2023
c705c92
Merge branch 'master' into core/new-compile-pipeline
roigcarlo Nov 20, 2023
c79e98a
Merge branch 'master' into core/new-compile-pipeline
roigcarlo Feb 29, 2024
67e8f33
Merge branch 'master' into core/new-compile-pipeline
roigcarlo Mar 5, 2024
5c0cb50
Fixing flags and ordering misplaced apps
roigcarlo Mar 5, 2024
3a816e0
Double double quote is not double fun
roigcarlo Mar 5, 2024
7e78719
Disable PARMMG in clang?
roigcarlo Mar 5, 2024
b3fdd0c
Testing new limits and app reorg
roigcarlo Mar 5, 2024
c5044f8
remove this as no longer works because of the synchronize task
roigcarlo Mar 5, 2024
541baf6
Complementing changes
roigcarlo Mar 5, 2024
4aceed0
Several changes:
roigcarlo Mar 5, 2024
e3fad41
Centos must die painfully
roigcarlo Mar 5, 2024
e9a9214
No longer trying to unify python version + duplicated app
roigcarlo Mar 5, 2024
d252771
Fixing core without unity
roigcarlo Mar 6, 2024
6df0752
Enable trilinos to be found even if trilinos application is not eanbl…
roigcarlo Mar 6, 2024
5291a13
Setting p3.10
roigcarlo Mar 6, 2024
e8eef78
Capturing invalid application list from ci_utils to prevent compilati…
roigcarlo Mar 6, 2024
3713f82
Updating nightly script
roigcarlo Mar 6, 2024
66c0544
Set number of cores no nightly
roigcarlo Mar 6, 2024
0a718a8
For real? (missing space)
roigcarlo Mar 6, 2024
6241d19
adding trilinos include to extensions while compiled detached from th…
roigcarlo Mar 6, 2024
3b41796
Missing includes for mapping
roigcarlo Mar 6, 2024
afcbd7d
Linking MeshApp with MPI when PMMG is used to avoid configure time de…
roigcarlo Mar 7, 2024
c142012
Fixing nightly flags
roigcarlo Mar 8, 2024
ecd01c4
Temporaly disabling chien drag test
roigcarlo Mar 8, 2024
67f1859
Disable cache (did nothing) and go back to 2 cores to avoid oom
roigcarlo Mar 8, 2024
5601a47
Explicity instantiation of templated member functions in U_Pw_small_s…
roigcarlo Mar 8, 2024
17432c1
Removing ccache
roigcarlo Mar 13, 2024
1f7abfa
Merge branch 'master' into core/new-compile-pipeline
roigcarlo Mar 13, 2024
321b0d9
Moving MKL and eigen back to LinearSolvers pipe
roigcarlo Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/ci-dummy.yml

This file was deleted.

114 changes: 77 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ name: CI

on:
pull_request:
merge_group:
branches:
- master
paths-ignore: # This must be the same as .github/workflows/ci_dummy.yml - "paths" !
- '**.md'
- 'documents/**'
- 'scripts/**' # Docker builds will be triggered by `build_docker_image_****.yml` workflows.
- '.github/workflows/ci-dummy.yml'
- '.github/workflows/build_docker_image*.yml'
- '.github/workflows/nightly_build.yml'
- 'kratos/templates/**'
- 'kratos/python_scripts/application_generator/**'
- 'docs/**'
- '.github/workflows/jekyll-gh-pages.yml'

workflow_dispatch:

Expand Down Expand Up @@ -56,8 +44,9 @@ jobs:
KRATOS_BUILD_TYPE: ${{ matrix.build-type }}
KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}}
KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_linux.json"
OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
OMPI_MCA_btl_vader_single_copy_mechanism: none # suppressing some annoying OpenMPI messages
KRATOS_CI_CORES: 4 # Current limits are 4 CPU and 16 GB Ram
philbucher marked this conversation as resolved.
Show resolved Hide resolved
OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
OMPI_MCA_btl_vader_single_copy_mechanism: none # Suppressing some annoying OpenMPI messages

container:
image: kratosmultiphysics/kratos-image-ci-ubuntu-22-04:latest
Expand All @@ -79,21 +68,88 @@ jobs:
if [ ${{ matrix.compiler }} = gcc ]; then
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12
export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON"
export KRATOS_CMAKE_OPTIONS_FLAGS="-DUSE_EIGEN_MKL=ON -DUSE_EIGEN_FEAST=ON -DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF"
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers"
elif [ ${{ matrix.compiler }} = clang ]; then
export CC=/usr/bin/clang-14
export CXX=/usr/bin/clang++-14
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations"
export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF -DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/"
export KRATOS_CMAKE_OPTIONS_FLAGS="-DTRILINOS_EXCLUDE_AMESOS2_SOLVER=OFF"
else
echo 'Unsupported compiler: ${{ matrix.compiler }}'
exit 1
fi
source /opt/intel/oneapi/setvars.sh
cp .github/workflows/configure.sh configure.sh
cp .github/workflows/configure_core.sh configure.sh
python3 kratos/python_scripts/testing/ci_utilities.py
bash configure.sh
rm -r ${GITHUB_WORKSPACE}/build

- name: Build Dependencies
shell: bash
run: |
if [ ${{ matrix.compiler }} = gcc ]; then
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12
export KRATOS_CMAKE_OPTIONS_FLAGS="-DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/ -DPMMG_ROOT=/external_libraries/ParMmg_5ffc6ad -DINCLUDE_PMMG=ON"
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers"
elif [ ${{ matrix.compiler }} = clang ]; then
export CC=/usr/bin/clang-14
export CXX=/usr/bin/clang++-14
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations"
export KRATOS_CMAKE_OPTIONS_FLAGS="-DMMG_ROOT=/external_libraries/mmg/mmg_5_5_1/"
else
echo 'Unsupported compiler: ${{ matrix.compiler }}'
exit 1
fi
source /opt/intel/oneapi/setvars.sh
cp .github/workflows/configure_dependencies.sh configure.sh
bash configure.sh
rm -r ${GITHUB_WORKSPACE}/build

- name: Build Core Apps
shell: bash
run: |
if [ ${{ matrix.compiler }} = gcc ]; then
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12
export KRATOS_CMAKE_OPTIONS_FLAGS=""
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers"
elif [ ${{ matrix.compiler }} = clang ]; then
export CC=/usr/bin/clang-14
export CXX=/usr/bin/clang++-14
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations"
export KRATOS_CMAKE_OPTIONS_FLAGS=""
else
echo 'Unsupported compiler: ${{ matrix.compiler }}'
exit 1
fi
source /opt/intel/oneapi/setvars.sh
cp .github/workflows/configure_core_applications.sh configure.sh
bash configure.sh
rm -r ${GITHUB_WORKSPACE}/build

- name: Build Research Apps
shell: bash
run: |
if [ ${{ matrix.compiler }} = gcc ]; then
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12
export KRATOS_CMAKE_OPTIONS_FLAGS=""
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers"
elif [ ${{ matrix.compiler }} = clang ]; then
export CC=/usr/bin/clang-14
export CXX=/usr/bin/clang++-14
export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations"
export KRATOS_CMAKE_OPTIONS_FLAGS=""
else
echo 'Unsupported compiler: ${{ matrix.compiler }}'
exit 1
fi
source /opt/intel/oneapi/setvars.sh
cp .github/workflows/configure_research_applications.sh configure.sh
bash configure.sh
rm -r ${GITHUB_WORKSPACE}/build

- name: Running python tests
shell: bash
Expand Down Expand Up @@ -244,7 +300,6 @@ jobs:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin/Custom/libs
python3.8 kratos/python_scripts/testing/run_tests.py -l nightly -c python3.8


ubuntu-core-without-unity:
runs-on: ubuntu-latest
needs: changed-files
Expand All @@ -257,12 +312,6 @@ jobs:
container:
image: kratosmultiphysics/kratos-image-ci-ubuntu-22-04:latest
options: --user 1001
env:
CCACHE_SLOPPINESS: pch_defines,time_macros
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: true
CCACHE_NODISABLE: true
CCACHE_MAXSIZE: 500M

steps:
- uses: actions/checkout@v4
Expand All @@ -271,24 +320,16 @@ jobs:
shell: bash
run: python3 kratos/python_scripts/testing/ci_utilities.py

- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-no-unity-ccache-${{ github.sha }}
restore-keys: ${{ runner.os }}-no-unity-ccache-

- name: Build
shell: bash
run: |
export CC=/usr/lib/ccache/clang-14
export CXX=/usr/lib/ccache/clang++-14
export CC=/usr/bin/clang-14
export CXX=/usr/bin/clang++-14
roigcarlo marked this conversation as resolved.
Show resolved Hide resolved

export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}"
export KRATOS_BUILD="${KRATOS_SOURCE}/build"
export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export PYTHON_EXECUTABLE="/usr/bin/python3.10"
export PYTHON_EXECUTABLE="/usr/bin/python3"
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON

add_app () {
Expand All @@ -310,10 +351,9 @@ jobs:
-DKRATOS_USE_PCH=ON

# Build
# Please do not use more than 2 cores or it will produce an out of heap memory error
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j2

ccache -s

- name: Running python tests
shell: bash
run: |
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/configure_core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# You can use your interpreter of choice (bash, sh, zsh, ...)

# For any question please contact with us in:
# - https://github.com/KratosMultiphysics/Kratos

# Optional parameters:
# You can find a list with all the compilation options in INSTALL.md or here:
# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options

add_app () {
export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;"
}

# Set variables
export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}"
export KRATOS_BUILD="${KRATOS_SOURCE}/build"
export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export PYTHON_EXECUTABLE="/usr/bin/python3.10"
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON

# Set applications to compile
add_app ${KRATOS_APP_DIR}/LinearSolversApplication;
add_app ${KRATOS_APP_DIR}/MetisApplication;
add_app ${KRATOS_APP_DIR}/TrilinosApplication;
Comment on lines +23 to +25
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be in dependencies?
configure_core.sh is a bit misleading otherwise

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.. I agree, but for reasons I need those three to be compiled in the first stage no matter what, otherwise the list of dependencies and when to activate them becomes a mess. I may change the name of the script to relfect that :S

(bascially moving trilinos and linear solvers retriggers the compilation of the core no matter what, so ....)


# Clean
clear
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles"

echo "Kratos build type is ${KRATOS_BUILD_TYPE}"

# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DUSE_MPI=ON \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
-DCMAKE_UNITY_BUILD=ON

# Build
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES}
52 changes: 52 additions & 0 deletions .github/workflows/configure_core_applications.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
# You can use your interpreter of choice (bash, sh, zsh, ...)

# For any question please contact with us in:
# - https://github.com/KratosMultiphysics/Kratos

# Optional parameters:
# You can find a list with all the compilation options in INSTALL.md or here:
# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options

add_app () {
export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;"
}

# Set variables
export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}"
export KRATOS_BUILD="${KRATOS_SOURCE}/build"
export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export PYTHON_EXECUTABLE="/usr/bin/python3.10"
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON

# Set applications to compile
add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication;
add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication;
add_app ${KRATOS_APP_DIR}/ConstitutiveLawsApplication;
add_app ${KRATOS_APP_DIR}/GeoMechanicsApplication;
add_app ${KRATOS_APP_DIR}/ConvectionDiffusionApplication;
add_app ${KRATOS_APP_DIR}/RomApplication;

# Clean
clear
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles"

echo "Kratos build type is ${KRATOS_BUILD_TYPE}"

# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DUSE_MPI=ON \
-DEXCLUDE_KRATOS_CORE=ON \
-DEXCLUDE_AUTOMATIC_DEPENDENCIES=ON \
-DREMOVE_INSTALL_DIRECTORIES=OFF \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
-DCMAKE_UNITY_BUILD=ON

# Build
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES}
54 changes: 54 additions & 0 deletions .github/workflows/configure_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
# You can use your interpreter of choice (bash, sh, zsh, ...)

# For any question please contact with us in:
# - https://github.com/KratosMultiphysics/Kratos

# Optional parameters:
# You can find a list with all the compilation options in INSTALL.md or here:
# - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options

add_app () {
export KRATOS_APPLICATIONS="${KRATOS_APPLICATIONS}$1;"
}

# Set variables
export KRATOS_SOURCE="${KRATOS_SOURCE:-${PWD}}"
export KRATOS_BUILD="${KRATOS_SOURCE}/build"
export KRATOS_APP_DIR="${KRATOS_SOURCE}/applications"
export PYTHON_EXECUTABLE="/usr/bin/python3.10"
export KRATOS_INSTALL_PYTHON_USING_LINKS=ON

# Set applications to compile
add_app ${KRATOS_APP_DIR}/HDF5Application;
add_app ${KRATOS_APP_DIR}/MedApplication;
add_app ${KRATOS_APP_DIR}/MappingApplication;
add_app ${KRATOS_APP_DIR}/MeshMovingApplication;
add_app ${KRATOS_APP_DIR}/MeshingApplication;
add_app ${KRATOS_APP_DIR}/StatisticsApplication;


# Clean
clear
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/cmake_install.cmake"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeCache.txt"
rm -rf "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}/CMakeFiles"

echo "Kratos build type is ${KRATOS_BUILD_TYPE}"

# Configure
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DUSE_MPI=ON \
-DEXCLUDE_KRATOS_CORE=ON \
-DEXCLUDE_AUTOMATIC_DEPENDENCIES=ON \
-DREMOVE_INSTALL_DIRECTORIES=OFF \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O0 -Wall" \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
-DCMAKE_UNITY_BUILD=ON \
-DINCLUDE_MMG=ON \

# Build
cmake --build "${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" --target install -- -j${KRATOS_CI_CORES}
Loading
Loading