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

Compile SU2 with Mutation++ for regression tests #1935

Merged
merged 20 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
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
32 changes: 16 additions & 16 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
include:
- config_set: BaseMPI
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2 --werror'
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2'
- config_set: ReverseMPI
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ForwardMPI
Expand All @@ -52,12 +52,12 @@ jobs:
key: ${{ matrix.config_set }}-${{ github.sha }}
restore-keys: ${{ matrix.config_set }}
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Build
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
with:
args: -b ${{github.ref}} -f "${{matrix.flags}}"
- name: Compress binaries
Expand All @@ -68,7 +68,7 @@ jobs:
name: ${{ matrix.config_set }}
path: install_bin.tgz
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -95,12 +95,12 @@ jobs:
key: ${{ matrix.config_set }}-${{ github.sha }}
restore-keys: ${{ matrix.config_set }}
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Build
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
with:
args: -b ${{github.ref}} -f "${{matrix.flags}}"
- name: Compress binaries
Expand All @@ -111,7 +111,7 @@ jobs:
name: ${{ matrix.config_set }}
path: install_bin.tgz
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
tag: OMP
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -168,12 +168,12 @@ jobs:
chmod a+x $BIN_FOLDER/*
ls -lahR $BIN_FOLDER
- name: Run Tests in Container
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -188,7 +188,7 @@ jobs:
testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py']
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -214,12 +214,12 @@ jobs:
chmod a+x $BIN_FOLDER/*
ls -lahR $BIN_FOLDER
- name: Run Tests in Container
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan"
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -240,7 +240,7 @@ jobs:
tag: MPI
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand Down Expand Up @@ -301,11 +301,11 @@ jobs:
echo $PWD
ls -lahR
- name: Run Unit Tests
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
entrypoint: install/bin/${{matrix.testdriver}}
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
2 changes: 1 addition & 1 deletion .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
key: ${{ matrix.os_bin }}-${{ github.sha }}
restore-keys: ${{ matrix.os_bin }}
- name: Build
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230704-1323
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230813-0103
with:
args: -b ${{ github.sha }} -f "${{matrix.flags}}"
- name: Create Archive
Expand Down
5 changes: 2 additions & 3 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3983,9 +3983,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
}
}

if (Kind_FluidModel == MUTATIONPP &&
(Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) {
SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG transport model instead..",
if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)) {
SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE, GUPTAYOS, or CHAPMANN_ENSKOG transport model instead.",
CURRENT_FUNCTION);
}

Expand Down
11 changes: 11 additions & 0 deletions SU2_PY/copy_directory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python
# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md)

import sys
import os
import shutil

if __name__ == "__main__":
src = os.path.abspath(sys.argv[1])
dst = os.path.abspath(sys.argv[2])
shutil.copytree(src, dst)
1 change: 1 addition & 0 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from __future__ import print_function

import sys
import os
Fixed Show fixed Hide fixed
from TestCase import TestCase

def main():
Expand Down
40 changes: 33 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,28 @@ endforeach
catch2_dep = declare_dependency(include_directories: 'externals/catch2/')

if get_option('enable-mpp')
cmake = import('cmake')
mpp_subproj = cmake.subproject('Mutationpp')
if build_machine.cpu_family() == 'x86' or build_machine.cpu_family() == 'x86_64'
cmake = import('cmake')
cmake_opts = cmake.subproject_options()
cmake_opts.set_override_option('warning_level', '0')
cmake_opts.add_cmake_defines({
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
})
cmake_opts.set_install(get_option('install-mpp'))
endif
mpp_subproj = cmake.subproject('Mutationpp', options: cmake_opts)
mpp_dep = mpp_subproj.dependency('mutation++')
su2_deps += mpp_dep
su2_cpp_args += '-DHAVE_MPP'

if get_option('install-mpp')
py = find_program('python3', 'python')
p = run_command(py, 'SU2_PY/copy_directory.py', 'subprojects/Mutationpp/data', join_paths(get_option('prefix'), 'mpp-data'))
if p.returncode() != 0
error(p.stderr())
endif
endif
endif

if get_option('enable-coolprop')
Expand All @@ -247,7 +264,7 @@ if get_option('enable-coolprop')
cmake_opts.set_override_option('warning_level', '0')
cmake_opts.add_cmake_defines({
'COOLPROP_STATIC_LIBRARY': true,
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
})
coolprop_subproj = cmake.subproject('CoolProp', options: cmake_opts)
Expand Down Expand Up @@ -332,12 +349,21 @@ message('''---------------------------------------------------------------------
get_option('enable-mlpcpp'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root()))

if get_option('enable-mpp')
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
if get_option('install-mpp')
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:

export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
export LD_LIBRARY_PATH=$SU2_HOME/<build_dir>/subprojects/Mutationpp
export MPP_DATA_DIRECTORY=$SU2_RUN/../mpp-data
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_RUN/../lib

''')
''')
else
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:

export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_HOME/<build_dir>/subprojects/Mutationpp

''')
endif
endif

if get_option('enable-librom')
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ option('enable-tests', type : 'boolean', value : false, description: 'compile U
option('enable-mixedprec', type : 'boolean', value : false, description: 'use single precision floating point arithmetic for sparse algebra')
option('extra-deps', type : 'string', value : '', description: 'comma-separated list of extra (custom) dependencies to add for compilation')
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
Expand Down
2 changes: 1 addition & 1 deletion meson_scripts/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def init_submodules(
github_repo_meson = "https://github.com/mesonbuild/meson"
sha_version_ninja = "52649de2c56b63f42bc59513d51286531c595b44"
github_repo_ninja = "https://github.com/ninja-build/ninja"
sha_version_mpp = "5ff579f43781cae07411e5ab46291c9971536be6"
sha_version_mpp = "4cb6e3a05c15f49ffd346dc9f185ccc3459728b0"
github_repo_mpp = "https://github.com/mutationpp/Mutationpp"
sha_version_coolprop = "0ce42fcf3bb2c373512bc825a4f0c1973a78f307"
github_repo_coolprop = "https://github.com/CoolProp/CoolProp"
Expand Down
2 changes: 1 addition & 1 deletion subprojects/Mutationpp
Submodule Mutationpp updated 166 files