-
Notifications
You must be signed in to change notification settings - Fork 140
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
Don't allow batched version to accept hamiltonian estimator input #4643
base: develop
Are you sure you want to change the base?
Don't allow batched version to accept hamiltonian estimator input #4643
Conversation
@@ -176,8 +177,18 @@ bool HamiltonianFactory::build(xmlNodePtr cur) | |||
targetH->addOperator(std::move(hs), "Grid", true); | |||
} | |||
} | |||
else if (cname == "flux") | |||
{ | |||
if (potName.size() < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (potName.size() < 1) | |
if (potName.empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of adding legacy_estimator
? there is no guarantee we make the legacy ones working but at least users may have a chance to force it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not in favor of that as it will inhibit refactoring QMCHamiltonian. If there is a batched version the legacy version should be disabled for a batched run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by the finish of ecp the manual should not include mention of using the tag estimator
in the Hamiltonian input node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not in favor of that as it will inhibit refactoring QMCHamiltonian. If there is a batched version the legacy version should be disabled for a batched run.
If there is a batched version, the old input through Hamiltonian should be blocked. What if not? I would prefer giving user a chance to try out things without modifying the source code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by the finish of ecp the manual should not include mention of using the tag
estimator
in the Hamiltonian input node.
I agree with this but the reality is we don't port estimators fast enough.
src/QMCApp/QMCMain.cpp
Outdated
batched = true; | ||
break; | ||
} | ||
ham_pool_->put(cur, batched); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the following work?
ham_pool_->put(cur, my_project_.getDriverVersion() == ProjectData::DriverVersion::BATCH);
If it works, please change the following place as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -45,7 +45,7 @@ class MinimalHamiltonianPool | |||
doc.parseFromString(hamiltonian_xml); | |||
|
|||
xmlNodePtr root = doc.getRoot(); | |||
hpool.put(root); | |||
hpool.put(root,true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply clang-format. There should be a space after the comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -176,8 +177,18 @@ bool HamiltonianFactory::build(xmlNodePtr cur) | |||
targetH->addOperator(std::move(hs), "Grid", true); | |||
} | |||
} | |||
else if (cname == "flux") | |||
{ | |||
if (potName.size() < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of adding legacy_estimator
? there is no guarantee we make the legacy ones working but at least users may have a chance to force it.
if (potName.size() < 1) | ||
potName = "flux"; | ||
targetH->addOperator(std::make_unique<ConservedEnergy>(), potName, false); | ||
} | ||
else if (cname == "estimator") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change here like cname == "estimator" || cname == "legacy_estimator"
and the error check as
if (batched && cname == "estimator")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this change, legacy estimators that are going to continue to be allowed should be explicitly changed as the flux estimator has been. They are not "estimators" by the definition we will be using coming forward. They should be renabled individually if necessary. Further discussion of this should return to #4637 which this PR addresses, if this is the functionality you think is correct argue for it in #4637 with @jtkrogel and we can amend this PR or make another one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing to flux
or legacy_estimator
, I prefer the latter a more generic way.
We can only allow using legacy_estimator
when batched driver is in use and the selected estimator doesn't have an actual batched implementation.
@@ -80,7 +80,7 @@ | |||
<pairpot type="pseudo" name="PseudoPot" source="ion0" wavefunction="psi0" format="xml"> | |||
<pseudo elementType="C" href="C.BFD.xml"/> | |||
</pairpot> | |||
<!-- <estimator type="flux" name="Flux"/> --> | |||
<!-- <flux name="Flux"/> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line.
@@ -80,7 +80,7 @@ | |||
<pairpot type="pseudo" name="PseudoPot" source="ion0" wavefunction="psi0" format="xml"> | |||
<pseudo elementType="C" href="C.BFD.xml"/> | |||
</pairpot> | |||
<!-- <estimator type="flux" name="Flux"/> --> | |||
<!-- <flux name="Flux"/> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed review
@@ -176,8 +177,18 @@ bool HamiltonianFactory::build(xmlNodePtr cur) | |||
targetH->addOperator(std::move(hs), "Grid", true); | |||
} | |||
} | |||
else if (cname == "flux") | |||
{ | |||
if (potName.size() < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not in favor of that as it will inhibit refactoring QMCHamiltonian. If there is a batched version the legacy version should be disabled for a batched run.
@@ -45,7 +45,7 @@ class MinimalHamiltonianPool | |||
doc.parseFromString(hamiltonian_xml); | |||
|
|||
xmlNodePtr root = doc.getRoot(); | |||
hpool.put(root); | |||
hpool.put(root,true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -176,8 +177,18 @@ bool HamiltonianFactory::build(xmlNodePtr cur) | |||
targetH->addOperator(std::move(hs), "Grid", true); | |||
} | |||
} | |||
else if (cname == "flux") | |||
{ | |||
if (potName.size() < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by the finish of ecp the manual should not include mention of using the tag estimator
in the Hamiltonian input node.
src/QMCApp/QMCMain.cpp
Outdated
batched = true; | ||
break; | ||
} | ||
ham_pool_->put(cur, batched); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider this PR complete in its solution to #4637. I will not further update it to track develop unless it is approved.
if (potName.size() < 1) | ||
potName = "flux"; | ||
targetH->addOperator(std::make_unique<ConservedEnergy>(), potName, false); | ||
} | ||
else if (cname == "estimator") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this change, legacy estimators that are going to continue to be allowed should be explicitly changed as the flux estimator has been. They are not "estimators" by the definition we will be using coming forward. They should be renabled individually if necessary. Further discussion of this should return to #4637 which this PR addresses, if this is the functionality you think is correct argue for it in #4637 with @jtkrogel and we can amend this PR or make another one.
b4b4c40
to
3101da4
Compare
Taking a look at this, we are not going to add legacy_estimator in future. We need to focus on estimators for the batched code and not get entangled with supporting more legacy. This would take time, resources and tackling complexity we should simply not engage with. Users should use updated estimators for the batched code or simply run an older version until their needed estimator is available. @jtkrogel Are you OK with |
Test this please |
I don't understand the need for changing the notation around "flux" ( For the purpose of this PR, the only requirement I see is that Perhaps we just learned that "flux" is a higher priority estimator for porting than others. I don't think that should hold up the rest of the work here. |
I feel unnecessary to introduce |
I think it is desirable to block everything that has not been examined and properly ported. |
Proposed changes
Prevent legacy estimator inputs in batched input.
This addresses issue #4637
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
osx laptop
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.