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

Improve dryrun capabilty #5003

Merged
merged 2 commits into from
May 22, 2024
Merged

Improve dryrun capabilty #5003

merged 2 commits into from
May 22, 2024

Conversation

prckent
Copy link
Contributor

@prckent prckent commented May 21, 2024

Proposed changes

dryrun will exit cleanly (zero error code) rather than QMCPACK aborting. Small edits to docs and comments.

  Hamiltonian h0
  Kinetic         Kinetic energy
  LocalECP        CoulombPBCAB potential source: ion0
  NonLocalECP     NonLocalECPotential: ion0
  ElecElec        CoulombPBCAA potential: e_e
  IonIon          CoulombPBCAA potential: ion0_ion0

  dryrun == 1 : Skipping all QMC and loop elements 

Use --enable-timers=<value> command line option to increase or decrease level of timing information
Stack timer profile
Timer      Inclusive_time  Exclusive_time  Calls       Time_per_call
  Startup    54.0524    54.0524              1      54.052436786

QMCPACK execution completed successfully

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

  • Bugfix
  • New feature
  • Documentation or build script changes

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Ubuntu 22.04 gcc 11.4.0

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
  • Yes. Documentation has been added (if appropriate)

xmlNewProp(newmcptr, (const xmlChar*)"collected", (const xmlChar*)"yes");
//#else
// xmlNewProp(newmcptr,(const xmlChar*)"collected",(const xmlChar*)"no");
//#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Also please remove the commented lines of code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

app_log() << " Debug is done. Skip the rest of the input " << std::endl;
break;
}
app_log() << " dryrun == 1 : Skipping all QMC and loop elements " << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about making an early return instead of keep a giant scope of 'else'.
I learned this from https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, it is a matter of style. I prefer the early exit but some people do not.

Copy link
Contributor

Choose a reason for hiding this comment

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

If method is of sane size early exit should not present difficulty reading.

@prckent
Copy link
Contributor Author

prckent commented May 22, 2024

Test this please

@ye-luo ye-luo merged commit 1cbc463 into QMCPACK:develop May 22, 2024
39 of 40 checks passed
@prckent prckent deleted the fixdryrun branch May 24, 2024 23:09
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.

None yet

3 participants