From 3cbf5c83fb606585ceb4735e89d59a3842a717fd Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Wed, 4 Oct 2023 05:17:15 -0400 Subject: [PATCH] qcarchive tag, protocol passing (#3013) * initial qcarchive tag, protocol passing * Update nitpick-exceptions * Update CMakeLists.txt * Update CMakeLists.txt --- doc/sphinxman/source/nitpick-exceptions | 1 + external/upstream/ddx/CMakeLists.txt | 2 +- external/upstream/libxc/CMakeLists.txt | 2 +- psi4/driver/task_base.py | 18 ++++++++++++------ tests/ddd-deriv/input.dat | 16 +++++++++------- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/sphinxman/source/nitpick-exceptions b/doc/sphinxman/source/nitpick-exceptions index dc7adb6a6a1..a2800c57cff 100644 --- a/doc/sphinxman/source/nitpick-exceptions +++ b/doc/sphinxman/source/nitpick-exceptions @@ -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 diff --git a/external/upstream/ddx/CMakeLists.txt b/external/upstream/ddx/CMakeLists.txt index 540bc362248..aebf4afa294 100644 --- a/external/upstream/ddx/CMakeLists.txt +++ b/external/upstream/ddx/CMakeLists.txt @@ -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 diff --git a/external/upstream/libxc/CMakeLists.txt b/external/upstream/libxc/CMakeLists.txt index d1a8f7c6824..437e6c69dc0 100644 --- a/external/upstream/libxc/CMakeLists.txt +++ b/external/upstream/libxc/CMakeLists.txt @@ -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 "" diff --git a/psi4/driver/task_base.py b/psi4/driver/task_base.py index d79c39bc226..37a1b6cd538 100644 --- a/psi4/driver/task_base.py +++ b/psi4/driver/task_base.py @@ -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 @@ -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.") @@ -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, @@ -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 @@ -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: diff --git a/tests/ddd-deriv/input.dat b/tests/ddd-deriv/input.dat index 2f180924f9d..f7719ed07b4 100644 --- a/tests/ddd-deriv/input.dat +++ b/tests/ddd-deriv/input.dat @@ -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: