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

Merge separate-postprocessing-packages into #166 #178

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c9c3512
Move post-processing modules into separate packages
johnomotani Dec 16, 2023
8aac9d4
Remove runtime plots
johnomotani Dec 16, 2023
9fa67d8
Support new post-processing packages in Documenter.jl setup
johnomotani Dec 16, 2023
cd57483
Update docs to reflect restructured post-processing packages
johnomotani Dec 17, 2023
007c9fb
Move moment_kinetics package to a subdirectory
johnomotani Dec 19, 2023
c0e94ae
Make NCDatasets an optional dependency
johnomotani Dec 19, 2023
36568dc
Remove brackets from generic function definitions
johnomotani Dec 19, 2023
bdbf1b8
Remove TimerOutputs from 'precompile runs'
johnomotani Dec 19, 2023
093bdf6
Make Symbolics an optional dependency, by moving MMS to an extension
johnomotani Dec 19, 2023
d1deab4
Move functions to analysis.jl so fit_delta_phi_mode can be used in tests
johnomotani Dec 19, 2023
6f51d7c
Move data-loading functions from makie_post_processing to load_data
johnomotani Dec 19, 2023
15ab879
Comment out import of plot_test_data in fokker_planck_tests.jl
johnomotani Dec 19, 2023
ea22369
Update CI tests for reorganised package structure
johnomotani Dec 19, 2023
526e4ae
Modernise test dependency specification, remove unneeded dependencies
johnomotani Dec 20, 2023
7e71e50
Allow tests to run when optional dependencies are not installed
johnomotani Dec 20, 2023
521bb72
Update machine setup scripts with new HDF5.jl setup function
johnomotani Dec 20, 2023
82084cc
Reduce number of tests in parallel on macOS
johnomotani Dec 20, 2023
5206741
Update HDF5 installed for Marconi setup to 1.14.3
johnomotani Dec 21, 2023
519879a
Update machine setup scripts for restructured packages, add generic-pc
johnomotani Dec 20, 2023
b20181c
Add .julia to the .gitignore
johnomotani Dec 21, 2023
5c05a68
Only provide submission scripts on batch systems
johnomotani Dec 21, 2023
1c88e6f
Move prompt for submitting precompilation near beginning of script
johnomotani Dec 21, 2023
97f03b6
Use previous settings as defaults when machine_setup.sh is re-run
johnomotani Dec 21, 2023
6b4d505
Remove unused NCDatasets dependency from plots_post_processing
johnomotani Dec 21, 2023
c931fcc
Optionally set up NetCDF and/or MMS during machine setup
johnomotani Dec 28, 2023
0ff26ae
Save response of whether to download HDF5 as the default
johnomotani Dec 28, 2023
091d96f
Move post processing packages to nested subdirectories
johnomotani Dec 28, 2023
61524cb
Set optimization flags for setup
johnomotani Dec 28, 2023
4f714b3
Consolidate all machine_setup_stage_two.jl into a single script
johnomotani Dec 29, 2023
e6058ac
Save location of julia executable, use as default when rerunning setup
johnomotani Dec 29, 2023
7e6c887
Fix download of julia for generic-pc, support downloading for macOS
johnomotani Dec 29, 2023
6f1cc57
Move most argument prompts into machine_setup.jl
johnomotani Dec 29, 2023
d01fe93
Save the setting for JULIA_DIRECTORY and use it as the default on re-run
johnomotani Dec 30, 2023
dd8301e
Start moving more setup into machine_setup_stage_two.jl
johnomotani Dec 30, 2023
01fac0b
Save batch_system flag
johnomotani Dec 30, 2023
246f1e1
Refactor setup of post processing packages
johnomotani Dec 30, 2023
d6bda57
Add optional dependencies after moment_kinetics, and switch order
johnomotani Dec 30, 2023
cf64646
Add PackageCompiler to the top-level installed packages
johnomotani Dec 31, 2023
2feee0f
Don't delete compiled HDF5 when it is deselected
johnomotani Dec 30, 2023
978e147
Change build_hdf5 values to y/n instead of 0/1
johnomotani Dec 30, 2023
7b17b6f
Option to set up postprocessing in separate project on non-batch system
johnomotani Dec 31, 2023
96a776d
Use relative path instead of symlink for shared_utils.jl
johnomotani Dec 31, 2023
38e96fb
Print useful info showing optimization flags to use
johnomotani Dec 31, 2023
0a7db88
Uninstall postproc from main project when using separate postproc
johnomotani Dec 31, 2023
8e26a96
Add 'generic-batch' target in setup scripts
johnomotani Dec 31, 2023
1501bc0
Fix path for 'system' HDF5
johnomotani Dec 31, 2023
f7deca2
Fix creation of symlinks to batch submission scripts
johnomotani Dec 31, 2023
24ea286
Remove Preferences dependence in get-precompile-info.jl, get-job-info.jl
johnomotani Dec 31, 2023
6dc8928
Better way of getting repo_dir
johnomotani Dec 31, 2023
7495eab
Fix system-image compilation of post-processing packages
johnomotani Dec 31, 2023
219c115
Use more processes for precompilation jobs
johnomotani Dec 31, 2023
8762741
Optionally install `Revise` and add to startup.jl
johnomotani Jan 1, 2024
60c4bf7
Handle optional post-processing packages in job submission scripts
johnomotani Jan 1, 2024
89dc5df
Add post-processing system image files to .gitignore
johnomotani Jan 1, 2024
86a0927
Suppress error messages from Qt in plots_post_processing batch jobs
johnomotani Jan 1, 2024
c1a06d3
Get MACHINE first, rather than in the middle of finding `julia`
johnomotani Jan 2, 2024
09998de
When submitting batch jobs, check system image is newer than source code
johnomotani Jan 2, 2024
3aa9552
By default, submit system-image compilation for post-processing too
johnomotani Jan 2, 2024
45875aa
Update documentation for restructured packaging and setup
johnomotani Jan 1, 2024
f734d8d
Print finish time in precompile jobs
johnomotani Jan 2, 2024
e9a9f5b
Scripts to chain precompilation with simulation run/restart submission
johnomotani Jan 2, 2024
bdc5362
Remove no-longer-necessary force exit from machine_setup_stage_two.jl
johnomotani Jan 2, 2024
59076de
Use julia-1.10 in CI
johnomotani Jan 2, 2024
c3ad03d
Fix documentation build CI job
johnomotani Jan 2, 2024
02e56ab
Relax tolerance slightly in calculus_tests
johnomotani Jan 3, 2024
3cc71dd
Move check_so_newer_than_code.jl to moment_kinetics/src/
johnomotani Jan 3, 2024
0af6118
Optimise check_so_newer_than_code()
johnomotani Jan 3, 2024
0de8dde
Check system image newer than source code when running moment_kinetics
johnomotani Jan 3, 2024
88fca48
Fix title on moment_constraints API docs page
johnomotani Jan 3, 2024
ff53e68
Fix for using default path for .julia directory
johnomotani Jan 4, 2024
391bfd8
Fix typo getting hdf5_dir
johnomotani Jan 4, 2024
1a03998
Fix prompt for BUILDHDF5
johnomotani Jan 4, 2024
de2d60c
Update test commands in docs for new package structure
johnomotani Jan 4, 2024
523dca9
Fix debug tests so that they can run from top-level project
johnomotani Jan 5, 2024
6fb0a09
Fix vperp inputs in `util/precompile_run.jl`
johnomotani Jan 7, 2024
70665a3
Increase nelement to 3 in `util/precompile_run.jl`
johnomotani Jan 7, 2024
1f0f3d0
Run with Fokker-Planck collision operator in `util/precompile_run.jl`
johnomotani Jan 7, 2024
086dd47
Merge branch 'geometry-upgrade' into separate-postprocessing-packages…
johnomotani Feb 1, 2024
054431b
Don't make bin/julia a symlink when enabling plots_post_processing
johnomotani Feb 1, 2024
c0bf27f
Restore split into separate get_geometry() and get_composition()
johnomotani Feb 1, 2024
6e9e2e3
Fix export of get_geometry() and get_composition()
johnomotani Feb 2, 2024
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
16 changes: 6 additions & 10 deletions .github/workflows/debug_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,23 @@ jobs:
- uses: mpi4py/setup-mpi@v1
with:
mpi: 'openmpi'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: julia-actions/setup-julia@v1
with:
version: '1.8'
version: '1.10'
arch: x64
- uses: julia-actions/julia-buildpkg@v1
env:
# Use the system Python for PyCall - avoids library linking error on macOS
PYTHON: "${{ env.pythonLocation }}/bin/python"
with:
project: 'moment_kinetics/'
- name: Debug test
run: |
cd moment_kinetics

# Hard code the debug level so that we can run without using the
# `--compiled-modules=no` flag, which breaks Symbolics.jl at the
# moment.
sed -i -e "s/_debug_level = get_options.*/_debug_level = 2/" src/debugging.jl

pip3 install --user matplotlib
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()'
julia --project -e 'using Pkg; Pkg.build("MPI"; verbose=true)'
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary(); using Pkg; Pkg.precompile()'

# Need to use openmpi so that the following arguments work:
# * `--mca rmaps_base_oversubscribe 1` allows oversubscription (more processes
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1.8'
version: '1.10'
- name: Install dependencies
run: |
pip3 install --user matplotlib
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Authenticate with GitHub Actions token
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: julia-actions/setup-julia@v1
with:
version: '1.8'
version: '1.10'
arch: x64
- uses: julia-actions/julia-buildpkg@v1
env:
# Use the system Python for PyCall - avoids library linking error on macOS
PYTHON: "${{ env.pythonLocation }}/bin/python"
- name: Test examples
run: |
pip3 install --user matplotlib
touch Project.toml
julia -O3 --project -e 'import Pkg; Pkg.develop(path="moment_kinetics/"); Pkg.add("NCDatasets"); Pkg.precompile()'
# Reduce nstep for each example to 10 to avoid the CI job taking too long
julia --project -O3 -e 'using moment_kinetics; for (root, dirs, files) in walkdir("examples") for file in files if endswith(file, ".toml") filename = joinpath(root, file); println(filename); input = moment_kinetics.moment_kinetics_input.read_input_file(filename); input["nstep"] = 10; run_moment_kinetics(input) end end end'
julia -O3 --project -e 'using moment_kinetics; for (root, dirs, files) in walkdir("examples") for file in files if endswith(file, ".toml") filename = joinpath(root, file); println(filename); input = moment_kinetics.moment_kinetics_input.read_input_file(filename); input["nstep"] = 10; run_moment_kinetics(input) end end end'
20 changes: 7 additions & 13 deletions .github/workflows/longtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: julia-actions/setup-julia@v1
with:
version: '1.8'
version: '1.10'
arch: x64
- uses: julia-actions/julia-buildpkg@v1
env:
# Use the system Python for PyCall - avoids library linking error on macOS
PYTHON: "${{ env.pythonLocation }}/bin/python"
# The following is copied and simplified from
# https://github.com/julia-actions/julia-runtest/blob/master/action.yml
# in order to pass customised arguments to `Pkg.test()`
#
with:
project: 'moment_kinetics/'
# The following is copied and simplified from
# https://github.com/julia-actions/julia-runtest/blob/master/action.yml
# in order to pass customised arguments to `Pkg.test()`
- run: |
pip3 install --user matplotlib
julia --check-bounds=yes --color=yes --depwarn=yes --project=@. -e 'import Pkg; Pkg.test(; test_args=["--long"])'
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--long", "--force-optional-dependencies"])'
shell: bash
57 changes: 36 additions & 21 deletions .github/workflows/parallel_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,59 @@ name: Run tests in parallel
on: [push, pull_request, workflow_dispatch]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
include:
- julia_version: '1.8'
fail-fast: false
test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 120

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
with:
mpi: 'openmpi'
- uses: actions/setup-python@v4
- uses: julia-actions/setup-julia@v1
with:
python-version: '3.11'
version: '1.10'
arch: x64
- run: |
touch Project.toml
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["MPI", "MPIPreferences", "NCDatasets", "Random", "SpecialFunctions", "Test"]); Pkg.develop(path="moment_kinetics/"); using MPIPreferences; MPIPreferences.use_system_binary()'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.precompile()'
# Need to use openmpi so that the following arguments work:
# * `--mca rmaps_base_oversubscribe 1` allows oversubscription (more processes
# than physical cores).
# * `--mca mpi_yield_when_idle 1` changes a setting to prevent excessively
# terrible performance when oversubscribing.
mpiexec -np 3 --mca rmaps_base_oversubscribe 1 julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1 --force-optional-dependencies
mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1 --force-optional-dependencies
mpiexec -np 2 --mca rmaps_base_oversubscribe 1 julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1 --long --force-optional-dependencies
# 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

# macOS is slow at the moment, so only run one set of parallel tests
test-macOS:
runs-on: macOS-latest
timeout-minutes: 120

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
with:
mpi: 'openmpi'
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia_version }}
version: '1.10'
arch: x64
- uses: julia-actions/julia-buildpkg@v1
env:
# Use the system Python for PyCall - avoids library linking error on macOS
PYTHON: "${{ env.pythonLocation }}/bin/python"
- run: |
pip3 install --user matplotlib
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()'
julia --project -e 'using Pkg; Pkg.build("MPI"; verbose=true)'
touch Project.toml
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.add(["MPI", "MPIPreferences", "NCDatasets", "Random", "SpecialFunctions", "Test"]); Pkg.develop(path="moment_kinetics/"); using MPIPreferences; MPIPreferences.use_system_binary()'
julia --project -O3 --check-bounds=no -e 'import Pkg; Pkg.precompile()'
# Need to use openmpi so that the following arguments work:
# * `--mca rmaps_base_oversubscribe 1` allows oversubscription (more processes
# than physical cores).
# * `--mca mpi_yield_when_idle 1` changes a setting to prevent excessively
# terrible performance when oversubscribing.
mpiexec -np 3 --mca rmaps_base_oversubscribe 1 julia --project=@. -O3 --check-bounds=no test/runtests.jl --debug 1
mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project=@. -O3 --check-bounds=no test/runtests.jl --debug 1
mpiexec -np 2 --mca rmaps_base_oversubscribe 1 julia --project=@. -O3 --check-bounds=no test/runtests.jl --debug 1 --long
mpiexec -np 4 --mca rmaps_base_oversubscribe 1 julia --project -O3 --check-bounds=no moment_kinetics/test/runtests.jl --debug 1 --force-optional-dependencies
# 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
17 changes: 8 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: julia-actions/setup-julia@v1
with:
version: '1.8'
version: '1.10'
arch: x64
- uses: julia-actions/julia-buildpkg@v1
env:
# Use the system Python for PyCall - avoids library linking error on macOS
PYTHON: "${{ env.pythonLocation }}/bin/python"
with:
project: 'moment_kinetics/'
# The following is copied and simplified from
# https://github.com/julia-actions/julia-runtest/blob/master/action.yml
# in order to pass customised arguments to `Pkg.test()`
- run: |
pip3 install --user matplotlib
- uses: julia-actions/julia-runtest@v1
julia --check-bounds=yes --color=yes --depwarn=yes --project=moment_kinetics/ -e 'import Pkg; Pkg.test(; test_args=["--force-optional-dependencies"])'
shell: bash
26 changes: 21 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@
performance-tests/config.toml
Manifest.toml
LocalPreferences.toml
/Project.toml
/makie_post_processing/Project.toml
/plots_post_processing/Project.toml
/julia.env
bin
machines/shared/compile_dependencies.sh
machines/shared/machine_setup_stage_two.jl
machines/artifacts
/.julia
/bin
/machines/shared/compile_dependencies.sh
/machines/artifacts
/machines/generic-batch
/precompile-makie-post-processing-submit.sh
/precompile-plots-post-processing-submit.sh
/precompile-submit.sh
/submit-restart.sh
/submit-run.sh
/submit-precompile-and-restart.sh
/submit-precompile-and-run.sh
/.julia_default.txt
/.julia_directory_default.txt
/.this_machine_name.txt
moment_kinetics.so
makie_postproc.so
plots_postproc.so
precompile-temp
post_processing_input.toml
post_processing_input.toml
Loading
Loading