Skip to content

Commit b7c1577

Browse files
authored
Merge pull request #1935 from su2code/feature_update_mpp
Compile SU2 with Mutation++ for regression tests
2 parents da0c951 + 68cdd8d commit b7c1577

File tree

6 files changed

+69
-32
lines changed

6 files changed

+69
-32
lines changed

.github/workflows/regression.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
2727
include:
2828
- config_set: BaseMPI
29-
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2 --werror'
29+
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2'
3030
- config_set: ReverseMPI
3131
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3232
- config_set: ForwardMPI
@@ -52,23 +52,23 @@ jobs:
5252
key: ${{ matrix.config_set }}-${{ github.sha }}
5353
restore-keys: ${{ matrix.config_set }}
5454
- name: Pre Cleanup
55-
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
55+
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
5656
with:
5757
entrypoint: /bin/rm
5858
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
5959
- name: Build
60-
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
60+
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
6161
with:
6262
args: -b ${{github.ref}} -f "${{matrix.flags}}"
6363
- name: Compress binaries
64-
run: tar -zcvf install_bin.tgz install/bin
64+
run: tar -zcvf install_bin.tgz install/*
6565
- name: Upload Binaries
6666
uses: actions/upload-artifact@v3
6767
with:
6868
name: ${{ matrix.config_set }}
6969
path: install_bin.tgz
7070
- name: Post Cleanup
71-
uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323
71+
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
7272
with:
7373
entrypoint: /bin/rm
7474
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -95,23 +95,23 @@ jobs:
9595
key: ${{ matrix.config_set }}-${{ github.sha }}
9696
restore-keys: ${{ matrix.config_set }}
9797
- name: Pre Cleanup
98-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
98+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
9999
with:
100100
entrypoint: /bin/rm
101101
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
102102
- name: Build
103-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
103+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
104104
with:
105105
args: -b ${{github.ref}} -f "${{matrix.flags}}"
106106
- name: Compress binaries
107-
run: tar -zcvf install_bin.tgz install/bin
107+
run: tar -zcvf install_bin.tgz install/*
108108
- name: Upload Binaries
109109
uses: actions/upload-artifact@v3
110110
with:
111111
name: ${{ matrix.config_set }}
112112
path: install_bin.tgz
113113
- name: Post Cleanup
114-
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323
114+
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
115115
with:
116116
entrypoint: /bin/rm
117117
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -142,7 +142,7 @@ jobs:
142142
tag: OMP
143143
steps:
144144
- name: Pre Cleanup
145-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
145+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
146146
with:
147147
entrypoint: /bin/rm
148148
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -161,19 +161,19 @@ jobs:
161161
ls -lah
162162
tar -zxvf install_bin.tgz
163163
ls -lah install/bin/
164-
cp -r install/bin/* $BIN_FOLDER;
164+
cp -r install/* $BIN_FOLDER/../
165165
popd;
166166
fi
167167
done
168168
chmod a+x $BIN_FOLDER/*
169169
ls -lahR $BIN_FOLDER
170170
- name: Run Tests in Container
171-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
171+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
172172
with:
173173
# -t <Tutorials-branch> -c <Testcases-branch>
174174
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
175175
- name: Cleanup
176-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
176+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
177177
with:
178178
entrypoint: /bin/rm
179179
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -188,7 +188,7 @@ jobs:
188188
testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py']
189189
steps:
190190
- name: Pre Cleanup
191-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
191+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
192192
with:
193193
entrypoint: /bin/rm
194194
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -207,19 +207,19 @@ jobs:
207207
ls -lah
208208
tar -zxvf install_bin.tgz
209209
ls -lah install/bin/
210-
cp -r install/bin/* $BIN_FOLDER;
210+
cp -r install/* $BIN_FOLDER/../
211211
popd;
212212
fi
213213
done
214214
chmod a+x $BIN_FOLDER/*
215215
ls -lahR $BIN_FOLDER
216216
- name: Run Tests in Container
217-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
217+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
218218
with:
219219
# -t <Tutorials-branch> -c <Testcases-branch>
220220
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan"
221221
- name: Cleanup
222-
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323
222+
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
223223
with:
224224
entrypoint: /bin/rm
225225
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -240,7 +240,7 @@ jobs:
240240
tag: MPI
241241
steps:
242242
- name: Pre Cleanup
243-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
243+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
244244
with:
245245
entrypoint: /bin/rm
246246
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
@@ -273,7 +273,7 @@ jobs:
273273
ls -lah
274274
tar -zxvf install_bin.tgz
275275
ls -laH install/bin/
276-
cp -r install/bin/* $BIN_FOLDER;
276+
cp -r install/* $BIN_FOLDER/../
277277
popd;
278278
else
279279
echo "$TYPE_FOLDER does not exist!"
@@ -301,11 +301,11 @@ jobs:
301301
echo $PWD
302302
ls -lahR
303303
- name: Run Unit Tests
304-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
304+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
305305
with:
306306
entrypoint: install/bin/${{matrix.testdriver}}
307307
- name: Post Cleanup
308-
uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323
308+
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
309309
with:
310310
entrypoint: /bin/rm
311311
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}

.github/workflows/release-management.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
key: ${{ matrix.os_bin }}-${{ github.sha }}
3636
restore-keys: ${{ matrix.os_bin }}
3737
- name: Build
38-
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230704-1323
38+
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230813-0103
3939
with:
4040
args: -b ${{ github.sha }} -f "${{matrix.flags}}"
4141
- name: Create Archive

Common/src/CConfig.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3983,9 +3983,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
39833983
}
39843984
}
39853985

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

SU2_PY/copy_directory.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python
2+
# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md)
3+
4+
import sys
5+
import os
6+
import shutil
7+
8+
if __name__ == "__main__":
9+
src = os.path.abspath(sys.argv[1])
10+
dst = os.path.abspath(sys.argv[2])
11+
shutil.copytree(src, dst)

meson.build

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,28 @@ endforeach
245245
catch2_dep = declare_dependency(include_directories: 'externals/catch2/')
246246

247247
if get_option('enable-mpp')
248-
cmake = import('cmake')
249-
mpp_subproj = cmake.subproject('Mutationpp')
248+
if build_machine.cpu_family() == 'x86' or build_machine.cpu_family() == 'x86_64'
249+
cmake = import('cmake')
250+
cmake_opts = cmake.subproject_options()
251+
cmake_opts.set_override_option('warning_level', '0')
252+
cmake_opts.add_cmake_defines({
253+
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
254+
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
255+
})
256+
cmake_opts.set_install(get_option('install-mpp'))
257+
endif
258+
mpp_subproj = cmake.subproject('Mutationpp', options: cmake_opts)
250259
mpp_dep = mpp_subproj.dependency('mutation++')
251260
su2_deps += mpp_dep
252261
su2_cpp_args += '-DHAVE_MPP'
262+
263+
if get_option('install-mpp')
264+
py = find_program('python3', 'python')
265+
p = run_command(py, 'SU2_PY/copy_directory.py', 'subprojects/Mutationpp/data', join_paths(get_option('prefix'), 'mpp-data'))
266+
if p.returncode() != 0
267+
error(p.stderr())
268+
endif
269+
endif
253270
endif
254271

255272
if get_option('enable-coolprop')
@@ -259,7 +276,7 @@ if get_option('enable-coolprop')
259276
cmake_opts.set_override_option('warning_level', '0')
260277
cmake_opts.add_cmake_defines({
261278
'COOLPROP_STATIC_LIBRARY': true,
262-
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
279+
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
263280
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
264281
})
265282
coolprop_subproj = cmake.subproject('CoolProp', options: cmake_opts)
@@ -344,12 +361,21 @@ message('''---------------------------------------------------------------------
344361
get_option('enable-mlpcpp'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root()))
345362

346363
if get_option('enable-mpp')
347-
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
364+
if get_option('install-mpp')
365+
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
348366
349-
export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
350-
export LD_LIBRARY_PATH=$SU2_HOME/<build_dir>/subprojects/Mutationpp
367+
export MPP_DATA_DIRECTORY=$SU2_RUN/../mpp-data
368+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_RUN/../lib
351369
352-
''')
370+
''')
371+
else
372+
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
373+
374+
export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
375+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_HOME/<build_dir>/subprojects/Mutationpp
376+
377+
''')
378+
endif
353379
endif
354380

355381
if get_option('enable-librom')

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option('enable-tests', type : 'boolean', value : false, description: 'compile U
1818
option('enable-mixedprec', type : 'boolean', value : false, description: 'use single precision floating point arithmetic for sparse algebra')
1919
option('extra-deps', type : 'string', value : '', description: 'comma-separated list of extra (custom) dependencies to add for compilation')
2020
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
21+
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
2122
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
2223
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
2324
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')

0 commit comments

Comments
 (0)