Give user option to dump task levels at a given time step frequency
This merge request adds the option to call the scheduler_write_task_level
function multiple times during a run and to generate individual files, defined by the current time step number.
The default behaviour remains unchanged: When called, as it is in the current master, the resulting file will be task_level.txt
.
When passed on an integer time step (currently not done anywhere), it will be task_level_XXXX.txt
.
Merge request reports
Activity
Following a private discussion with @lhausammann, it would probably be best to include @matthieu in the discussion.
My idea was to do a quick change to the
scheduler_write_task_level
function to enable to write the task level output at multiple time steps without overwriting the output file. By default, this function is not called outside the place where it is currently called in the master branch. Loic thinks it might not really be worth it.Possibilities I see to extend this merge request:
- add a cmdline flag to set the output frequency for the task levels, similar to e.g.
cell-dumps
- dump the task levels automatically (only when in debug mode?) e.g. after every rebuild
- enable
scheduler_write_task_dependencies
to be written out with a step including file name as well, apply same frequency to it as forwrite_task_level
@matthieu, what are your thoughts on this?
- add a cmdline flag to set the output frequency for the task levels, similar to e.g.
Sorry, things kept piling up and this escaped my attention.
I used this to check how the task levels were behaving between steps and between different runs each time step, similarly to how we can dump the cell hierarchy every step. I thought it was a good idea to have this option around, Loic though that it should be extended for general users, not just the people that are aware of the existence of this function and option.
So I'd still like to discuss this: Would we want to have this kind of option, and if yes, in what form? Arguably the solution Loic is using in !1249 (merged) is probably best, where we keep the default dump at time step 0 and allow the user to specify a frequency. I'll be happy to add that functionality, but first we should agree on whether we want this, and if we do, in what way.
Don't worry. Just wanted to make sure I am not blocking useful things you guys would need.
This is not a tool I have used much myself (probably because it did not exist when designing the main tasks!) but if you think it's useful to have more information optionally written out to help debug things, then, yes, we should go ahead. Using the same mechanism sounds good to me. By default only step 0 and if the user wants then every n step. Only step 0 is often enough as if you have a problem, you can always start a run with the exact configuration we are trying to debug. However, I can see scenarios where we want more outputs as well, like the debugging you are doing now.
mentioned in merge request !1249 (merged)
added 54 commits
-
33950a61...a781c1d3 - 52 commits from branch
master
- c9a03d82 - initial commit task level dumps on user set frequency
- b806def5 - formatting
-
33950a61...a781c1d3 - 52 commits from branch
added enhancement feature request labels
Here we go. Just like in !1249 (merged) for the task dependencies, the task levels can now be dumped at a frequency set in the parameter file. The default behaviour is unchanged, the task levels will always be dumped at the zeroth step.
Additionally, when run with MPI, every rank will write its own file. The
tools/plot_task_level.py
tool was extended to accept any number of files as input, and will sum up their contents before generating a plot.added 8 commits
-
b806def5...1639a1d4 - 6 commits from branch
master
- 4d5cdf03 - initial commit task level dumps on user set frequency
- 59cf4fcf - formatting
-
b806def5...1639a1d4 - 6 commits from branch
- Resolved by Mladen Ivkovic
added 1 commit
- 794ae44d - only rank 0 writes task levels at zeroth step
mentioned in commit fd12f13c