idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.72k stars 1.04k forks source link

Make problem initial setup more verbose in debug mode / with debug parameters #24017

Open YaqiWang opened 1 year ago

YaqiWang commented 1 year ago

Reason

We have show_actions for showing execution of Actions and now show_execution_order added recently by @GiudGiud in https://github.com/idaholab/moose/pull/21586 for showing the execution of MOOSE objects during evaluations of residual/Jacobian/UO/Aux, etc. Problem initial setups (in FEProblemBase::initialSetup) is something happening in between. It would be nice if we can make that also verbose.

Design

We have had live prints for the actions in the initial setup, so it is possible we just need a parameter to tune the prints so that they can always come out. This was suggested by @friedmud. It is designed to show both CPU-time and memory in the screen printouts.

Impact

A quick way to let users report errors more specifically and let developers zoom into the code to figure out issues.

GiudGiud commented 10 months ago

@YaqiWang does setting executioner/verbose work for you? the problem is a lot more verbose now see #25853

YaqiWang commented 10 months ago

I have not tried. So Executioner/verbose is affecting FEProblem?

YaqiWang commented 10 months ago

That seems only verbosing during actions but not in initial setup.

I noticed that FEProblemBase::initialSetup already had lots of lines like this

      TIME_SECTION("computingMaxDofs", 3, "Computing Max Dofs Per Element");

Maybe we can improve this macro to let it print the time and memory usage when a flag is on?

GiudGiud commented 10 months ago

you must be using an old moose

It does affect Problem setup. You should see this:

[DBG] Adding UserObject 'outlet_pressure' of type Receiver
[DBG] Adding UserObject 'pressure_in' of type SideAverageValue
[DBG] Adding UserObject 'mass_flow_out' of type VolumetricFlowRate
[DBG] Adding UserObject 'T_flow_in' of type ParsedPostprocessor
[DBG] Adding UserObject 'T_flow_out' of type ParsedPostprocessor
[DBG] Adding UserObject 'max_Tf' of type ElementExtremeValue
[DBG] Adding UserObject 'max_vy' of type ElementExtremeValue
[DBG] Adding UserObject 'power' of type ElementIntegralVariablePostprocessor
[DBG] Adding UserObject 'pressure_drop' of type DifferencePostprocessor
[DBG] Adding UserObject 'e_flow_in_m' of type VolumetricFlowRate
[DBG] Adding UserObject 'e_flow_out' of type VolumetricFlowRate
[DBG] Adding UserObject 'core_balance' of type ParsedPostprocessor
[DBG] Adding UserObject 'mass_flow_OR' of type VolumetricFlowRate
[DBG] Adding UserObject 'mass_flow_plenum' of type VolumetricFlowRate
[DBG] Adding UserObject 'bypass_fraction' of type ParsedPostprocessor
[DBG] Adding UserObject 'plenum_fraction' of type ParsedPostprocessor
[DBG] Adding UserObject 'h' of type AverageElementSize
[DBG] Adding UserObject 'coupling_its_primary' of type NumFixedPointIterations
[DBG] Adding UserObject 'num_fixed_point' of type Receiver
[DBG] Adding AuxKernel 'eps' of type FunctorAux
[DBG] Adding FVKernel 'temp_solid_time_core' of type PINSFVEnergyTimeDerivative
[DBG] Adding FVKernel 'temp_solid_time' of type PINSFVEnergyTimeDerivative
[DBG] Adding FVKernel 'temp_solid_conduction_core' of type FVDiffusion
[DBG] Adding FVKernel 'temp_solid_conduction' of type FVDiffusion
[DBG] Adding FVKernel 'temp_solid_source' of type FVCoupledForce
[DBG] Adding FVKernel 'temp_fluid_to_solid' of type PINSFVEnergyAmbientConvection
[DBG] Adding FVBoundaryCondition 'outer' of type FVDirichletBC
[DBG] Adding FVInterfaceKernel 'diffusion_interface' of type FVDiffusionInterface
[DBG] Adding FVKernel 'pins_momentum_time_superficial_vel_x' of type PINSFVMomentumTimeDerivative
[DBG] Adding FVKernel 'pins_momentum_time_superficial_vel_y' of type PINSFVMomentumTimeDeri
lindsayad commented 10 months ago

Those things are being added during the action phase, not the initialSetup phase, so Yaqi's comment holds

GiudGiud commented 10 months ago

ok let's keep it open.