-
Notifications
You must be signed in to change notification settings - Fork 39
IO_Demo benchmarking configuration #232
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
Open
EdHone
wants to merge
20
commits into
MetOffice:main
Choose a base branch
from
EdHone:216-iodemo-bench-vernier
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
51ad658
Add source code changes from previous Trac branch
EdHone e51a8cc
Remove old timer implementation
EdHone 3569a1a
Bring in metadata from previous branch
EdHone dae42a7
Use 'native' Fortran sleep
EdHone 3a97bd1
Fix upgrade macro
EdHone d1b0048
Macro whitespace
EdHone 30f3842
Macro whitespace
EdHone 5c9f123
Manual implementation of metadata - test suite runs but tests broken
EdHone 8149534
Fix metadata issues
EdHone 073c302
Fix builds and suite running
EdHone 90d94df
small benchmark cases in developer suite
EdHone 250ce13
Interim test configs working
EdHone c58ff99
Working tests for benchmark case
EdHone e078f19
Clean up branch
EdHone ec5a07b
Fixes for developer suite
EdHone 6747bc8
Final implementation
EdHone 07f3b88
change vernieer output mode
EdHone 2974558
RW comments - new namelist API and rose metadata triggers
EdHone f489e4c
More efficient function space assignment
EdHone cc89e8a
fix indentation
EdHone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 29 additions & 1 deletion
30
applications/io_demo/rose-meta/lfric-io_demo/HEAD/rose-meta.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
applications/io_demo/source/driver/io_benchmark/io_benchmark_setup_mod.f90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,110 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! (C) Crown copyright Met Office. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! The file LICENCE, distributed with this code, contains details of the terms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! under which the code may be used. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !> @brief Setup infrastructure used for I/O benchmark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !> @details Handles the setup of all the fields that will be passed used to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !! benchmark the speed of XIOS reading and writing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| module io_benchmark_setup_mod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use constants_mod, only: i_def, str_def | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use driver_modeldb_mod, only: modeldb_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use field_collection_mod, only: field_collection_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use field_mod, only: field_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use field_parent_mod, only: read_interface, write_interface | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use file_mod, only: FILE_MODE_WRITE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use fs_continuity_mod, only: Wtheta | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use function_space_mod, only: function_space_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use function_space_collection_mod, only: function_space_collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use lfric_xios_file_mod, only: lfric_xios_file_type, OPERATION_TIMESERIES | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use lfric_xios_read_mod, only: read_field_generic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use lfric_xios_write_mod, only: write_field_generic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use linked_list_mod, only: linked_list_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use mesh_mod, only: mesh_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use mesh_collection_mod, only: mesh_collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implicit none | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public create_io_benchmark_fields, setup_io_benchmark_files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contains | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !> @details Creates the fields needed for the IO benchmark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !> @param[in,out] modeldb The model database in which to store model data. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subroutine create_io_benchmark_fields(modeldb) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implicit none | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(modeldb_type), intent(inout) :: modeldb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(mesh_type), pointer :: mesh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(field_collection_type), pointer :: io_benchmark_fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(field_type) :: tmp_io_field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| procedure(read_interface), pointer :: tmp_read_ptr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| procedure(write_interface), pointer :: tmp_write_ptr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(function_space_type), pointer :: wtheta_fs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| character(str_def) :: prime_mesh_name, tmp_field_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
48
to
49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: element_order_h | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: element_order_v | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: n_benchmark_fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: diagnostic_frequency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prime_mesh_name = modeldb%config%base_mesh%prime_mesh_name() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| element_order_h = modeldb%config%finite_element%element_order_h() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| element_order_v = modeldb%config%finite_element%element_order_v() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| n_benchmark_fields = modeldb%config%io_demo%n_benchmark_fields() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| diagnostic_frequency = modeldb%config%io%diagnostic_frequency() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mesh => mesh_collection%get_mesh(prime_mesh_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call modeldb%fields%add_empty_field_collection("io_benchmark_fields") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wtheta_fs => function_space_collection%get_fs( mesh, element_order_h, & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| element_order_v, Wtheta ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| do i = 1, n_benchmark_fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| write(tmp_field_name, "(A19, I3.3)") 'io_benchmark_field_', i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call tmp_io_field%initialise( vector_space = wtheta_fs, & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name=tmp_field_name ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tmp_read_ptr => read_field_generic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tmp_write_ptr => write_field_generic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call tmp_io_field%set_read_behaviour(tmp_read_ptr) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call tmp_io_field%set_write_behaviour(tmp_write_ptr) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call io_benchmark_fields%add_field(tmp_io_field) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
69
to
78
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nullify( mesh, io_benchmark_fields, wtheta_fs ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end subroutine create_io_benchmark_fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subroutine setup_io_benchmark_files(file_list, modeldb) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implicit none | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(linked_list_type), intent(out) :: file_list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(modeldb_type), optional, intent(inout) :: modeldb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| integer(i_def) :: diagnostic_frequency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type(field_collection_type), pointer :: io_benchmark_fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| diagnostic_frequency = modeldb%config%io%diagnostic_frequency() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file_list = linked_list_type() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| call file_list%insert_item( lfric_xios_file_type( "lfric_xios_write_benchmark", & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xios_id="lfric_xios_write_benchmark", & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_mode=FILE_MODE_WRITE, & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| operation=OPERATION_TIMESERIES, & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| freq=diagnostic_frequency, & | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fields_in_file=io_benchmark_fields ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nullify(io_benchmark_fields) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end subroutine setup_io_benchmark_files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end module io_benchmark_setup_mod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
80 changes: 80 additions & 0 deletions
80
applications/io_demo/source/driver/io_benchmark/io_benchmark_step_mod.x90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| !----------------------------------------------------------------------------- | ||
| ! (C) Crown copyright Met Office. All rights reserved. | ||
| ! The file LICENCE, distributed with this code, contains details of the terms | ||
| ! under which the code may be used. | ||
| !----------------------------------------------------------------------------- | ||
|
|
||
| !> Steps the I/O benchmark section of IO_demo | ||
| module io_benchmark_step_mod | ||
|
|
||
| use constants_mod, only: i_def, r_def | ||
| use driver_modeldb_mod, only: modeldb_type | ||
| use field_mod, only: field_type | ||
| use field_parent_mod, only: field_parent_type | ||
| use field_collection_iterator_mod, & | ||
| only: field_collection_iterator_type | ||
| use field_collection_mod, only: field_collection_type | ||
| use log_mod, only: log_event, & | ||
| log_scratch_space, & | ||
| LOG_LEVEL_INFO | ||
|
|
||
| implicit none | ||
|
|
||
| private | ||
| public :: step_io_benchmark | ||
|
|
||
| contains | ||
|
|
||
| !> A simple timestep algorithm that copies the diffusion field into the | ||
| !! various benchmark fields and divides the entire field by the fields number | ||
| !! | ||
| !> @param[in,out] modeldb The model database | ||
| subroutine step_io_benchmark(modeldb) | ||
|
|
||
| implicit none | ||
|
|
||
| type(modeldb_type), optional, intent(inout) :: modeldb | ||
|
|
||
| type(field_collection_type), pointer :: depository | ||
| type(field_collection_type), pointer :: io_benchmark_fields | ||
| type(field_collection_iterator_type) :: field_iter | ||
| class(field_parent_type), pointer :: step_field | ||
| type(field_type), pointer :: kernel_field | ||
| type(field_type), pointer :: diffusion_field | ||
|
|
||
| integer(i_def) :: i, sleep_duration | ||
| real(r_def) :: loop_factor | ||
|
|
||
| sleep_duration = modeldb%config%io_demo%benchmark_sleep_time() | ||
|
|
||
| ! Get field data ready | ||
| depository => modeldb%fields%get_field_collection("depository") | ||
| io_benchmark_fields => modeldb%fields%get_field_collection("io_benchmark_fields") | ||
| call depository%get_field("diffusion_field", diffusion_field) | ||
|
|
||
| call field_iter%initialise(io_benchmark_fields) | ||
| do i = 1, io_benchmark_fields%get_length() | ||
| if ( .not. field_iter%has_next() ) exit | ||
| step_field => field_iter%next() | ||
| select type(step_field) | ||
| type is (field_type) | ||
| ! Copy diffusion field values to new fields and adjust values | ||
| kernel_field => step_field | ||
| loop_factor = real(i, r_def) | ||
| call invoke( setval_X(kernel_field, diffusion_field), & | ||
| inc_X_divideby_a(kernel_field, loop_factor) ) | ||
| end select | ||
|
|
||
| end do | ||
|
|
||
| write(log_scratch_space,'(A,I0,A)') "io_demo: sleeping for ", sleep_duration, " seconds" | ||
| call log_event(log_scratch_space, LOG_LEVEL_INFO) | ||
| call sleep(sleep_duration) | ||
|
|
||
| nullify(step_field) | ||
| nullify(kernel_field) | ||
| nullify(diffusion_field) | ||
|
|
||
| end subroutine step_io_benchmark | ||
|
|
||
| end module io_benchmark_step_mod |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new benchmark variables are not relevant unless in benchmarking mode, so should only be triggered in the case that the
io_benchmark=.true., as in the above suggestion.An alternative would be to have a separate namelist just for benchmarklng variables, then you can trigger the whole namelist on the one logical rather that specifying each variable individually. Depends if you think benchmarking will benefit from more inputs in future.