-
Notifications
You must be signed in to change notification settings - Fork 45
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
22
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
22 commits
Select commit
Hold shift + click to select a range
66c7402
Add source code changes from previous Trac branch
EdHone 1b21148
Remove old timer implementation
EdHone 48e0a39
Bring in metadata from previous branch
EdHone b5fed78
Use 'native' Fortran sleep
EdHone 83c41c1
Fix upgrade macro
EdHone 365ae7c
Macro whitespace
EdHone bc512ee
Macro whitespace
EdHone 566f018
Manual implementation of metadata - test suite runs but tests broken
EdHone c7fd86f
Fix metadata issues
EdHone ceeffd1
Fix builds and suite running
EdHone 92085cd
small benchmark cases in developer suite
EdHone b483318
Interim test configs working
EdHone 6a26746
Working tests for benchmark case
EdHone d34d96b
Clean up branch
EdHone 90b4e72
Fixes for developer suite
EdHone 86a546c
Final implementation
EdHone b20e02b
change vernieer output mode
EdHone 1281590
RW comments - new namelist API and rose metadata triggers
EdHone d6dc8ee
More efficient function space assignment
EdHone b22275d
fix indentation
EdHone 4877a8b
Update applications/io_demo/source/driver/io_demo_driver_mod.f90
EdHone 4974278
Revert example file
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 | ||
mo-rickywong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
mo-rickywong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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.
Uh oh!
There was an error while loading. Please reload this page.