Skip to content

Commit

Permalink
try new qcfractal 0.50 (psi4#3049)
Browse files Browse the repository at this point in the history
* Update ecosystem.yml

* Update azure-pipelines-windows.yml

* Update run_psi4.py

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* Update azure-pipelines-windows.yml

* merged changes (psi4#3063)

* Update azure-pipelines-windows.yml

* Update azure-pipelines.yml

* Update ecosystem.yml

* filepath

* more

* try new qcel

* qcf back

* undo

* fix

* more

* back to published qcel

* new llvm for windows

* the snowflake has merged
  • Loading branch information
loriab authored Nov 3, 2023
1 parent df9a0dd commit cf2c6ad
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .azure-pipelines/azure-pipelines-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

gcc_latest:
CXX_COMPILER: 'g++'
PYTHON_VER: '3.9'
PYTHON_VER: '3.12'
C_COMPILER: 'gcc'
F_COMPILER: 'gfortran'
BUILD_TYPE: 'release'
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
blas=*=mkl \
mkl-include \
networkx \
pytest>=7.0.1 \
conda-forge::pytest>=7.0.1 \
eigen \
boost-cpp \
pytest-xdist \
libboost-headers \
conda-forge::pytest-xdist \
msgpack-python \
conda-forge::qcelemental \
conda-forge::qcengine \
Expand Down
30 changes: 15 additions & 15 deletions .azure-pipelines/azure-pipelines-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
vmImage: 'windows-2022'
timeoutInMinutes: 360
variables:
llvm.version: '15.0.7'
llvm.version: '16.0.6'
mkl.version: '2022.1.0'
cmake.build_type: 'Release'
conda.build: false
ctest.type: 'smoke'
pytest.type: 'quick'
MKL_CBWR: AVX
PYTHON_VERSION: '3.8'
PYTHON_VERSION: '3.10'
steps:

# Check Python
Expand All @@ -26,8 +26,9 @@ jobs:
if "%PYTHON_VERSION%"=="3.9" set VALID=true
if "%PYTHON_VERSION%"=="3.10" set VALID=true
if "%PYTHON_VERSION%"=="3.11" set VALID=true
if "%PYTHON_VERSION%"=="3.12" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "python.version" value: "%PYTHON_VERSION%". Valid values: "3.8" through "3.11".
echo ERROR: Invalid "python.version" value: "%PYTHON_VERSION%". Valid values: "3.8" through "3.12".
exit 1
)
displayName: "Check Python version: $(python.version)"
Expand Down Expand Up @@ -96,10 +97,10 @@ jobs:
# Install Miniconda
- script: |
choco install miniconda3 --yes
set PATH=C:\tools\miniconda3\Scripts;C:\tools\miniconda3;C:\tools\miniconda3\Library\bin;C:\tools\miniconda3\Library\mingw-w64\bin;%PATH%
choco install miniforge3 --yes
set PATH=C:\tools\miniforge3\Scripts;C:\tools\miniforge3;C:\tools\miniforge3\Library\bin;C:\tools\miniforge3\Library\mingw-w64\bin;%PATH%
echo '##vso[task.setvariable variable=PATH]%PATH%'
set LIB=C:\tools\miniconda3\Library\lib;%LIB%
set LIB=C:\tools\miniforge3\Library\lib;%LIB%
echo '##vso[task.setvariable variable=LIB]%LIB%'
conda --version
displayName: "Install Miniconda"
Expand All @@ -108,12 +109,11 @@ jobs:
# conda config --append channels conda-forge
- script: |
conda config --set always_yes yes
conda config --add channels conda-forge
conda config --add channels conda-forge/label/libint_dev
conda config --set channel_priority strict
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda info
conda list
displayName: "Configure Miniconda"
# Create conda enviroment
Expand All @@ -124,7 +124,7 @@ jobs:
anaconda-project ^
conda-build ^
eigen ^
boost-cpp ^
libboost-headers ^
conda-verify ^
intel-openmp=%MKL_VERSION% ^
mkl-devel=%MKL_VERSION% ^
Expand All @@ -145,7 +145,7 @@ jobs:
libint=2.7.3dev1 ^
qcelemental ^
qcengine ^
pydantic=1.10.10 ^
pydantic=1.10.13 ^
optking ^
scipy
conda install --only-deps anaconda-client
Expand Down Expand Up @@ -195,11 +195,11 @@ jobs:
-DENABLE_XHOST=OFF ^
-DCMAKE_CXX_FLAGS="/arch:AVX" ^
-DMAX_AM_ERI=!MAX_AM_ERI! ^
-DPython_EXECUTABLE="C:/tools/miniconda3/python.exe" ^
-DPython_NumPy_INCLUDE_DIR="C:/tools/miniconda3/lib/site-packages/numpy/core/include" ^
-DEigen3_ROOT="C:/tools/miniconda3/Library" ^
-DBOOST_ROOT="C:/tools/miniconda3/Library" ^
-DMultiprecision_ROOT="C:/tools/miniconda3/Library" ^
-DPython_EXECUTABLE="C:/tools/miniforge3/python.exe" ^
-DPython_NumPy_INCLUDE_DIR="C:/tools/miniforge3/lib/site-packages/numpy/core/include" ^
-DEigen3_ROOT="C:/tools/miniforge3/Library" ^
-DBOOST_ROOT="C:/tools/miniforge3/Library" ^
-DMultiprecision_ROOT="C:/tools/miniforge3/Library" ^
-DBUILD_Libint2_GENERATOR=OFF ^
-DCMAKE_INSIST_FIND_PACKAGE_gau2grid=ON ^
-DCMAKE_INSIST_FIND_PACKAGE_Libint2=ON ^
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

ecosystem:
strategy:
fail-fast: true
fail-fast: false
matrix:
cfg:

- runs-on: ubuntu-latest
python-version: "3.10"
python-version: "3.12"
mkl-version: ""
base-channel: "conda-forge"
pytest-marker-expr: "addon and not long"
Expand All @@ -40,9 +40,10 @@ jobs:
-D OpenMP_CXX_FLAG="-fopenmp=libiomp5"
# Notes:
# * libiomp5 is picking up naturally but left explicit as guide
# * as long as we're using mac to test legacy QCFractal, stick with py39

- runs-on: windows-latest
python-version: "3.9"
python-version: "3.12"
mkl-version: "=2022.1"
base-channel: "conda-forge"
pytest-marker-expr: "addon and not long and not d2ints"
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
- libblas=*=*mkl
- python=${{ matrix.cfg.python-version }}
# build
- boost-cpp
- libboost-headers
- cmake
- c-compiler
- cxx-compiler
Expand Down Expand Up @@ -230,8 +231,10 @@ jobs:
# one of mkl=${{ matrix.cfg.mkl-version }} or mkl-devel=${{ matrix.cfg.mkl-version }} needed to avoid DLL runtime error
EOF
if [[ "${{ runner.os }}" == "Linux" ]]; then
sed -i "s;- qcfractal;- qcarchive/label/next::qcfractal;g" run.yaml # >=0.50b10
# qcfractal >=0.50
sed -i "s;- qcportal;- postgresql;g" run.yaml
# not for py312
sed -i "s;- dftd4-python;;g" run.yaml
fi
if [[ "${{ runner.os }}" == "macOS" ]]; then
sed -E -i.bak "s;- qcfractal;- qcfractal=0.15.8.1;g" run.yaml
Expand All @@ -247,6 +250,9 @@ jobs:
sed -i "s;- openfermion>=1.0;;g" run.yaml
sed -i "s;- openfermionpsi4;;g" run.yaml
sed -i "s;- memory_profiler;;g" run.yaml
# not for py312
sed -i "s;- dftd3-python;;g" run.yaml
sed -i "s;- dftd4-python;;g" run.yaml
fi
printf "\n<<< build.yaml >>>\n"
cat build.yaml
Expand Down Expand Up @@ -429,7 +435,20 @@ jobs:
qcengine info
fi
- name: Patch QCFractal for Python
- name: Special Config - QCElemental Dep
if: false
run: |
conda remove qcelemental --force
python -m pip install git+https://github.com/MolSSI/QCElemental.git@v0.29.0.dev2 --no-deps
- name: Special Config - QCFractal Dep
if: runner.os == 'Linux'
# remove after snowflake fix in https://github.com/MolSSI/QCFractal/pull/781 released in v0.52
run: |
conda remove qcfractal --force
python -m pip install -e 'git+https://github.com/MolSSI/QCFractal.git@main#egg=qcfractal&subdirectory=qcfractal'
- name: Special Config - Patch Legacy QCFractal for Python
if: runner.os == 'macOS'
run: |
cat /Users/runner/miniconda3/envs/baseenv/lib/python${{ matrix.cfg.python-version }}/site-packages/qcfractal/queue/executor_adapter.py
Expand All @@ -451,7 +470,7 @@ jobs:
- name: Test Addons with CTest
if: false
working-directory: ./objdir
run: ctest -L addon -j2 --output-on-failure
run: ctest -L smoke -LE d2ints -j2 --output-on-failure

- name: "Test Addons with Pytest, base channel only `-c ${{ matrix.cfg.base-channel }} -c psi4/label/dev` (L, M, W)"
if: matrix.cfg.base-channel == 'conda-forge'
Expand Down
2 changes: 1 addition & 1 deletion external/upstream/qcelemental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else()

ExternalProject_Add(qcelemental_external
BUILD_ALWAYS 1
URL https://github.com/MolSSI/QCElemental/archive/v0.26.0.tar.gz
URL https://github.com/MolSSI/QCElemental/archive/v0.27.1.tar.gz
DOWNLOAD_NO_EXTRACT 1
CONFIGURE_COMMAND ""
UPDATE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion external/upstream/qcengine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else()
ExternalProject_Add(qcengine_external
DEPENDS qcelemental_external
BUILD_ALWAYS 1
URL https://github.com/MolSSI/QCEngine/archive/v0.28.1.tar.gz
URL https://github.com/MolSSI/QCEngine/archive/v0.29.0.tar.gz
DOWNLOAD_NO_EXTRACT 1
CONFIGURE_COMMAND ""
UPDATE_COMMAND ""
Expand Down
22 changes: 11 additions & 11 deletions psi4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
from pathlib import Path
psi4_module_loc = Path(__file__).resolve().parent

prefix = Path("@CMAKE_INSTALL_PREFIX@".replace("\\", "/"))
cmake_install_bindir = "@CMAKE_INSTALL_BINDIR@".replace("\\", "/")
cmake_install_datadir = "@CMAKE_INSTALL_DATADIR@".replace("\\", "/")
cmake_install_libdir = "@CMAKE_INSTALL_LIBDIR@".replace("\\", "/")
pymod_install_libdir = "@PYMOD_INSTALL_LIBDIR@".lstrip("/")
prefix = Path(r"@CMAKE_INSTALL_PREFIX@".replace("\\", "/"))
cmake_install_bindir = r"@CMAKE_INSTALL_BINDIR@".replace("\\", "/")
cmake_install_datadir = r"@CMAKE_INSTALL_DATADIR@".replace("\\", "/")
cmake_install_libdir = r"@CMAKE_INSTALL_LIBDIR@".replace("\\", "/")
pymod_install_libdir = r"@PYMOD_INSTALL_LIBDIR@".lstrip("/")
full_pymod = (prefix / cmake_install_libdir / pymod_install_libdir / "psi4").resolve()
full_data = prefix / cmake_install_datadir / "psi4"
full_bin = prefix / cmake_install_bindir
rel_data = os.path.relpath(full_data, start=full_pymod)
rel_bin = os.path.relpath(full_bin, start=full_pymod)

executable = psi4_module_loc.joinpath(rel_bin, "psi4")
executable_exe = (Path("/opt/anaconda1anaconda2anaconda3") / "Scripts" / "psi4.exe").resolve(strict=False)
executable_exe = (Path(r"/opt/anaconda1anaconda2anaconda3") / "Scripts" / "psi4.exe").resolve(strict=False)
if executable_exe.exists():
# Win conda-build generates this unbeknownst to CMake
executable = executable_exe
Expand Down Expand Up @@ -110,15 +110,15 @@
# rather than letting PYTHONPATH rule for the few.
import sys
if "@ENABLE_PCMSolver@".upper() in ["1", "ON", "YES", "TRUE", "Y"]: # PCMSolver
sys.path.insert(1, "@PCMSolver_PYMOD@")
sys.path.insert(1, r"@PCMSolver_PYMOD@")
if "@ENABLE_cppe@".upper() in ["1", "ON", "YES", "TRUE", "Y"]: # cppe
sys.path.insert(1, "@cppe_PYMOD@")
sys.path.insert(1, r"@cppe_PYMOD@")
if "@ENABLE_ddx@".upper() in ["1", "ON", "YES", "TRUE", "Y"]: # pyddx
sys.path.insert(1, "@pyddx_PYMOD@")
sys.path.insert(1, r"@pyddx_PYMOD@")
if "@ENABLE_libefp@".upper() in ["1", "ON", "YES", "TRUE", "Y"]: # pylibefp
sys.path.insert(1, "@pylibefp_PYMOD@")
sys.path.insert(1, r"@pylibefp_PYMOD@")
if "@ENABLE_gdma@".upper() in ["1", "ON", "YES", "TRUE", "Y"]: # gdma
sys.path.insert(1, "@gdma_PYMOD@")
sys.path.insert(1, r"@gdma_PYMOD@")

# Create a custom logger
import logging
Expand Down
25 changes: 24 additions & 1 deletion psi4/driver/task_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,33 @@ def _singlepointrecord_to_atomicresult(spr: "qcportal.singlepoint.SinglepointRec
# QCFractal `next` database stores return_result, properties, and extras["qcvars"] merged
# together and with lowercase keys. `to_qcschema_result` partitions properties back out,
# but we need to restore qcvars keys, types, and dimensions.
# QCFractal v0.51 starts saving space by removing qcvars whose qcvar.lower().replace(" ", "_")
# are defined, so we also need to reconstruct these.
shared_qcvars = {}
for pv, dpv in atres.properties.dict().items():
if dpv is None:
continue
if pv.startswith("return_") or pv.endswith("_moment"):
continue
if pv in [
"scf_one_electron_energy",
"scf_two_electron_energy",
"scf_vv10_energy",
"scf_xc_energy",
"scf_dispersion_correction_energy",
"mp2_same_spin_correlation_energy",
"mp2_opposite_spin_correlation_energy",
"ccsd_same_spin_correlation_energy",
"ccsd_opposite_spin_correlation_energy",
"ccsd_prt_pr_correlation_energy",
"ccsd_prt_pr_total_energy",
]:
continue
shared_qcvars[pv.upper().replace("_", " ")] = dpv
qcvars = atres.extras.pop("extra_properties")
qcvars.pop("return_result")
qcvars = {k.upper(): p4util.plump_qcvar(k, v) for k, v in qcvars.items()}
atres.extras["qcvars"] = qcvars
atres.extras["qcvars"] = {**qcvars, **shared_qcvars}

return atres

Expand Down
14 changes: 7 additions & 7 deletions psi4/run_psi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
executable = Path(__file__).resolve()
psi4_exe_loc = executable.parent

prefix = Path("@CMAKE_INSTALL_PREFIX@".replace("\\", "/"))
cmake_install_bindir = "@CMAKE_INSTALL_BINDIR@".replace("\\", "/")
cmake_install_datadir = "@CMAKE_INSTALL_DATADIR@".replace("\\", "/")
cmake_install_libdir = "@CMAKE_INSTALL_LIBDIR@".replace("\\", "/")
pymod_install_libdir = "@PYMOD_INSTALL_LIBDIR@".lstrip("/")
psi4_install_cmakedir = "@psi4_INSTALL_CMAKEDIR@".replace("\\", "/")
prefix = Path(r"@CMAKE_INSTALL_PREFIX@".replace("\\", "/"))
cmake_install_bindir = r"@CMAKE_INSTALL_BINDIR@".replace("\\", "/")
cmake_install_datadir = r"@CMAKE_INSTALL_DATADIR@".replace("\\", "/")
cmake_install_libdir = r"@CMAKE_INSTALL_LIBDIR@".replace("\\", "/")
pymod_install_libdir = r"@PYMOD_INSTALL_LIBDIR@".lstrip("/")
psi4_install_cmakedir = r"@psi4_INSTALL_CMAKEDIR@".replace("\\", "/")
full_pymod = (prefix / cmake_install_libdir / pymod_install_libdir / "psi4").resolve()
full_data = prefix / cmake_install_datadir / "psi4"
full_bin = prefix / cmake_install_bindir
Expand Down Expand Up @@ -187,7 +187,7 @@
print("""Install "psi4-dev" via `conda install psi4-dev -c psi4[/label/dev]`, then reissue command.""")

if args['psiapi_path']:
pyexe_dir = os.path.dirname("@Python_EXECUTABLE@")
pyexe_dir = os.path.dirname(r"@Python_EXECUTABLE@")
print(f"""export PATH={pyexe_dir}:$PATH # python interpreter\nexport PATH={bin_dir}:$PATH # psi4 executable\nexport PYTHONPATH={lib_dir}:$PYTHONPATH # psi4 pymodule""")
# TODO Py not quite right on conda Windows and Psi include %PREFIX$. but maybe not appropriate for Win anyways
sys.exit()
Expand Down
2 changes: 1 addition & 1 deletion tests/pytests/test_dipoles.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pytest.param({'name': 'dct', 'options': {'dct_type': 'df'}, 'varname': 'DCT'}, id='df-rdct'),
pytest.param({'name': 'dct', 'options': {'dct_type': 'df', 'reference': 'uhf'}, 'varname': 'DCT'}, id='df-udct'),
pytest.param({'name': 'ccsd', 'options': {'opdm_relax': 'true'}, 'varname': 'CCSD'}, id='ccsd'),
pytest.param({'name': 'ccsd', 'options': {'opdm_relax': 'true', 'reference': 'uhf'}, 'varname': 'CCSD'}, id='ccsd'),
pytest.param({'name': 'ccsd', 'options': {'opdm_relax': 'true', 'reference': 'uhf'}, 'varname': 'CCSD'}, id='uccsd'),
]
)
def test_dipole(inp):
Expand Down

0 comments on commit cf2c6ad

Please sign in to comment.