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

Add ability for MALI to create separate logs from each processor #6694

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 components/mpas-albany-landice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ add_default($nl, 'config_pio_stride');
add_default($nl, 'config_year_digits');
add_default($nl, 'config_output_external_velocity_solver_data');
add_default($nl, 'config_write_albany_ascii_mesh');
add_default($nl, 'config_create_all_logs_in_e3sm');

#################################
# Namelist group: decomposition #
Expand Down
1 change: 1 addition & 0 deletions components/mpas-albany-landice/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ add_default($nl, 'config_pio_stride');
add_default($nl, 'config_year_digits');
add_default($nl, 'config_output_external_velocity_solver_data');
add_default($nl, 'config_write_albany_ascii_mesh');
add_default($nl, 'config_create_all_logs_in_e3sm');

#################################
# Namelist group: decomposition #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<config_year_digits>4</config_year_digits>
<config_output_external_velocity_solver_data>.false.</config_output_external_velocity_solver_data>
<config_write_albany_ascii_mesh>.false.</config_write_albany_ascii_mesh>
<config_create_all_logs_in_e3sm>.false.</config_create_all_logs_in_e3sm>

<!-- decomposition -->
<config_num_halos>3</config_num_halos>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,14 @@ Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_create_all_logs_in_e3sm" type="logical"
category="io" group="io">
Logical flag determining if log files will be created for each processor in an E3SM configuration. If .true., the model initializes and writes to one files per processor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Logical flag determining if log files will be created for each processor in an E3SM configuration. If .true., the model initializes and writes to one files per processor.
Logical flag determining if log files will be created for each processor in an E3SM configuration. If .true., the model initializes and writes to one file per processor.


Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>


<!-- decomposition -->

Expand Down
38 changes: 21 additions & 17 deletions components/mpas-albany-landice/driver/glc_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ subroutine glc_init_mct( EClock, cdata_g, x2g_g, g2x_g, NLFilename )!{{{
logical :: streamsExists
integer :: mesh_iotype

logical, pointer :: tempLogicalConfig
logical, pointer :: tempLogicalConfig, config_create_all_logs_in_e3sm
character(len=StrKIND), pointer :: tempCharConfig


Expand Down Expand Up @@ -332,22 +332,6 @@ end subroutine xml_stream_get_attributes
call mpas_dmpar_abort(domain % dminfo)
end if

! Set core specific options here
! Disable output from all but the master task for E3SM!
! (This overrides the default set by mpas_log_init based on MPAS_DEBUG setting.)
if (iam /= 0) then
domain % logInfo % outputLog % isActive = .false.
endif

! After core has had a chance to modify log defaults, open the output log
call mpas_log_open(err=ierr)
if ( ierr /= 0 ) then
write(glcLogUnit,*) 'ERROR: log open failed for core ' // trim(domain % core % coreName)
call mpas_dmpar_abort(domain % dminfo)
end if
! ===========


! ----------
! Process namelist and streams files
! ----------
Expand All @@ -361,6 +345,26 @@ end subroutine xml_stream_get_attributes
call mpas_log_write('Namelist setup failed for core ' // trim(domain % core % coreName), MPAS_LOG_CRIT)
end if

! Set core specific options here
! Disable output from all but the master task for E3SM!
! (This overrides the default set by mpas_log_init based on MPAS_DEBUG setting.)
call mpas_pool_get_config(domain % configs, 'config_create_all_logs_in_e3sm', config_create_all_logs_in_e3sm)
if (config_create_all_logs_in_e3sm) then
domain % logInfo % outputLog % isActive = .true.
else
if (iam /= 0) then
domain % logInfo % outputLog % isActive = .false.
endif
endif

! After core has had a chance to modify log defaults, open the output log
call mpas_log_open(err=ierr)
if ( ierr /= 0 ) then
write(glcLogUnit,*) 'ERROR: log open failed for core ' // trim(domain % core % coreName)
call mpas_dmpar_abort(domain % dminfo)
end if
! ===========

call mpas_framework_init_phase2(domain, io_system)

! Define package variables
Expand Down
4 changes: 4 additions & 0 deletions components/mpas-albany-landice/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@
description="Logical flag determining if ascii mesh files will be created. These files are written in a format that can be used by the standalone Albany velocity solver for optimization. If .true., the model initializes, writes the mesh files, and then terminates."
possible_values=".true. or .false."
/>
<nml_option name="config_create_all_logs_in_e3sm" type="logical" default_value=".false." units="unitless"
description="Logical flag determining if log files will be created for each processor in an E3SM configuration. If .true., the model initializes and writes to one files per processor."
possible_values=".true. or .false."
/>

</nml_record>

Expand Down