Skip to content

Commit

Permalink
Merge pull request #271 from mabarnes/fix-parallel-ci
Browse files Browse the repository at this point in the history
Attempt to fix intermittent CI failures
  • Loading branch information
johnomotani authored Oct 2, 2024
2 parents cae381f + ee0cde6 commit 99ed356
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/longtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
# https://github.com/julia-actions/julia-runtest/blob/master/action.yml
# in order to pass customised arguments to `Pkg.test()`
- run: |
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--long", "--force-optional-dependencies"])'
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--ci", "--long", "--force-optional-dependencies"])'
shell: bash
8 changes: 4 additions & 4 deletions .github/workflows/parallel_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["Random", "SpecialFunctions", "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 --debug 1
./mpiexecjl -np 4 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1
./mpiexecjl -np 2 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1 --long
./mpiexecjl -np 3 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1
./mpiexecjl -np 4 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1
./mpiexecjl -np 2 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1 --long
# Note: MPI.jl's default implementation is mpich, which has a similar option
# `--with-device=ch3:sock`, but that needs to be set when compiling mpich.
shell: bash
Expand All @@ -51,7 +51,7 @@ jobs:
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["Random", "SpecialFunctions", "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 --debug 1
./mpiexecjl -np 4 --oversubscribe julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --ci --debug 1
# Note: MPI.jl's default implementation is mpich, which has a similar option
# `--with-device=ch3:sock`, but that needs to be set when compiling mpich.
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
# https://github.com/julia-actions/julia-runtest/blob/master/action.yml
# in order to pass customised arguments to `Pkg.test()`
- run: |
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--force-optional-dependencies"])'
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--ci", "--force-optional-dependencies"])'
shell: bash
3 changes: 3 additions & 0 deletions moment_kinetics/src/command_line_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const s = ArgParseSettings()
"--verbose", "-v"
help = "Print verbose output from tests."
action = :store_true
"--ci"
help = "Indicates that tests are running on the CI server."
action = :store_true
# Options for performance tests and plotting
"--machine-name"
help = "Which machine to plot for when using plot_performance.jl?"
Expand Down
8 changes: 7 additions & 1 deletion moment_kinetics/test/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ Get a single temporary directory that is the same on all MPI ranks
"""
function get_MPI_tempdir()
if global_rank[] == 0
test_output_directory = tempname()
if get_options()["ci"]
runs_dir = abspath("runs/")
mkpath(runs_dir)
test_output_directory = tempname(runs_dir)
else
test_output_directory = tempname()
end
mkpath(test_output_directory)
else
test_output_directory = ""
Expand Down

0 comments on commit 99ed356

Please sign in to comment.