Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
304 commits
Select commit Hold shift + click to select a range
a17ff9b
#1623 Added loop-fusion and OpenMP script.
hiker Aug 29, 2023
0329558
#1623 Renamed files to follow LFRic naming scheme.
hiker Aug 29, 2023
6bcff21
#1623 Re-added W0 kernel so that we can actually see a halo exchange …
hiker Aug 29, 2023
d897d28
#1623 Removed w0 kernel, it would create problems with OpenMP later.
hiker Aug 29, 2023
b7f89f3
#1623 Added instructions for OpenMP.
hiker Aug 29, 2023
6c9af6f
#1623 Simplified code and fixed typo.
hiker Aug 29, 2023
08ba032
#1623 Added example for script failure.
hiker Aug 29, 2023
d261bc9
#1623 Properly introduce the errors.
hiker Aug 29, 2023
8c3c128
#1623 Fixed layout.
hiker Aug 29, 2023
c245595
#1623 Improved documentation, added example for MPI support.
hiker Sep 1, 2023
4f42401
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Sep 1, 2023
b068e0f
#1623 Add testing including compilation testing, integrated into gith…
hiker Sep 1, 2023
6e82347
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Sep 1, 2023
0c83949
#1623 Fix incorrect filename in PSyclone command.
hiker Sep 4, 2023
22f04f5
#1623 Fixed more typos.
hiker Sep 4, 2023
88e5500
#1623 Change kernel to use fields on W3 and W0, which should allow us…
hiker Sep 5, 2023
f85b7c4
#1623 Restructured README to have better sections and links to the so…
hiker Sep 5, 2023
ce6cde7
#1623 Renamed testkern_w3 to symmation_w0_to_w3.
hiker Sep 5, 2023
a6df9cd
#1623 Start to move each hands-on section into its own subdirectory.
hiker Sep 5, 2023
52846e3
#1623 Added two more sections.
hiker Sep 5, 2023
fd2f9fe
#1623 Added error examples.
hiker Sep 5, 2023
0f95550
#1623 Add example of incorrect kernel naming.
hiker Sep 6, 2023
c8bf900
#1623 Removed now unnecessary files in base directory.
hiker Sep 6, 2023
d19a6d7
#1623 Fixed CI for all tests.
hiker Sep 6, 2023
565568d
#1623 Updated (c).
hiker Sep 6, 2023
dbad8ea
Support compile and clean targets, remove unnecessary compilation cod…
hiker Sep 6, 2023
73cce34
#1623 Added some diagrams.
hiker Sep 6, 2023
697ee23
#1623 Try to adjust image size.
hiker Sep 6, 2023
71d7edc
#1623 Try to adjust image size (2).
hiker Sep 6, 2023
09dc4ea
#1623 Try to adjust image size (3) - this time by just providing smal…
hiker Sep 6, 2023
794caf0
#1623 Try to adjust image size (4) - this time by just providing smal…
hiker Sep 6, 2023
923c304
#1623 Fixed png filenames.
hiker Sep 6, 2023
3898a0c
#1623 Updated SVG files as source files for the PNGs.
hiker Sep 6, 2023
ec4323a
#1623 Removed loop fusion and fixed typo in ecxample 3.
hiker Sep 6, 2023
f9db03f
#1623 Fixed typos in README.
hiker Oct 4, 2023
4d6a139
#1623 Replaced the word 'solution' with 'explanation'.
hiker Oct 4, 2023
366c567
#1623 Print thread information for OpenMP example, updated docs.
hiker Oct 4, 2023
d76e1d2
#1623 Added optional colouring example.
hiker Oct 5, 2023
1ad14b4
#1623 Updated documentation.
hiker Oct 5, 2023
775af00
#1623 Add better explanation of omp output.
hiker Oct 5, 2023
0afe1b2
#1623 Fixed layout problem.
hiker Oct 5, 2023
7171968
#1623 Fixed layout problem ... again.
hiker Oct 5, 2023
2cd17d0
Added link to colouring in dev guide.
hiker Oct 5, 2023
1858ef1
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Jan 2, 2024
366184d
#1623 Added separate solution for first example, and removed code tha…
hiker Jan 3, 2024
0c2c00a
#1623 Fixed nan script to apply nan outside of outer loop, not in the…
hiker Jan 3, 2024
f4932c4
#1623 Updated Makefiles to work properly, use preprocessing to have d…
hiker Jan 3, 2024
0bacd7c
#1623 Added solution for psydata training.
hiker Jan 3, 2024
c7c980f
#1623 Use 'only' when importing the dl_esm_info modules.
hiker Jan 5, 2024
fcb03ee
#1623 Update 2.4 kernels to latest version, ignore gol_lib for 2.4
hiker Jan 5, 2024
8c3a8bd
#1623 Updated solution for 2.4 to latest version.
hiker Jan 5, 2024
ba26a12
#1623 Updated the templates to be in sync with the training, i.e. rem…
hiker Jan 5, 2024
a9a62c7
#1623 Run the solutions Makefile of all tutorials.
hiker Jan 10, 2024
dc83dd2
#1623 Updated README.
hiker Jan 11, 2024
eb0cf10
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Jan 30, 2024
8df0a39
#1623 Added solution directory for MPI, fixed psydata solution Makefile.
hiker Jan 31, 2024
e6ef4f0
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Feb 1, 2024
2c1cdc3
#1623 Added example of setting omp schedule.
hiker Feb 2, 2024
933ad37
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Feb 8, 2024
6b37a2a
#1623 Updates LFRic user training to work with latest PSyclone (which…
hiker Feb 8, 2024
35824f3
#1623 Fixed some typos.
hiker Feb 8, 2024
0f116dd
#1623 Fixed more typos.
hiker Feb 8, 2024
6d1e34c
#1623 Ignore automatically created file in solution subdirectories.
hiker Feb 9, 2024
6b22bd7
#1623 Start to change order of PSydata and MPI.
hiker Feb 9, 2024
d5bb666
#1623 Finished switching order of PSyData and MPI.
hiker Feb 9, 2024
fdcd259
#1623 Updated dl_esm_info to latest version to get the new MPI functi…
hiker Feb 13, 2024
051b23d
#1623 Update dl_esm_inf path to point to the new included version.
hiker Feb 13, 2024
33f5598
#1623 Removed debug output.
hiker Feb 13, 2024
688c4ae
#1623 Also clean the solution directories.
hiker Feb 13, 2024
1fe67d6
#1623 Try to make the test independent of compiler version (intel add…
hiker Feb 13, 2024
ccc8cb4
#1623 Add hands-on session for more intelligent script.
hiker Feb 13, 2024
1ea459d
#1623 Also fuse inner loops.
hiker Feb 13, 2024
c333d63
#1623 Simplified first task to be in sync with presentation.
hiker Feb 15, 2024
fe74589
#1623 Added ugly workaround of diabling test due to a known loop fusi…
hiker Feb 16, 2024
fa0b4f0
#1623 Updated 2.4.
hiker Feb 16, 2024
751350f
#1623 Add explicit config file parameter.
hiker Feb 16, 2024
9ddee20
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Feb 16, 2024
102050f
#1623 Use better name for input parameter.
hiker Feb 19, 2024
b7af072
#1623 Added better TODO for compute_born.
hiker Feb 19, 2024
b1c4c63
#1623 Use better names, not just c.
hiker Feb 19, 2024
fc30bea
#1623 Removed unused inline.py script.
hiker Feb 19, 2024
40e6837
#1623 Updated README.
hiker Feb 19, 2024
40c8fa5
#1623 Remove the working code, added TODOs.
hiker Feb 20, 2024
fc1c3fe
Merge branch '257_verify_loop_fusion' into 1623_add_training
hiker Feb 20, 2024
85095b4
#1623 Updated details about loop fusion now correctly failing.
hiker Feb 20, 2024
b5999a4
#1623 Updated training templates and solution, removed task parallelism.
hiker Feb 21, 2024
27194b4
#1623 Fixed pylint warning (the rest is unavoidable).
hiker Feb 21, 2024
19bee75
#1623 Fixed templates, added new script, updated README.
hiker Feb 21, 2024
e8deeec
#1623 More updates to handson.
hiker Feb 21, 2024
0a8df3b
#1623 Display schedule before the error happens.
hiker Feb 23, 2024
533fcbc
#1623 Made comparisons in README clearer.
hiker Feb 27, 2024
b416af9
1623 Remove example 7, which is too difficult.
hiker Mar 19, 2024
fe5dcd8
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Apr 9, 2024
81fd81c
#2049 Moved write_driver into base class.
hiker May 29, 2024
287419f
#2049 Moved get_driver_as_string to base class, meaning gocean driver…
hiker May 30, 2024
b64217a
#2049 Add a compilation test of the gocean driver (works only with mp…
hiker May 30, 2024
cb863c6
#2049 Updated gocean extract example to work with inlining.
hiker May 30, 2024
bbdba64
#2049 Moved flatten_signature to base class.
hiker May 30, 2024
be81aec
#2049 Moved some tests.
hiker May 30, 2024
2ea3ae9
#2049 Moved import_modules into base class.
hiker May 30, 2024
5df947d
#2049 Start to move add_all_kernel_symbols to the base class.
hiker May 31, 2024
488ae3d
#2049 Fixed tests and error in logic.
hiker Jun 3, 2024
92722a6
#2049 Moved rest of add_all_kernel_symbols to base class.
hiker Jun 3, 2024
44d4d2b
#2049 Import go_wp for gocean driver.
hiker Jun 3, 2024
ff148a0
Merge branch '1992_mpi_support_for_extraction' into 2049_driver_basec…
hiker Jun 19, 2024
23696d9
#2049 Fix failing test.
hiker Jun 19, 2024
767425d
Merge branch '1992_mpi_support_for_extraction' into 2049_driver_basec…
hiker Jun 24, 2024
304a570
Merge branch '1992_mpi_support_for_extraction' into 2049_driver_basec…
hiker Jul 4, 2024
b376483
Merge branch '1992_mpi_support_for_extraction' into 2049_driver_basec…
hiker Jul 8, 2024
6711833
Merge branch '1992_mpi_support_for_extraction' into 2049_driver_basec…
hiker Jul 9, 2024
fdc038c
Merge remote-tracking branch 'origin/master' into 2049_driver_baseclass
hiker Jul 11, 2024
755d1da
Merge remote-tracking branch 'origin/master' into 2049_driver_baseclass
hiker Aug 2, 2024
0147782
Merge remote-tracking branch 'origin/1623_add_training' into 1623_add…
hiker Aug 18, 2024
08fdf88
Merge branch '257_verify_loop_fusion' into 1623_add_training
hiker Sep 9, 2024
d8c1e97
Merge branch '2690_value_verification' into 1623_add_training
hiker Sep 9, 2024
64456e8
#1623 Started to support new value_range_check library.
hiker Sep 9, 2024
346b298
Merge branch '2690_value_verification' into 1623_add_training
hiker Sep 9, 2024
fc53fa1
Merge branch '2690_value_verification' into 1623_add_training
hiker Sep 9, 2024
0f84ff5
#1623 Add ValueRangeCheck example instead of (just) NAN testing.
hiker Sep 9, 2024
281abc7
#1623 Updates to profiling example.
hiker Sep 9, 2024
6263243
Merge branch '2049_driver_baseclass' into 1623_add_training
hiker Sep 9, 2024
997e7ec
#1623 Updated user training to use new PSyclone option --api lfric.
hiker Sep 10, 2024
1a885d8
#1623 Updated of extraction code to work with new lib names, remove s…
hiker Sep 11, 2024
8f5df7d
#1623 Add first version of transformation example.
hiker Sep 11, 2024
7c2e854
#1623 Fix outdated instruction.
hiker Sep 11, 2024
fdcbcba
#1623 Make standard clean target to clean using all other Makefiles.
hiker Sep 11, 2024
b2e734b
#1623 Remove working code and add instructions what to do.
hiker Sep 11, 2024
0da6b11
#1623 Updated gitignore file.
hiker Sep 11, 2024
887f763
#1623 Added second omp example.
hiker Sep 11, 2024
2c2ef99
#1623 Removed unnecessary code.
hiker Sep 12, 2024
7597f95
#1623 Updated example 3.2
hiker Sep 12, 2024
2a223d7
#1623 Fix bug that caused the backend disable validation flag to fail…
hiker Sep 12, 2024
3b2c6ef
#1623 Add inlining & move example [skip ci]
hiker Sep 12, 2024
00276a3
#1623 Updated template for 3.4.
hiker Sep 14, 2024
b0d4e46
#1623 Clean all by default.
hiker Sep 14, 2024
bd679ce
#1623 Add sympy/varinfo example [skip ci]
hiker Sep 14, 2024
3820bf7
#1623 Added first LFRic example.
hiker Sep 16, 2024
ef30b89
#1623 Added full solution for 3.4.
hiker Sep 16, 2024
952bbba
#1623 Added openmp transformation.
hiker Sep 16, 2024
97014dd
#1623 Updated (c) [skip ci]
hiker Sep 16, 2024
8d38774
#1623 Added missing -api parameter in README for the user training.
hiker Sep 17, 2024
11430e3
#1623 Fixed examples (loop fuse was incorrect).
hiker Sep 17, 2024
f6e2fba
#1623 Added readme and graphics to LFRic example 4.2.
hiker Sep 17, 2024
46517f6
#1623 Added transform to phony.
hiker Sep 19, 2024
1e55e44
Fixed makefile for 2.18
hiker Sep 20, 2024
965fd81
Added missing file.
hiker Sep 20, 2024
64927b1
Added dependency on script for psyclone transformation.
hiker Sep 20, 2024
fea06cf
Added missing TODO comments.
hiker Sep 20, 2024
a099e04
#1623 Fixed error in script [skip-ci]
hiker Sep 20, 2024
dfb299e
#1623 Add colouring example.
hiker Oct 16, 2024
79667ff
#1623 Fixed missing makefile dependencies.
hiker Oct 17, 2024
2cbf3d0
#1623 Minor updates done during training.
hiker Oct 18, 2024
3661959
Merge branch '1623_add_training' of github.com:stfc/PSyclone into 162…
hiker Dec 9, 2024
6b93d3c
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Jan 6, 2025
42eafc2
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Jan 10, 2025
e88d9c8
#1623 Fixed script that moved the output step and therefore produced …
hiker Jan 10, 2025
8c8a21f
#1623 Improved functionality of parent makefiles.
hiker Jan 10, 2025
6cb191a
#1623 Update to new command line syntax.
hiker Jan 10, 2025
5f5d0b6
#1623 Trigger all tests from higher-level makefiles.
hiker Jan 10, 2025
7415ff7
#1623 New psyclone command line options.
hiker Jan 10, 2025
1390792
#1623 Convert example 2.6 to use new trans parameters.
hiker Jan 10, 2025
b65df65
#1623 Fix minor issues.
hiker Jan 10, 2025
a86daeb
#1623 Fix minor documentation error.
hiker Jan 10, 2025
3c5f148
#1623 Fixed doxygen docs.
hiker Jan 10, 2025
1c5532d
#1623 Minor updates.
hiker Jan 12, 2025
2369852
#1623 Updated user training to psyclone 3.0
hiker Jan 12, 2025
3723e9c
#1623 Added missing psykal-dsl option.
hiker Jan 13, 2025
f93bbbd
#1623 Provide --config option so that training works in editable envi…
hiker Jan 13, 2025
bbbc73b
#1623 Minor updates to example.
hiker Jan 13, 2025
1ac47d5
#1623 Updated examples 2.8 to new trans arguments.
hiker Jan 13, 2025
a6f3fa3
#1623 Updated more scripts to new parameter.
hiker Jan 13, 2025
7801f27
#1623 Updated example 2.12.
hiker Jan 14, 2025
2e0c905
#1623 Updated example 2.18 to new trans parameter.
hiker Jan 14, 2025
cbe37b4
#1623 Clean psydata libraries as well in allclean.
hiker Jan 15, 2025
ec96efd
#1623 Updated psyclone scripts.
hiker Jan 16, 2025
faa7f4f
#1623 Trigger psyclone on script change, minor script updates.
hiker Jan 17, 2025
57e938b
#1623 Add documentation of the kernel parameters.
hiker Jan 17, 2025
856dab3
#1623 Use common.mk, tests both scripts.
hiker Jan 17, 2025
f0fdcc6
#1623 Added a temporary example that does full GOCean kernel inlining…
hiker Jan 20, 2025
8d38d28
#1623 Updated example trans to dynamically try to detect fields that …
hiker Jan 23, 2025
9bd91d3
Merge remote-tracking branch 'origin/1623_add_training' into 1623_add…
hiker Feb 1, 2025
64ec77a
#1623 Updated various READMEs.
hiker Mar 10, 2025
5797ec3
#1623 Updated sympy example.
hiker Mar 11, 2025
0ae2c15
#1623 More minor fixes.
hiker Mar 11, 2025
3337eb7
#1623 Added dataflow graph to README.
hiker Mar 12, 2025
cf4cc5c
#1623 Fixed testing of trainings material.
hiker Mar 12, 2025
5c7d954
#1623 Updated Makefiles and readme.
hiker Mar 12, 2025
f27f72a
Merge branch '1623_add_training' of github.com:stfc/PSyclone into 162…
hiker Mar 13, 2025
c318e68
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Mar 13, 2025
5e93fc8
#1623 Added missing cleaning of gol-lib.
hiker Mar 13, 2025
d6b61fc
#1623 Added missing import or InvokeSchedule.
hiker Apr 21, 2025
7ac6f35
#1623 Finished openacc example.
hiker Apr 21, 2025
ec6ac18
#1623 Remove schedule view from loop fuse script.
hiker Apr 21, 2025
ced3c01
#1623 Added temporary fix for #2732.
hiker Apr 21, 2025
1543b65
#1623 Started to add openp offload example.
hiker Apr 22, 2025
492a52b
#1623 Updated flags for nvidia omp offloading.
hiker Apr 22, 2025
c1b4df6
#1623 Add README, create a template for hands-on, and update solution.
hiker Apr 22, 2025
2ed85a0
#1623 Fix minor styling errors.
hiker Apr 22, 2025
d550cc2
#1623 Replace iargc with command_argument_count to the code works wit…
hiker Apr 22, 2025
0bc7c87
Merge branch '1623_add_training' of github.com:stfc/PSyclone into 162…
hiker Apr 22, 2025
7c1e5e8
#1623 Fix user training to work with new element order.
hiker Apr 23, 2025
0f0242f
#1623 Fixed lfric part of the advanced training.
hiker Apr 23, 2025
8398cbd
#1623 Added pure to kernels to fix some OpenACC issues.
hiker Apr 23, 2025
d997b23
#1623 Removed incorrect 'return' statement.
hiker Apr 24, 2025
c67b6dc
#1623 Use env instead of hardcoded python3 path
hiker Apr 24, 2025
ab64c77
#1623 Fixed incorrect field names.
hiker Apr 24, 2025
a77a8d0
#1623 Fixed layout.
hiker Apr 24, 2025
f087de0
#1623 Fixed incorrect field names.
hiker Apr 24, 2025
1cbc56f
#1623 Removed debug output.
hiker Apr 29, 2025
4a5a44d
t fsckMerge branch '1623_add_training' of github.com:stfc/PSyclone in…
hiker Jun 26, 2025
919cca7
Merge remote-tracking branch 'origin/master' into 1623_add_training […
hiker Sep 10, 2025
3c8aafa
Merge branch '2049_improved_driver_base_class' into 1623_add_training
hiker Sep 18, 2025
769583e
#1623 Fixed warnings in LFRic examples.
hiker Sep 18, 2025
b8d42ae
#1623 Updated lfric user training to use new infrastructure and lates…
hiker Sep 18, 2025
215d727
#1623 Updated LFRic examples to work with new infrastructure and PSyc…
hiker Sep 19, 2025
e87166c
#1623 Updated var access and dataflow graph to use latest PSyclone.
hiker Sep 21, 2025
19b0760
#1623 Removed unnecessary use statement.
hiker Sep 21, 2025
5713f4f
#1623 Fix transformation examples.
hiker Sep 21, 2025
ceab559
#1623 Test all scripts.
hiker Sep 21, 2025
c00d659
#1623 Fixed flake8 issues and other outdated code structures for goce…
hiker Sep 22, 2025
2e063c7
#1623 Fix typo in directory name (which means this example was not te…
hiker Sep 22, 2025
1c8493d
#1623 Renamed examples to be consistent and triggered when testing.
hiker Sep 22, 2025
b66524c
#1623 Fixed lfric examples.
hiker Sep 22, 2025
3b68646
#1623 Moved to 'new' psyir parameters in transformations.
hiker Sep 22, 2025
38ab9a6
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Sep 22, 2025
1b43159
#1623 More conversion of legacy psy parameter to psyir.
hiker Sep 22, 2025
914aef0
#1623 Updated (c) to 2025
hiker Sep 22, 2025
467e186
#1623 Fixed flake8.
hiker Sep 22, 2025
4ac3d10
#1623 Try to disable commented out link that the link checker complai…
hiker Sep 22, 2025
9bf0251
#1623 By default disable MPI compilation.
hiker Sep 22, 2025
4f3f708
#1623 Fixed incorrect link.
hiker Sep 22, 2025
ca6d55e
#1623 Try if renaming the image stops the link checker from complaining.
hiker Sep 22, 2025
c340bc6
#1623 Fix link checker again, this time I might have found the right …
hiker Sep 22, 2025
32ca776
Merge branch '2049_improved_driver_base_class' into 1623_add_training
hiker Sep 23, 2025
b84fc62
Merge branch '2049_improved_driver_base_class' into 1623_add_training
hiker Sep 29, 2025
7595775
Merge branch '2049_improved_driver_base_class' into 1623_add_training
hiker Sep 29, 2025
4a3df08
Merge branch '2049_improved_driver_base_class' into 1623_add_training
hiker Oct 3, 2025
4cbddc1
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Oct 5, 2025
de1816b
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Oct 14, 2025
63033e2
#1623 Fix flake8.
hiker Oct 14, 2025
b8f9bf1
#1623 Try to make inlining tutorial work again.
hiker Oct 16, 2025
f3643b7
#3189 Fixed handling of == in sympy.
hiker Oct 16, 2025
ac8e101
#3189 Fixed pylint and typing issues.
hiker Oct 16, 2025
10e99c6
Merge remote-tracking branch 'origin/master' into 1623_add_training
hiker Oct 17, 2025
4ce0812
Merge branch '3189_sympy_handling_equal' into 1623_add_training
hiker Oct 17, 2025
ea86d7d
#3189 Fixed typing, comments and pylint warnings.
hiker Oct 24, 2025
d995f56
Merge remote-tracking branch 'origin/master' into 3189_sympy_handling…
hiker Oct 24, 2025
89494d3
Merge branch '3189_sympy_handling_equal' into 1623_add_training
hiker Oct 28, 2025
3535d22
#1623 Updated and explained full inlining example.
hiker Oct 28, 2025
541331e
#1623 Added separate target for testing full_inlinig, and compile and…
hiker Oct 28, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
module load gcc/${GFORTRAN_VERSION} openmpi/${OPENMPI_VERSION}
module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION}
make -C tutorial/practicals compile
make -C tutorial/training/users compile
- name: Examples with compilation - nvfortran
run: |
. .runner_venv/bin/activate
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
( make -C tutorial/practicals transform > /dev/null )
# Jupyter notebooks are out-of-date
# ( make -C tutorial/notebooks notebook )
( make -C tutorial/training test)
- name: Test with pytest
if: ${{ !(matrix.python-version == '3.9') }}
run: |
Expand Down
1 change: 1 addition & 0 deletions doc/psyad/user_guide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
1 change: 0 additions & 1 deletion examples/gocean/eg5/extract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ compile: transform $(NAME) $(DRIVER_INIT).$(TYPE) $(DRIVER_UPDATE).$(TYPE)

transform: psy.f90


F90FLAGS += -I$(INF_INC) -I$(EXTRACT_DIR)

# The dependency on the extraction library here is required to trigger
Expand Down
7 changes: 0 additions & 7 deletions examples/lfric/eg17/full_example/main.x90
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,11 @@ program main
use global_mesh_mod, only: global_mesh_type
use mesh_mod, only: mesh_type, PLANE
use local_mesh_mod, only: local_mesh_type
use local_mesh_collection_mod, only: local_mesh_collection, local_mesh_collection_type
use mesh_collection_mod, only: mesh_collection, mesh_collection_type
use halo_routing_collection_mod, only: halo_routing_collection_type, &
halo_routing_collection
use function_space_collection_mod, only: function_space_collection_type, &
function_space_collection
use driver_collections_mod, only: init_collections

use partition_mod, only: partition_type, partitioner_planar, partitioner_interface
use extrusion_mod, only: extrusion_type, uniform_extrusion_type
use function_space_mod, only: function_space_type
use function_space_collection_mod, only: function_space_collection
use fs_continuity_mod, only: W0, W1, W2, W2V, W2H
use field_mod, only: field_type, field_proxy_type
use field_real64_mod, only : field_real64_type
Expand Down
14 changes: 5 additions & 9 deletions examples/lfric/eg17/full_example_extract/main.X90
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,11 @@ program main
use global_mesh_mod, only: global_mesh_type
use mesh_mod, only: mesh_type, PLANE
use local_mesh_mod, only: local_mesh_type
use local_mesh_collection_mod, only: local_mesh_collection, local_mesh_collection_type
use mesh_collection_mod, only: mesh_collection, mesh_collection_type
use halo_routing_collection_mod, only: halo_routing_collection_type, &
halo_routing_collection
use function_space_collection_mod, only: function_space_collection_type, &
function_space_collection
use mesh_collection_mod, only: mesh_collection
use driver_collections_mod, only: init_collections

use partition_mod, only: partition_type, partitioner_planar, partitioner_interface
use extrusion_mod, only: extrusion_type, uniform_extrusion_type
use function_space_mod, only: function_space_type
use function_space_collection_mod, only: function_space_collection
use fs_continuity_mod, only: W0, W1, W2, W2V, W2H
use field_mod, only: field_type, field_proxy_type
use field_real64_mod, only : field_real64_type
Expand Down Expand Up @@ -93,7 +86,10 @@ program main
type(field_type) :: chi(3)
real(kind=r_def) :: one
logical(kind=l_def) :: some_logical
integer :: i, ierr
integer :: i
#ifdef _MPI
integer :: ierr
#endif



Expand Down
4 changes: 3 additions & 1 deletion src/psyclone/psyir/backend/sympy_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ class SymPyWriter(FortranWriter):
{BinaryOperation.Operator.AND: "And({lhs}, {rhs})",
BinaryOperation.Operator.OR: "Or({lhs}, {rhs})",
BinaryOperation.Operator.EQV: "Equivalent({lhs}, {rhs})",
BinaryOperation.Operator.NEQV: "Xor({lhs}, {rhs})"}
BinaryOperation.Operator.NEQV: "Xor({lhs}, {rhs})",
BinaryOperation.Operator.EQ: "Eq({lhs}, {rhs})"
}

def __init__(self):
super().__init__()
Expand Down
15 changes: 11 additions & 4 deletions src/psyclone/psyir/frontend/sympy_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,36 @@ class FortranPrinter(Printer):
not handle e.g. Fortran Array expressions (a(2:5)), so we specialise the
generic SymPy Printer and handle the necessary conversions.'''

def _print_And(self, expr):
def _print_And(self, expr) -> str:
'''Called when converting an AND expression.'''
return f"({'.AND.' .join(self._print(i) for i in expr.args)})"

def _print_Or(self, expr):
def _print_Or(self, expr) -> str:
'''Called when converting an OR expression.'''
return f"({'.OR.' .join(self._print(i) for i in expr.args)})"

def _print_Equivalent(self, expr):
def _print_Equivalent(self, expr) -> str:
'''Called when converting an EQUIVALENT expression.'''
return f"({'.EQV.' .join(self._print(i) for i in expr.args)})"

def _print_Xor(self, expr):
def _print_Xor(self, expr) -> str:
'''Called when converting an XOR expression, which in Fortran
is .NEQV.'''
return f"({'.NEQV.' .join(self._print(i) for i in expr.args)})"

def _print_Equality(self, expr) -> str:
'''Called when converting an Eq expression, which in Fortran
is =='''
return f"({'==' .join(self._print(i) for i in expr.args)})"

def _print_BooleanTrue(self, expr) -> str:
'''Called when converting a SymPy value of True.'''
# pylint: disable=unused-argument
return ".TRUE."

def _print_BooleanFalse(self, expr) -> str:
'''Called when converting a SymPy value of False.'''
# pylint: disable=unused-argument
return ".FALSE."


Expand Down
6 changes: 5 additions & 1 deletion src/psyclone/tests/core/symbolic_maths_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ def test_symbolic_math_use_range(fortran_reader, expressions):
"norm_u(idx + iw2) * u_e(idx - iw2v + LBOUND(u_e, 1),df2)"),
(".true. .and. .false.", ".false."),
("zh_cum1(jk1) <= zh_cum0(jk0) .AND. zh_cum1(jk1) > zh_cum0(jk0 - 1)",
"zh_cum0(jk0) >= zh_cum1(jk1) .AND. zh_cum1(jk1) > zh_cum0(jk0 - 1)")])
"zh_cum0(jk0) >= zh_cum1(jk1) .AND. zh_cum1(jk1) > zh_cum0(jk0 - 1)"),
("zh_cum1(jk1) == zh_cum0(jk0) .AND. zh_cum1(jk1) == zh_cum0(jk0 - 1)",
"zh_cum0(jk0) == zh_cum1(jk1) .AND. zh_cum1(jk1) == zh_cum0(jk0 - 1)"),
("i == i .and. c(i,i) == 5", "c(i,i) == 5"),
])
def test_symbolic_maths_expand(fortran_reader, fortran_writer, expr, expected):
'''Test the expand method works as expected.'''
# A dummy program to easily create the PSyIR for the
Expand Down
15 changes: 15 additions & 0 deletions src/psyclone/tests/domain/common/driver_creator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@
from psyclone.tests.utilities import Compile, get_invoke


# ----------------------------------------------------------------------------
def test_lfric_driver_valid_unit_name():
'''Tests that we create valid unit names, i.e. less than 64 characters,
and no ":" in name.'''

long_name = "A"*100
new_name = DriverCreator._make_valid_unit_name(long_name)
assert new_name == "A"*63

special_characters = "aaa-bbb"
new_name = DriverCreator._make_valid_unit_name(special_characters)
assert new_name == "aaabbb"


# ----------------------------------------------------------------------------
def test_basic_driver_add_call(fortran_writer):
'''Tests that adding a call detects errors and adds calls
with and without parameters as expected.
Expand Down
34 changes: 19 additions & 15 deletions src/psyclone/tests/psyir/backend/sympy_writer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from sympy import Function, Symbol
from sympy.parsing.sympy_parser import parse_expr

from psyclone.psyir.frontend.fortran import FortranReader
from psyclone.psyir.frontend.sympy_reader import SymPyReader
from psyclone.psyir.backend.sympy_writer import SymPyWriter
from psyclone.psyir.backend.visitor import VisitorError
Expand Down Expand Up @@ -256,7 +257,7 @@ def test_sym_writer_rename_members(fortran_reader, expressions):


@pytest.mark.parametrize(
"expr, positive, sym_map",
"expr, positive, expected_sym_map",
[("a%x", False, {"a_x": Symbol("a%x")}),
("a%x", True, {"a_x": Symbol("a%x", **{"positive": True})}),
("a%x(i)", False, {"a_x": Function("a_x"), "i": Symbol("i")}),
Expand All @@ -269,11 +270,15 @@ def test_sym_writer_rename_members(fortran_reader, expressions):
"b_c": Function("b_c"),
"i": Symbol("i", **{"positive": True})}),
])
def test_sym_writer_symbol_types(fortran_reader, expr, positive, sym_map):
def test_sym_writer_symbol_types(fortran_reader: FortranReader,
expr: str,
positive: bool,
expected_sym_map: dict[str, Symbol]):
'''Tests that arrays are detected as SymPy functions, and scalars
as SymPy symbols. The 'expr' parameter contains the expression to parse,
'positive' is whether or not to flag symbols as positive definite and
'sym_map' is the expected mapping of names to SymPy functions or symbols.
'expected_sym_map' is the expected mapping of names to SymPy functions
or symbols.

'''
# A dummy program to easily create the PSyIR for the
Expand All @@ -286,12 +291,12 @@ def test_sym_writer_symbol_types(fortran_reader, expr, positive, sym_map):
end program test_prog '''

psyir = fortran_reader.psyir_from_source(source)
expr = psyir.children[0].children[0].rhs
expr_psyir = psyir.children[0].children[0].rhs
sympy_writer = SymPyWriter()
_ = sympy_writer(expr, all_variables_positive=positive)
assert len(sympy_writer.type_map) == len(sym_map)
for key in sympy_writer.type_map.keys():
assert sympy_writer.type_map[key] == sym_map[key]
_ = sympy_writer(expr_psyir, all_variables_positive=positive)
assert len(sympy_writer.type_map) == len(expected_sym_map)
for key, sym_map in sympy_writer.type_map.items():
assert sym_map == expected_sym_map[key]


@pytest.mark.parametrize("expr, sym_map",
Expand Down Expand Up @@ -517,14 +522,13 @@ def test_sympy_writer_user_types(fortran_reader, fortran_writer,
("a .or. b", "Or(a, b)"),
("a .eqv. b", "Equivalent(a, b)"),
("a .neqv. b", "Xor(a, b)"),
("a == b", "Eq(a, b)"),
])
def test_sympy_writer_logicals(fortran_reader, fortran_writer,
fortran_expr, sympy_str):
'''Test handling of user-defined types, e.g. conversion of
``a(i)%b(j)`` to ``a_b(i,i,1,j,j,1)``. Each Fortran expression
``fortran_expr`` is first converted to a string ``sympy_str`` to be
parsed by SymPy. The sympy expression is then converted back to PSyIR.
This string must be the same as the original ``fortran_expr``.
def test_sympy_writer_logicals(fortran_reader: FortranReader,
fortran_expr: str,
sympy_str: str):
'''Test writing of logical expressions, i.e. that the Fortran
logical expressions are correctly converted to SymPy expressions.

'''
source = f'''program test_prog
Expand Down
9 changes: 7 additions & 2 deletions src/psyclone/tests/psyir/frontend/sympy_reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

import pytest

from psyclone.psyir.backend.fortran import FortranWriter
from psyclone.psyir.backend.sympy_writer import SymPyWriter
from psyclone.psyir.frontend.fortran import FortranReader
from psyclone.psyir.frontend.sympy_reader import SymPyReader


Expand Down Expand Up @@ -88,9 +90,12 @@ def test_sympy_reader_constructor():
(".TRUE. .and. .true.", ".true."),
(".TRUE. .AND. .FALSE.",
".false."),
("b(i) == 3 .and. c(i,i) == 5",
"b(i) == 3 .AND. c(i,i) == 5"),
])
def test_sympy_psyir_from_expression(fortran_reader, fortran_writer,
expressions):
def test_sympy_psyir_from_expression(fortran_reader: FortranReader,
fortran_writer: FortranWriter,
expressions: tuple[str, str]):
'''Test conversion from a SymPy expression back to PSyIR. We use the
SymPyWriter to convert the Fortran string to a SymPy expression (we need
a symbol table to convert from SymPy to PSyIR, which we get this way
Expand Down
53 changes: 53 additions & 0 deletions tutorial/training/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2023-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Author: J. Henrichs, Bureau of Meteorology


test:
$(MAKE) -C users test
$(MAKE) -C gocean test
$(MAKE) -C lfric test
$(MAKE) -C transformation test

compile:
$(MAKE) -C users compile
$(MAKE) -C gocean compile
$(MAKE) -C lfric compile
$(MAKE) -C transformation compile

clean:
$(MAKE) -C users clean
$(MAKE) -C gocean clean
$(MAKE) -C lfric clean
$(MAKE) -C transformation clean
5 changes: 5 additions & 0 deletions tutorial/training/gocean/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
gol
2*/time_step_alg_mod.f90
2*/time_step_alg_mod_psy.f90
2*/solution/time_step_alg_mod.f90
2*/solution/time_step_alg_mod_psy.f90
33 changes: 33 additions & 0 deletions tutorial/training/gocean/2.10-GameOfLife-mpi/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
EXE = gol
API = gocean
MPI = no
F90 = mpif90

OBJ = time_step_alg_mod.o time_step_alg_mod_psy.o

include ../common.mk

$(EXE): $(OBJ)
$(F90) $(F90FLAGS) $(OBJ) $(LDFLAGS) -o $(EXE)

run: $(EXE)
mpirun -np 4 ./$(EXE) ../gol-lib/config.glider

# Call the default test (which checks the output file), but do a second test to make
# sure we get a 2x2 domain decomposition, otherwise the job was not running properly
# with MPI
test: test-default
@bash -c "if [[ $$(make run | grep -c 'go_decompose: using grid of 2x 2') != 1 ]]; then \
echo 'Job is not running properly with MPI'; \
fi"


# Dependencies:
# -------------
# Ensure that PSyclone has finished (which will also create the psy file)
time_step_alg_mod_psy.f90: time_step_alg_mod.f90
time_step_alg_mod.o: time_step_alg_mod_psy.o

# PSyclone: create alg and psy layer files:
%.f90: %.x90 Makefile
$(PSYCLONE) -oalg $*.f90 -opsy $*_psy.f90 $<
Loading
Loading