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

Use parallel I/O in Github Actions CI tests #277

Merged
merged 7 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion .github/workflows/debug_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
sed -i -e "s/_debug_level = get_options.*/_debug_level = 2/" moment_kinetics/src/debugging.jl

touch Project.toml
# Not sure why installing "NCDatasets" fails at the moment (8/10/2024), but precompilation hangs for this job if it is included, so skip for now.
#julia --project -O3 --check-bounds=yes -e 'using Pkg; Pkg.add(["MPI", "MPIPreferences", "NCDatasets", "PackageCompiler", "Symbolics"]); using MPIPreferences; MPIPreferences.use_jll_binary("OpenMPI_jll")'
julia --project -O3 --check-bounds=yes -e 'using Pkg; Pkg.add(["MPI", "MPIPreferences", "PackageCompiler", "Symbolics"]); using MPIPreferences; MPIPreferences.use_jll_binary("OpenMPI_jll")'
julia --project -O3 --check-bounds=no -e 'using MPI; MPI.install_mpiexecjl(; destdir=".")'
julia --project -O3 --check-bounds=yes -e 'using MPI; MPI.install_mpiexecjl(; destdir=".")'
julia --project -O3 --check-bounds=yes -e 'using Pkg; Pkg.develop(path="moment_kinetics/"); Pkg.precompile()'
julia --project -O3 --check-bounds=yes precompile-with-check-bounds.jl --debug 2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/parallel_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
touch Project.toml
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["MPI", "MPIPreferences"]); using MPIPreferences; MPIPreferences.use_jll_binary("OpenMPI_jll")'
julia --project -O3 --check-bounds=no -e 'using MPI; MPI.install_mpiexecjl(; destdir=".")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["Random", "SpecialFunctions", "StatsBase", "Test"]); Pkg.develop(path="moment_kinetics/")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["NCDatasets", "Random", "SpecialFunctions", "StatsBase", "Test"]); Pkg.develop(path="moment_kinetics/")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.precompile()'
# Need to use openmpi so that we can use `--oversubscribe` to allow using more MPI ranks than physical cores
./mpiexecjl -np 3 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1
Expand All @@ -48,7 +48,7 @@ jobs:
touch Project.toml
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["MPI", "MPIPreferences"]); using MPIPreferences; MPIPreferences.use_jll_binary("OpenMPI_jll")'
julia --project -O3 --check-bounds=no -e 'using MPI; MPI.install_mpiexecjl(; destdir=".")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["Random", "SpecialFunctions", "StatsBase", "Test"]); Pkg.develop(path="moment_kinetics/")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["NCDatasets", "Random", "SpecialFunctions", "StatsBase", "Test"]); Pkg.develop(path="moment_kinetics/")'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.precompile()'
# Need to use openmpi so that we can use `--oversubscribe` to allow using more MPI ranks than physical cores
./mpiexecjl -np 4 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1
Expand Down
2 changes: 0 additions & 2 deletions moment_kinetics/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
HDF5_jll = "0234f1f7-429e-5d53-9886-15a909be8d59"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LegendrePolynomials = "3db4a2ba-fc88-11e8-3e01-49c72059a882"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Expand Down Expand Up @@ -50,7 +49,6 @@ file_io_netcdf = "NCDatasets"
manufactured_solns_ext = ["Symbolics", "IfElse"]

[compat]
HDF5_jll = "<1.14, >=1.15"
julia = "1.9.0"

[extras]
Expand Down
11 changes: 9 additions & 2 deletions moment_kinetics/debug_test/sound_wave_inputs.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
test_type = "sound_wave"
using moment_kinetics.type_definitions: OptionsDict
using moment_kinetics.utils: recursive_merge
using moment_kinetics.file_io: io_has_implementation
using moment_kinetics.input_structs: netcdf

# default inputs for tests
test_input_finite_difference_1D1V = OptionsDict("output" => OptionsDict("run_name" => "finite_difference_1D1V",
Expand Down Expand Up @@ -210,7 +212,8 @@ recursive_merge(test_input_finite_difference_1D1V,

test_input_chebyshev_1D1V_split_1_moment =
recursive_merge(test_input_chebyshev_1D1V,
OptionsDict("output" => OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_1_moment"),
OptionsDict("output" => OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_1_moment",
"parallel_io" => false),
"evolve_moments" => OptionsDict("density" => true)))

test_input_chebyshev_1D1V_split_2_moments =
Expand All @@ -223,9 +226,13 @@ recursive_merge(test_input_chebyshev_1D1V_split_2_moments,
OptionsDict("output" => OptionsDict("run_name" => "chebyshev_pseudospectral_1D1V_split_3_moments"),
"evolve_moments" => OptionsDict("parallel_pressure" => true)))

# Use "netcdf" for a few tests to test the NetCDF I/O if it is available.
const binary_format = io_has_implementation(netcdf) ? "netcdf" : "hdf5"

test_input_chebyshev_cx0_1D1V =
recursive_merge(test_input_chebyshev_1D1V,
OptionsDict("output" => OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V"),
OptionsDict("output" => OptionsDict("run_name" => "chebyshev_pseudospectral_cx0_1D1V",
"binary_format" => binary_format),
"reactions" => OptionsDict("charge_exchange_frequency" => 0.0)))

test_input_chebyshev_cx0_1D1V_split_1_moment =
Expand Down
3 changes: 2 additions & 1 deletion moment_kinetics/test/harrisonthompson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ test_input_finite_difference = Dict("composition" => OptionsDict("n_ion_species"
"upar_phase" => 0.0,
"temperature_amplitude" => 0.0,
"temperature_phase" => 0.0),
"output" => OptionsDict("run_name" => "finite_difference"),
"output" => OptionsDict("run_name" => "finite_difference",
"parallel_io" => false),
"evolve_moments" => OptionsDict("density" => false,
"parallel_flow" => false,
"parallel_pressure" => false,
Expand Down