boutproject / xBOUT

Collects BOUT++ data from parallelized simulations into xarray.
https://xbout.readthedocs.io/en/latest/
Apache License 2.0
21 stars 8 forks source link

Allow reading walltime variables #289

Open mikekryjak opened 1 year ago

mikekryjak commented 1 year ago

The walltime variables are defined here:

https://github.com/boutproject/BOUT-dev/blob/3d6cb4b7da6605e2d39828f07ece36c8d3886bcd/include/bout/monitor.hxx#L80-L110

They are slightly different in each processor which causes issues with xarray concatenation. For this reason, wall time stats have been dropped from xBOUT at load time so far.

This PR changes this. We read the proc 0 variables and drop the rest. This should be representative of the whole domain as the wtime load should be near identical for each processor anyway.

To keep the change simple, this also keeps three more variables from _BOUT_PER_PROC_VARIABLES which are not particularly useful (PE_XIND, PE_YIND and MYPE). Let me know if you think those should be removed.

Progress:

pep8speaks commented 1 month ago

Hello @mikekryjak! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 223:37: E701 multiple statements on one line (colon)

Line 475:5: E704 multiple statements on one line (def) Line 625:5: E704 multiple statements on one line (def)