Skip to content

Print block and warmup timings - #5058

Merged
ye-luo merged 3 commits into
QMCPACK:developfrom
prckent:qmctimings
Jun 25, 2024
Merged

Print block and warmup timings#5058
ye-luo merged 3 commits into
QMCPACK:developfrom
prckent:qmctimings

Conversation

@prckent

@prckent prckent commented Jun 23, 2024

Copy link
Copy Markdown
Contributor

Proposed changes

Improve progress monitoring by printing timings for warmup and blocks. Block timing and elapsed time given for first, last, and every ~25% progress. Max 5 timing lines printed.

Also changed output "End of a QMC block" to "End of a QMC section" for clarity.

Sample output:

658: VMC Warmup completed in 2.3138e-02 secs
658: =====================================================
658: --- Memory usage report : VMCBatched after Warmup ---
658: =====================================================
658: Available memory on node 0, free + buffers :   27749 MiB
658: Memory footprint by rank 0 on node 0       :     122 MiB
658: =====================================================
658: Completed block    1 of 100 average 0.01264 secs/block after 19.97 secs
658: Completed block   26 of 100 average 0.01644 secs/block after 20.39 secs
658: Completed block   51 of 100 average 0.01398 secs/block after 20.68 secs
658: Completed block   76 of 100 average 0.01492 secs/block after 21.1 secs
658: Completed block  100 of 100 average 0.01527 secs/block after 21.49 secs
658: ====================================================
658:   End of a VMC section
658:     QMC counter        = 5
658:     time step          = 0.5

What type(s) of changes does this code introduce?

  • New feature

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Laptop ubuntu 22 clang 15

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'
  • Yes. Code added or changed in the PR has been clang-formatted
  • No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

Comment thread src/QMCDrivers/DMC/DMCBatched.cpp Outdated
break;
}
// Progress messages if not aborting
if (!myComm->rank())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to see this printout even the run aborts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Comment thread src/Utilities/RunTimeManager.cpp Outdated
block + 1 == num_blocks)
{
log << "Completed block " << std::setw(4) << block + 1 << " of " << num_blocks << " average "
<< std::setprecision(4) << m_loop_time << " secs/block after " << m_elapsed << " secs" << std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need another std::setprecision(4) before m_elapsed since the previous got cleared by a string printout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/Utilities/RunTimeManager.cpp Outdated
int num_blocks) const
{
std::stringstream log;
if (block == 0 || block == num_blocks / 4 || block == num_blocks / 2 || block == (num_blocks * 3) / 4 ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel better to see the 25th, 50th, 75th and 100th step.
Could you do

if (block == 0 || block + 1 == num_blocks / 4 || block + 1 == num_blocks / 2 || block + 1 == (num_blocks * 3) / 4 ||

With the 50th step, I can just double the time by 2. With the 51th step, I need additional math.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion - makes for simple math in many common cases.

@ye-luo

ye-luo commented Jun 24, 2024

Copy link
Copy Markdown
Contributor

Test this please

@ye-luo
ye-luo enabled auto-merge June 24, 2024 18:13
@ye-luo
ye-luo merged commit 5202e10 into QMCPACK:develop Jun 25, 2024
@prckent
prckent deleted the qmctimings branch July 4, 2024 01:38
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