Skip to content

Commit

Permalink
Merge branch 'topic/default/meson-multi-backends' into 'branch/default'
Browse files Browse the repository at this point in the history
Try multi-backends

See merge request fluiddyn/fluidsim!347
  • Loading branch information
paugier committed Dec 30, 2023
2 parents 89f8624 + d0f273d commit 7de523b
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 12 deletions.
5 changes: 4 additions & 1 deletion fluidsim/base/output/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ run_command(
['transonic', '--meson', '--backend', backend, 'increments.py', 'spatiotemporal_spectra.py'],
check: true
)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/base/time_stepping/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ py.install_sources(
)

run_command(['transonic', '--meson', '--backend', backend, 'pseudo_spect.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/operators/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ py.install_sources(
subdir('test')

run_command(['transonic', '--meson', '--backend', backend, 'operators2d.py', 'operators3d.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
6 changes: 5 additions & 1 deletion fluidsim/solvers/ns2d/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ subdir('output')
subdir('strat')

run_command(['transonic', '--meson', '--backend', backend, 'solver.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach

5 changes: 4 additions & 1 deletion fluidsim/solvers/ns2d/output/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ py.install_sources(
)

run_command(['transonic', '--meson', '--backend', backend, 'spatiotemporal_spectra.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/solvers/ns3d/forcing/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ py.install_sources(
)

run_command(['transonic', '--meson', '--backend', backend, 'watu.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/solvers/ns3d/output/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ py.install_sources(
)

run_command(['transonic', '--meson', '--backend', backend, 'spatiotemporal_spectra.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/solvers/ns3d/strat/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ py.install_sources(
subdir('output')

run_command(['transonic', '--meson', '--backend', backend, 'solver.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
5 changes: 4 additions & 1 deletion fluidsim/util/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ subdir('console')
subdir('scripts')

run_command(['transonic', '--meson', '--backend', backend, 'mini_oper_modif_resol.py'], check: true)
subdir('__' + backend + '__')

foreach be : backends
subdir('__' + be + '__')
endforeach
10 changes: 9 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ py = py_mod.find_installation('python3', pure: false)
py_dep = py.dependency()

backend = get_option('transonic-backend')
if backend == 'pythran'

if backend.contains(',')
backends = backend.split(',')
else
backends = [backend]
endif

use_pythran = backend.contains('pythran')
if use_pythran
incdir_numpy = run_command(
py,
[
Expand Down
7 changes: 6 additions & 1 deletion meson.options
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
option('transonic-backend', type: 'string', value: 'pythran', description: 'pythran(default), cython, numpy, numba')
option(
'transonic-backend',
type: 'string',
value: 'pythran,python,numba',
description: 'pythran,python,numba (default), cython, numpy, numba, or comma separated value representing multi-backends'
)
option('use-xsimd', type: 'boolean', value: true, description: 'use xsimd')
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dev = [
"fluidsim[test]",
"fluidsim[mpi]",
"fluidsim[fft]",
"fluidsim[sphere]",
# "fluidsim[sphere]",
"build",
"twine",
]
Expand Down

0 comments on commit 7de523b

Please sign in to comment.