170 lines
5.8 KiB
Meson
170 lines
5.8 KiB
Meson
if get_option('build_tests') and get_option('build_examples')
|
|
runtime_environment = environment()
|
|
if (
|
|
mfem_runtime_prefix != '' and dependency_prefix != '' and
|
|
not wheel_carries_native_bundle
|
|
)
|
|
runtime_environment.prepend('PATH', dependency_prefix / 'bin')
|
|
if host_machine.system() == 'darwin'
|
|
runtime_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib64')
|
|
runtime_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib')
|
|
elif host_machine.system() != 'windows' and not is_wasm
|
|
runtime_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib64')
|
|
runtime_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib')
|
|
endif
|
|
endif
|
|
if mfem_runtime_prefix != ''
|
|
runtime_environment.prepend('PATH', mfem_runtime_prefix / 'bin')
|
|
if host_machine.system() == 'darwin'
|
|
runtime_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
runtime_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
elif host_machine.system() != 'windows' and not is_wasm
|
|
runtime_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
runtime_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
endif
|
|
endif
|
|
|
|
test(
|
|
'serial-poisson',
|
|
serial_example,
|
|
env: runtime_environment,
|
|
timeout: 120,
|
|
)
|
|
|
|
if mfem_has_cuda
|
|
test(
|
|
'serial-poisson-cuda',
|
|
serial_example,
|
|
args: ['cuda'],
|
|
env: runtime_environment,
|
|
timeout: 120,
|
|
)
|
|
endif
|
|
|
|
if mfem_has_mpi
|
|
if mpi_launcher_from_dependency and not wheel_carries_native_bundle
|
|
mpi_launcher_program = find_program(
|
|
dependency_prefix / 'bin' / 'mpiexec',
|
|
dependency_prefix / 'bin' / 'mpirun',
|
|
required: true,
|
|
)
|
|
mpi_launcher = mpi_launcher_program.full_path()
|
|
elif mfem_runtime_prefix != ''
|
|
mpi_launcher = mfem_runtime_prefix / 'bin' / 'mpiexec'
|
|
else
|
|
mpi_launcher_program = find_program('mpiexec', 'mpirun', required: true)
|
|
mpi_launcher = mpi_launcher_program.full_path()
|
|
endif
|
|
test(
|
|
'parallel-hypre-boomeramg',
|
|
python_build,
|
|
args: [
|
|
files('../tools/run_mpi_test.py'),
|
|
'--launcher', mpi_launcher,
|
|
'--processes', '2',
|
|
parallel_example,
|
|
],
|
|
env: runtime_environment,
|
|
timeout: 180,
|
|
)
|
|
if mfem_has_cuda
|
|
test(
|
|
'parallel-hypre-boomeramg-cuda',
|
|
python_build,
|
|
args: [
|
|
files('../tools/run_mpi_test.py'),
|
|
'--launcher', mpi_launcher,
|
|
'--processes', '2',
|
|
parallel_example,
|
|
'cuda',
|
|
],
|
|
env: runtime_environment,
|
|
timeout: 180,
|
|
)
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
if get_option('build_tests') and get_option('build_benchmarks')
|
|
benchmark_smoke_environment = environment()
|
|
benchmark_smoke_environment.set('OMP_NUM_THREADS', '1')
|
|
benchmark_smoke_environment.set('OMP_DYNAMIC', 'FALSE')
|
|
if (
|
|
mfem_runtime_prefix != '' and dependency_prefix != '' and
|
|
not wheel_carries_native_bundle
|
|
)
|
|
benchmark_smoke_environment.prepend('PATH', dependency_prefix / 'bin')
|
|
if host_machine.system() == 'darwin'
|
|
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib64')
|
|
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', dependency_prefix / 'lib')
|
|
elif host_machine.system() != 'windows' and not is_wasm
|
|
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib64')
|
|
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', dependency_prefix / 'lib')
|
|
endif
|
|
endif
|
|
if mfem_runtime_prefix != ''
|
|
benchmark_smoke_environment.prepend('PATH', mfem_runtime_prefix / 'bin')
|
|
if host_machine.system() == 'darwin'
|
|
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
benchmark_smoke_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
elif host_machine.system() != 'windows'
|
|
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
benchmark_smoke_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
endif
|
|
endif
|
|
test(
|
|
'backend-benchmark-smoke',
|
|
python_build,
|
|
args: [
|
|
files('../tools/run_mpi_test.py'),
|
|
'--launcher', benchmark_mpi_launcher,
|
|
'--processes', '1',
|
|
'--',
|
|
benchmark_executable,
|
|
'--device', 'cpu',
|
|
'--mesh-n', '4',
|
|
'--order', '2',
|
|
'--applications', '2',
|
|
'--minimum-apply-seconds', '0',
|
|
'--warmup-applications', '1',
|
|
'--relative-tolerance', '1e-6',
|
|
'--max-iterations', '200',
|
|
'--solve',
|
|
],
|
|
depends: benchmark_executable,
|
|
env: benchmark_smoke_environment,
|
|
timeout: 180,
|
|
)
|
|
endif
|
|
|
|
if get_option('build_tests') and get_option('build_python')
|
|
python_test_environment = environment()
|
|
python_test_environment.prepend('PYTHONPATH', python_extension_dir)
|
|
if mfem_runtime_prefix != ''
|
|
if host_machine.system() == 'darwin'
|
|
python_test_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
python_test_environment.prepend('DYLD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
elif host_machine.system() != 'windows'
|
|
python_test_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib64')
|
|
python_test_environment.prepend('LD_LIBRARY_PATH', mfem_runtime_prefix / 'lib')
|
|
endif
|
|
endif
|
|
test(
|
|
'python-nanobind',
|
|
python_build,
|
|
args: [
|
|
'-c',
|
|
'import _core; assert _core.serial_poisson_dofs(3, 1) > 0; assert _core.capabilities()["hypre"] == _core.capabilities()["mpi"]',
|
|
],
|
|
depends: python_extension,
|
|
env: python_test_environment,
|
|
timeout: 120,
|
|
)
|
|
endif
|
|
|
|
if get_option('build_tests')
|
|
test('cuda-toolchain-diagnostics', python_build,
|
|
args: files('test_cuda_toolchain.py'),
|
|
)
|
|
endif
|