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

Timers fixed #275

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Timers fixed #275

merged 1 commit into from
Sep 27, 2023

Conversation

amartyads
Copy link
Contributor

@amartyads amartyads commented Sep 26, 2023

Description

Timers were broken (by me). The timer objects created in the old simulation function needed to be moved out to facilitate the breaking of the simulation loop, and these new const timer references didn't work. Rather than fix these, I've removed the objects completely, because the timer usage was inconsistent; for example, the mpi_omp_communication timer object was available previously as well, but was never used in the simulation loop. Now all the pointer and reference objects are gone, and the timers are accessed directly. Now we have several find operations with the timer map every simstep, however we already had this before for the mpi_omp_communication timer.

Resolved Issues

Timers were broken

How Has This Been Tested?

Basic gridfiller box, examples/Mamico_couette/ls1configNoCP.xml

@amartyads amartyads requested review from FG-TUM and HomesGH September 26, 2023 19:05
@FG-TUM
Copy link
Member

FG-TUM commented Sep 27, 2023

and these new const timer references didn't work

Can you elaborate a bit? I have no idea what the problem was and why these changes solve them 😅

@amartyads
Copy link
Contributor Author

Ah my bad
Basically, I'm not sure why, but using these const references wasn't actually starting or stopping the timers, the outputs at the end of simulations said that the timer values were zero. For example, right now if you run something on master, it'll say "Computation took 0 seconds" at the end. The communication timers were correct, despite an omp_mpi_communication_timer reference preexisting, because this reference was never used. The other timers all say zero, if a reference was used. Now they work again.

Not sure why they were broken, because I just changed the timer approach to be more consistent instead of looking into it further, but maybe there's some issue with the timers not being defined so early in the code?

@FG-TUM
Copy link
Member

FG-TUM commented Sep 27, 2023

After having a quick look at the code, it seems the problem was that the timers were initialized in e.g. Simulation::initConfigXML() but the references were already set in the constructor of Simulation. This obviously can't work. I'm not super happy with the whole way timers are handled because accessing something that isn't "registered" (aka initialized) fails silently and the way we access them now is super cumbersome, but I can live with it...

@FG-TUM FG-TUM merged commit baca393 into master Sep 27, 2023
51 checks passed
@FG-TUM FG-TUM deleted the fix-timers branch September 27, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants