Skip to content

Commit

Permalink
qcarchive tag, protocol passing (#3013)
Browse files Browse the repository at this point in the history
* initial qcarchive tag, protocol passing

* Update nitpick-exceptions

* Update CMakeLists.txt

* Update CMakeLists.txt
  • Loading branch information
loriab committed Oct 4, 2023
1 parent 9addd49 commit 3cbf5c8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions doc/sphinxman/source/nitpick-exceptions
Expand Up @@ -16,6 +16,7 @@ py:class pydantic.utils.Representation
py:class qcportal.client.FractalClient
py:class qcportal.FractalClient
py:class qcportal.PortalClient
py:class qcelemental.models.results.AtomicResultProtocols

## numpy inherited docstrings
#py:obj dtype
Expand Down
2 changes: 1 addition & 1 deletion external/upstream/ddx/CMakeLists.txt
Expand Up @@ -21,7 +21,7 @@ if(${ENABLE_ddx})

ExternalProject_Add(ddx_external
BUILD_ALWAYS 1
URL https://github.com/ddsolvation/ddX/archive/v0.4.2.tar.gz
URL https://github.com/ddsolvation/ddX/archive/v0.4.5.tar.gz
CONFIGURE_COMMAND ""
UPDATE_COMMAND ""
BUILD_COMMAND ${Python_EXECUTABLE} setup.py build
Expand Down
2 changes: 1 addition & 1 deletion external/upstream/libxc/CMakeLists.txt
Expand Up @@ -19,7 +19,7 @@ else()
# Default: use a stable release tarball of libxc. To use the
# development version of libxc, instead, comment the URL line,
# and uncomment the GIT lines.
URL https://gitlab.com/libxc/libxc/-/archive/6.1.0/libxc-6.1.0.tar.gz
URL https://gitlab.com/libxc/libxc/-/archive/6.2.2/libxc-6.2.2.tar.gz
#GIT_REPOSITORY https://gitlab.com/libxc/libxc.git
#GIT_TAG 5.1.5
#UPDATE_COMMAND ""
Expand Down
18 changes: 12 additions & 6 deletions psi4/driver/task_base.py
Expand Up @@ -44,7 +44,7 @@

import qcelemental as qcel
from qcelemental.models import AtomicInput, AtomicResult, DriverEnum

from qcelemental.models.results import AtomicResultProtocols
qcel.models.molecule.GEOMETRY_NOISE = 13 # need more precision in geometries for high-res findif
import qcengine as qcng

Expand Down Expand Up @@ -85,6 +85,10 @@ class AtomicComputer(BaseComputer):
driver: DriverEnum = Field(..., description="The resulting type of computation: energy, gradient, hessian, properties."
"Note for finite difference that this should be the target driver, not the means driver.")
keywords: Dict[str, Any] = Field(default_factory=dict, description="The keywords to use in the computation.")
protocols: Optional[Union[AtomicResultProtocols, Dict[str, Any]]] = Field({"stdout": True}, description="Output modifications.")
tag: str = Field("*", description="The tags to pass along to compute managers.")
priority: str = Field(1, description="The priority of a Task; higher priority will be pulled first. {high:2, normal:1, low:0}")
owner_group: Optional[str] = Field(None, description="group in the chown sense.")
computed: bool = Field(False, description="Whether quantum chemistry has been run on this task.")
result: Any = Field(default_factory=dict, description=":py:class:`~qcelemental.models.AtomicResult` return.")
result_id: Optional[str] = Field(None, description="The optional ID for the computation.")
Expand Down Expand Up @@ -115,9 +119,7 @@ def plan(self) -> AtomicInput:
"basis": self.basis
},
"keywords": self.keywords,
"protocols": {
"stdout": True,
},
"protocols": self.protocols,
"extras": {
"psiapi": True,
"wfn_qcvars_only": True,
Expand Down Expand Up @@ -180,7 +182,10 @@ def compute(self, client: Optional["qcportal.client.FractalClient"] = None):
method=self.method,
basis=self.basis,
keywords=self.keywords,
# protocols,
protocols=self.protocols,
tag=self.tag,
priority=self.priority,
owner_group=self.owner_group,
)
self.result_id = ids[0]
# NOTE: The following will re-run errored jobs by default
Expand Down Expand Up @@ -222,7 +227,8 @@ def compute(self, client: Optional["qcportal.client.FractalClient"] = None):
core.set_output_file(gof, True)
core.reopen_outfile()
logger.debug(pp.pformat(self.result.dict()))
core.print_out(_drink_filter(self.result.dict()["stdout"]))
if stdout := self.result.dict()["stdout"]:
core.print_out(_drink_filter(stdout))
self.computed = True

def get_results(self, client: Optional["qcportal.FractalClient"] = None) -> AtomicResult:
Expand Down
16 changes: 9 additions & 7 deletions tests/ddd-deriv/input.dat
Expand Up @@ -17,31 +17,33 @@ molecule h2o {
set basis cc-pVDZ
ans = -76.0266327341067125

energy('scf')
largs = {"protocols": {"stdout": False}, "tag": "test1"}

energy('scf', **largs)
compare_values(ans, variable('SCF TOTAL ENERGY'), 6, 'SCF energy') #TEST

gradient('scf')
gradient('scf', **largs)
compare_values(ans, variable('SCF TOTAL ENERGY'), 6, 'SCF gradient') #TEST

if distributed:
plan = gradient('scf', dertype=0, return_plan=True)
plan = gradient('scf', dertype=0, return_plan=True, **largs)
plan.compute(client)
snowflake.await_results()
plan.get_psi_results(client)
else:
gradient('scf', dertype=0)
gradient('scf', dertype=0, **largs)
compare_values(ans, variable('SCF TOTAL ENERGY'), 6, 'SCF gradient by energy') #TEST

hessian('scf')
hessian('scf', **largs)
compare_values(ans, variable('SCF TOTAL ENERGY'), 6, 'SCF hessian') #TEST

if distributed:
plan = hessian('scf', dertype=1, return_plan=True)
plan = hessian('scf', dertype=1, return_plan=True, **largs)
plan.compute(client)
snowflake.await_results()
plan.get_psi_results(client)
else:
hessian('scf', dertype=1)
hessian('scf', dertype=1, **largs)
compare_values(ans, variable('SCF TOTAL ENERGY'), 6, 'SCF hessian by gradient') #TEST

#if distributed:
Expand Down

0 comments on commit 3cbf5c8

Please sign in to comment.