m_logger Module

Single point for x3d2 to report progress, warnings and errors, and to stop the run when something goes wrong.

Messages carry a level: debug, info, warning or error. Those below the threshold set with set_log_level (info by default) are dropped. Debug and info lines go to standard output, warnings and errors to standard error, and every line is flushed so output from different ranks and from a crash is not lost in a buffer.

The logging calls are made on every rank, but by default only rank 0 writes, so a message appears once however many ranks the run has. Pass all_ranks=.true. for something that only some ranks know about; each rank that makes the call then writes, and on a multi-rank run the line starts with the rank that wrote it.

abort_run is how x3d2 stops on an error. It writes the message and takes down the whole job: a plain error stop on one rank can leave the others waiting forever in MPI. check_mpi turns an MPI return code into such an abort. Backends add their own checks on top of abort_run (see m_cuda_errors for CUDA).

str turns numbers into text, so a message can be assembled with //:

call log_info('Checkpoint frequency: '//str(freq))


Uses

  • module~~m_logger~~UsesGraph module~m_logger m_logger iso_fortran_env iso_fortran_env module~m_logger->iso_fortran_env m_mpi m_mpi module~m_logger->m_mpi

Used by

  • module~~m_logger~~UsedByGraph module~m_logger m_logger module~m_abl m_abl module~m_abl->module~m_logger module~m_base_backend m_base_backend module~m_abl->module~m_base_backend module~m_common m_common module~m_abl->module~m_common module~m_config m_config module~m_abl->module~m_config module~m_les m_les module~m_abl->module~m_les module~m_mesh m_mesh module~m_abl->module~m_mesh module~m_allocator m_allocator module~m_abl->module~m_allocator module~m_field m_field module~m_abl->module~m_field module~m_abl_diagnostics m_abl_diagnostics module~m_abl_diagnostics->module~m_logger module~m_abl_diagnostics->module~m_base_backend module~m_abl_diagnostics->module~m_common module~m_abl_diagnostics->module~m_config module~m_abl_diagnostics->module~m_les module~m_abl_diagnostics->module~m_mesh module~m_abl_diagnostics->module~m_field module~m_adm m_adm module~m_adm->module~m_logger module~m_adm->module~m_base_backend module~m_adm->module~m_common module~m_io_session m_io_session module~m_adm->module~m_io_session module~m_adm->module~m_mesh module~m_scalar_series m_scalar_series module~m_adm->module~m_scalar_series module~m_adm->module~m_allocator module~m_adm->module~m_field module~m_turbine_model m_turbine_model module~m_adm->module~m_turbine_model module~m_backend_setup m_backend_setup module~m_backend_setup->module~m_logger module~m_backend_setup->module~m_base_backend module~m_backend_setup->module~m_common module~m_cuda_backend m_cuda_backend module~m_backend_setup->module~m_cuda_backend module~m_cuda_errors m_cuda_errors module~m_backend_setup->module~m_cuda_errors module~m_backend_setup->module~m_mesh module~m_omp_backend m_omp_backend module~m_backend_setup->module~m_omp_backend module~m_omptgt_allocator m_omptgt_allocator module~m_backend_setup->module~m_omptgt_allocator module~m_omptgt_backend m_omptgt_backend module~m_backend_setup->module~m_omptgt_backend module~m_omptgt_common m_omptgt_common module~m_backend_setup->module~m_omptgt_common module~m_backend_setup->module~m_allocator module~m_cuda_allocator m_cuda_allocator module~m_backend_setup->module~m_cuda_allocator module~m_base_backend->module~m_logger module~m_base_backend->module~m_common module~m_base_backend->module~m_mesh module~m_poisson_fft m_poisson_fft module~m_base_backend->module~m_poisson_fft module~m_tdsops m_tdsops module~m_base_backend->module~m_tdsops module~m_base_backend->module~m_allocator module~m_base_backend->module~m_field module~m_base_case m_base_case module~m_base_case->module~m_logger module~m_base_case->module~m_base_backend module~m_base_case->module~m_common module~m_base_case->module~m_config module~m_base_case->module~m_mesh module~m_monitoring m_monitoring module~m_base_case->module~m_monitoring module~m_postprocess m_postprocess module~m_base_case->module~m_postprocess module~m_solver m_solver module~m_base_case->module~m_solver module~m_base_case->module~m_allocator module~m_base_case->module~m_field module~m_io_manager m_io_manager module~m_base_case->module~m_io_manager module~m_case_abl m_case_abl module~m_case_abl->module~m_logger module~m_case_abl->module~m_abl module~m_case_abl->module~m_abl_diagnostics module~m_case_abl->module~m_base_backend module~m_case_abl->module~m_base_case module~m_case_abl->module~m_common module~m_case_abl->module~m_config module~m_case_abl->module~m_mesh module~m_case_abl->module~m_allocator module~m_case_abl->module~m_field module~m_case_channel m_case_channel module~m_case_channel->module~m_logger module~m_case_channel->module~m_base_backend module~m_case_channel->module~m_base_case module~m_case_channel->module~m_common module~m_case_channel->module~m_config module~m_case_channel->module~m_mesh module~m_case_channel->module~m_solver module~m_case_channel->module~m_allocator module~m_case_channel->module~m_field module~m_case_cylinder m_case_cylinder module~m_case_cylinder->module~m_logger module~m_case_cylinder->module~m_base_backend module~m_case_cylinder->module~m_base_case module~m_case_cylinder->module~m_common module~m_case_cylinder->module~m_config module~m_case_cylinder->module~m_mesh module~m_case_cylinder->module~m_solver module~m_case_cylinder->module~m_allocator module~m_case_cylinder->module~m_field module~m_case_generic m_case_generic module~m_case_generic->module~m_logger module~m_case_generic->module~m_base_backend module~m_case_generic->module~m_base_case module~m_case_generic->module~m_common module~m_case_generic->module~m_mesh module~m_case_generic->module~m_solver module~m_case_generic->module~m_allocator module~m_case_generic->module~m_field module~m_case_tgv m_case_tgv module~m_case_tgv->module~m_logger module~m_case_tgv->module~m_base_backend module~m_case_tgv->module~m_base_case module~m_case_tgv->module~m_common module~m_case_tgv->module~m_mesh module~m_case_tgv->module~m_solver module~m_case_tgv->module~m_allocator module~m_case_tgv->module~m_field module~m_case_wind_turbine m_case_wind_turbine module~m_case_wind_turbine->module~m_logger module~m_case_wind_turbine->module~m_adm module~m_case_wind_turbine->module~m_base_backend module~m_case_wind_turbine->module~m_base_case module~m_case_wind_turbine->module~m_common module~m_case_wind_turbine->module~m_config module~m_case_wind_turbine->module~m_mesh module~m_case_wind_turbine->module~m_solver module~m_case_wind_turbine->module~m_allocator module~m_case_wind_turbine->module~m_field module~m_turbine_dummy m_turbine_dummy module~m_case_wind_turbine->module~m_turbine_dummy module~m_case_wind_turbine->module~m_turbine_model module~m_checkpoint_manager m_checkpoint_manager module~m_checkpoint_manager->module~m_logger module~m_checkpoint_manager->module~m_common module~m_checkpoint_manager->module~m_config module~m_io_field_utils m_io_field_utils module~m_checkpoint_manager->module~m_io_field_utils module~m_checkpoint_manager->module~m_io_session module~m_checkpoint_manager->module~m_solver module~m_stats m_stats module~m_checkpoint_manager->module~m_stats module~m_checkpoint_state m_checkpoint_state module~m_checkpoint_manager->module~m_checkpoint_state module~m_checkpoint_manager->module~m_field module~m_common->module~m_logger module~m_config->module~m_logger module~m_config->module~m_common module~m_cuda_backend->module~m_logger module~m_cuda_backend->module~m_base_backend module~m_cuda_backend->module~m_common module~m_cuda_backend->module~m_cuda_errors module~m_cuda_poisson_fft m_cuda_poisson_fft module~m_cuda_backend->module~m_cuda_poisson_fft module~m_cuda_sendrecv m_cuda_sendrecv module~m_cuda_backend->module~m_cuda_sendrecv module~m_cuda_backend->module~m_mesh module~m_cuda_backend->module~m_tdsops module~m_cuda_backend->module~m_allocator module~m_cuda_backend->module~m_cuda_allocator module~m_cuda_exec_dist m_cuda_exec_dist module~m_cuda_backend->module~m_cuda_exec_dist module~m_cuda_exec_thom m_cuda_exec_thom module~m_cuda_backend->module~m_cuda_exec_thom module~m_cuda_kernels_dist m_cuda_kernels_dist module~m_cuda_backend->module~m_cuda_kernels_dist module~m_cuda_kernels_fieldops m_cuda_kernels_fieldops module~m_cuda_backend->module~m_cuda_kernels_fieldops module~m_cuda_kernels_reorder m_cuda_kernels_reorder module~m_cuda_backend->module~m_cuda_kernels_reorder module~m_cuda_tdsops m_cuda_tdsops module~m_cuda_backend->module~m_cuda_tdsops module~m_cuda_backend->module~m_field module~m_cuda_errors->module~m_logger module~m_cuda_poisson_fft->module~m_logger module~m_cuda_poisson_fft->module~m_common module~m_cuda_poisson_fft->module~m_cuda_errors module~m_cuda_poisson_fft->module~m_cuda_sendrecv module~m_cuda_poisson_fft->module~m_mesh module~m_cuda_poisson_fft->module~m_poisson_fft module~m_cuda_poisson_fft->module~m_tdsops module~m_cuda_poisson_fft->module~m_cuda_allocator module~m_cuda_spectral m_cuda_spectral module~m_cuda_poisson_fft->module~m_cuda_spectral module~m_cuda_poisson_fft->module~m_field module~m_cuda_sendrecv->module~m_logger module~m_cuda_sendrecv->module~m_common module~m_cuda_sendrecv->module~m_cuda_errors module~m_decomp m_decomp module~m_decomp->module~m_logger module~m_decomp~2 m_decomp module~m_decomp~2->module~m_logger module~m_ibm m_ibm module~m_ibm->module~m_logger module~m_ibm->module~m_base_backend module~m_ibm->module~m_common module~m_ibm->module~m_io_session module~m_ibm->module~m_mesh module~m_ibm->module~m_allocator module~m_ibm->module~m_field module~m_io_backend m_io_backend module~m_io_backend->module~m_logger module~m_io_backend->module~m_base_backend module~m_io_backend->module~m_common module~m_io_backend->module~m_field module~m_io_base m_io_base module~m_io_backend->module~m_io_base module~m_io_backend~2 m_io_backend module~m_io_backend~2->module~m_logger module~m_io_backend~2->module~m_base_backend module~m_io_backend~2->module~m_common module~m_io_backend~2->module~m_field module~m_io_backend~2->module~m_io_base module~m_io_field_utils->module~m_logger module~m_io_field_utils->module~m_common module~m_io_field_utils->module~m_solver module~m_io_field_utils->module~m_field module~m_io_field_utils->module~m_io_base module~m_io_session->module~m_logger module~m_io_session->module~m_base_backend module~m_io_session->module~m_common module~m_io_session->module~m_io_backend~2 module~m_io_session->module~m_field module~m_io_session->module~m_io_base module~m_les->module~m_logger module~m_les->module~m_base_backend module~m_les->module~m_common module~m_les->module~m_config module~m_les->module~m_mesh module~m_les->module~m_tdsops module~m_les->module~m_field module~m_mesh->module~m_logger module~m_mesh->module~m_common module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content module~m_mesh->module~m_field module~m_mesh_content->module~m_logger module~m_mesh_content->module~m_common module~m_monitoring->module~m_logger module~m_monitoring->module~m_common module~m_monitoring->module~m_scalar_series module~m_monitoring->module~m_solver module~m_monitoring->module~m_field module~m_omp_backend->module~m_logger module~m_omp_backend->module~m_base_backend module~m_omp_backend->module~m_common module~m_omp_backend->module~m_mesh module~m_omp_sendrecv m_omp_sendrecv module~m_omp_backend->module~m_omp_sendrecv module~m_omp_backend->module~m_tdsops module~m_omp_backend->module~m_allocator module~m_exec_thom m_exec_thom module~m_omp_backend->module~m_exec_thom module~m_omp_backend->module~m_field module~m_omp_exec_dist m_omp_exec_dist module~m_omp_backend->module~m_omp_exec_dist module~m_ordering m_ordering module~m_omp_backend->module~m_ordering module~m_omp_poisson_fft m_omp_poisson_fft module~m_omp_poisson_fft->module~m_logger module~m_omp_poisson_fft->module~m_common module~m_omp_poisson_fft->module~m_mesh module~m_omp_spectral m_omp_spectral module~m_omp_poisson_fft->module~m_omp_spectral module~m_omp_poisson_fft->module~m_poisson_fft module~m_omp_poisson_fft->module~m_tdsops module~m_omp_poisson_fft->module~m_field module~m_omp_sendrecv->module~m_logger module~m_omp_sendrecv->module~m_common module~m_omp_spectral->module~m_logger module~m_omp_spectral->module~m_common module~m_omptgt_allocator->module~m_logger module~m_omptgt_allocator->module~m_common module~m_omptgt_allocator->module~m_mesh module~m_omptgt_allocator->module~m_allocator module~m_omptgt_allocator->module~m_field module~m_omptgt_backend->module~m_logger module~m_omptgt_backend->module~m_base_backend module~m_omptgt_backend->module~m_common module~m_omptgt_backend->module~m_mesh module~m_omptgt_backend->module~m_omptgt_common module~m_omptgt_exec_dist m_omptgt_exec_dist module~m_omptgt_backend->module~m_omptgt_exec_dist module~m_omptgt_backend->module~m_tdsops module~m_omptgt_backend->module~m_allocator module~m_omptgt_backend->module~m_field module~m_omptgt_exec_thom m_omptgt_exec_thom module~m_omptgt_backend->module~m_omptgt_exec_thom module~m_omptgt_kernels_fieldops m_omptgt_kernels_fieldops module~m_omptgt_backend->module~m_omptgt_kernels_fieldops module~m_omptgt_sendrecv m_omptgt_sendrecv module~m_omptgt_backend->module~m_omptgt_sendrecv module~m_omptgt_tdsops m_omptgt_tdsops module~m_omptgt_backend->module~m_omptgt_tdsops module~m_omptgt_common->module~m_logger module~m_omptgt_common->module~m_common module~m_omptgt_exec_dist->module~m_logger module~m_omptgt_exec_dist->module~m_common module~m_omptgt_exec_dist->module~m_omptgt_common module~m_omptgt_kernels_dist m_omptgt_kernels_dist module~m_omptgt_exec_dist->module~m_omptgt_kernels_dist module~m_omptgt_exec_dist->module~m_omptgt_sendrecv module~m_omptgt_exec_dist->module~m_omptgt_tdsops module~m_poisson_fft->module~m_logger module~m_poisson_fft->module~m_common module~m_poisson_fft->module~m_mesh module~m_poisson_fft->module~m_tdsops module~m_poisson_fft->module~m_field module~m_postprocess->module~m_logger module~m_postprocess->module~m_common module~m_postprocess->module~m_solver module~m_postprocess->module~m_field module~m_scalar_series->module~m_logger module~m_scalar_series->module~m_common module~m_snapshot_manager m_snapshot_manager module~m_snapshot_manager->module~m_logger module~m_snapshot_manager->module~m_common module~m_snapshot_manager->module~m_config module~m_snapshot_manager->module~m_io_field_utils module~m_snapshot_manager->module~m_io_session module~m_snapshot_manager->module~m_solver module~m_snapshot_manager->module~m_field module~m_solver->module~m_logger module~m_solver->module~m_base_backend module~m_solver->module~m_common module~m_solver->module~m_config module~m_solver->module~m_ibm module~m_solver->module~m_les module~m_solver->module~m_mesh module~m_solver->module~m_tdsops module~m_time_integrator m_time_integrator module~m_solver->module~m_time_integrator module~m_vector_calculus m_vector_calculus module~m_solver->module~m_vector_calculus module~m_solver->module~m_allocator module~m_solver->module~m_field module~m_stats->module~m_logger module~m_stats->module~m_common module~m_stats->module~m_config module~m_stats->module~m_io_session module~m_stats->module~m_solver module~m_stats->module~m_field module~m_tdsops->module~m_logger module~m_tdsops->module~m_common module~m_time_integrator->module~m_logger module~m_time_integrator->module~m_base_backend module~m_time_integrator->module~m_common module~m_time_integrator->module~m_allocator module~m_time_integrator->module~m_field module~m_vector_calculus->module~m_logger module~m_vector_calculus->module~m_base_backend module~m_vector_calculus->module~m_common module~m_vector_calculus->module~m_tdsops module~m_vector_calculus->module~m_allocator module~m_vector_calculus->module~m_field program~xcompact xcompact program~xcompact->module~m_logger program~xcompact->module~m_backend_setup program~xcompact->module~m_base_case program~xcompact->module~m_case_abl program~xcompact->module~m_case_channel program~xcompact->module~m_case_cylinder program~xcompact->module~m_case_generic program~xcompact->module~m_case_tgv program~xcompact->module~m_case_wind_turbine program~xcompact->module~m_common program~xcompact->module~m_config program~xcompact->module~m_mesh module~m_allocator->module~m_common module~m_allocator->module~m_field module~m_checkpoint_state->module~m_io_session module~m_cuda_allocator->module~m_common module~m_cuda_allocator->module~m_mesh module~m_cuda_allocator->module~m_allocator module~m_cuda_allocator->module~m_field module~m_cuda_exec_dist->module~m_common module~m_cuda_exec_dist->module~m_cuda_sendrecv module~m_cuda_exec_dist->module~m_cuda_kernels_dist module~m_cuda_exec_dist->module~m_cuda_tdsops module~m_cuda_exec_thom->module~m_common module~m_cuda_kernels_thom m_cuda_kernels_thom module~m_cuda_exec_thom->module~m_cuda_kernels_thom module~m_cuda_exec_thom->module~m_cuda_tdsops module~m_cuda_kernels_dist->module~m_common module~m_cuda_kernels_fieldops->module~m_common module~m_cuda_kernels_reorder->module~m_common module~m_cuda_kernels_thom->module~m_common module~m_cuda_spectral->module~m_common module~m_cuda_tdsops->module~m_common module~m_cuda_tdsops->module~m_tdsops module~m_exec_thom->module~m_common module~m_exec_thom->module~m_tdsops module~m_omp_kernels_thom m_omp_kernels_thom module~m_exec_thom->module~m_omp_kernels_thom module~m_field->module~m_common module~m_io_base->module~m_base_backend module~m_io_base->module~m_common module~m_io_base->module~m_field module~m_io_manager->module~m_checkpoint_manager module~m_io_manager->module~m_snapshot_manager module~m_io_manager->module~m_solver module~m_io_manager->module~m_stats module~m_io_manager->module~m_checkpoint_state module~m_omp_exec_dist->module~m_common module~m_omp_exec_dist->module~m_omp_sendrecv module~m_omp_exec_dist->module~m_tdsops module~m_omp_kernels_dist m_omp_kernels_dist module~m_omp_exec_dist->module~m_omp_kernels_dist module~m_omp_kernels_dist->module~m_common module~m_omp_kernels_thom->module~m_common module~m_omptgt_exec_thom->module~m_common module~m_omptgt_kernels_thom m_omptgt_kernels_thom module~m_omptgt_exec_thom->module~m_omptgt_kernels_thom module~m_omptgt_exec_thom->module~m_omptgt_tdsops module~m_omptgt_kernels_dist->module~m_common module~m_omptgt_kernels_dist->module~m_omptgt_common module~m_omptgt_kernels_fieldops->module~m_common module~m_omptgt_kernels_fieldops->module~m_omptgt_common module~m_omptgt_kernels_thom->module~m_common module~m_omptgt_kernels_thom->module~m_omptgt_common module~m_omptgt_sendrecv->module~m_common module~m_omptgt_sendrecv->module~m_omptgt_common module~m_omptgt_tdsops->module~m_common module~m_omptgt_tdsops->module~m_omptgt_common module~m_omptgt_tdsops->module~m_tdsops module~m_ordering->module~m_common module~m_turbine_dummy->module~m_base_backend module~m_turbine_dummy->module~m_common module~m_turbine_dummy->module~m_io_session module~m_turbine_dummy->module~m_mesh module~m_turbine_dummy->module~m_allocator module~m_turbine_dummy->module~m_field module~m_turbine_dummy->module~m_turbine_model module~m_turbine_model->module~m_base_backend module~m_turbine_model->module~m_common module~m_turbine_model->module~m_mesh module~m_turbine_model->module~m_allocator module~m_turbine_model->module~m_checkpoint_state module~m_turbine_model->module~m_field proc~decomposition_2decomp m_decomp::decomposition_2decomp proc~decomposition_2decomp->module~m_mesh_content proc~decomposition_2decomp~2 m_decomp::decomposition_2decomp proc~decomposition_2decomp~2->module~m_mesh_content proc~decomposition_generic m_mesh::decomposition_generic proc~decomposition_generic->module~m_mesh_content proc~init_omp_poisson_fft m_omp_backend::omp_backend_t%init_omp_poisson_fft proc~init_omp_poisson_fft->module~m_omp_poisson_fft proc~mesh_init m_mesh::mesh_init proc~mesh_init->module~m_decomp

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: LOG_LEVEL_DEBUG = 10
integer, public, parameter :: LOG_LEVEL_INFO = 20
integer, public, parameter :: LOG_LEVEL_WARN = 30
integer, public, parameter :: LOG_LEVEL_ERROR = 40

Interfaces

public interface str

  • private function str_int32(value) result(text)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: value

    Return Value character(len=:), allocatable

  • private function str_int64(value) result(text)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: value

    Return Value character(len=:), allocatable

  • private function str_real32(value, fmt) result(text)

    fmt is a format string such as '(f8.3)'; the default is scientific notation with nine significant digits.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real32), intent(in) :: value
    character(len=*), intent(in), optional :: fmt

    Return Value character(len=:), allocatable

  • private function str_real64(value, fmt) result(text)

    fmt is a format string such as '(f8.3)'; the default is scientific notation with seventeen significant digits.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: value
    character(len=*), intent(in), optional :: fmt

    Return Value character(len=:), allocatable

  • private function str_logical(value) result(text)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: value

    Return Value character(len=:), allocatable


Functions

public function get_log_level()

Arguments

None

Return Value integer


Subroutines

public subroutine set_log_level(level)

Drop messages below level (one of the LOG_LEVEL_* parameters).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: level

public subroutine log_debug(message, all_ranks)

Detail for developers, hidden unless the level is LOG_LEVEL_DEBUG.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message
logical, intent(in), optional :: all_ranks

public subroutine log_info(message, all_ranks)

Progress and setup information.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message
logical, intent(in), optional :: all_ranks

public subroutine log_warn(message, all_ranks)

Something is suspicious, but the run can carry on.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message
logical, intent(in), optional :: all_ranks

public subroutine log_error(message, all_ranks)

An error the caller handles itself. Use abort_run to stop the run.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message
logical, intent(in), optional :: all_ranks

public subroutine abort_run(message, collective)

Report a fatal error and stop every rank of the run.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message
logical, intent(in), optional :: collective

public subroutine check_mpi(ierr, operation)

Abort the run if an MPI call did not succeed.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ierr
character(len=*), intent(in) :: operation