Skip to content

OpenMPI build of NWChem is not called correctly #475

@jlheflin

Description

@jlheflin

Describe the bug
When using QCEngine to run NWChem, if the executed NWChem version was build with OpenMPI, QCEngine is unable to do so due to the underlying executable needed to be run with mpirun.

To Reproduce

Have a version of NWChem that was compiled with OpenMPI:

  • Homebrew
  • Nix
  • Ubuntu via the nwchem-openmpi or nwchem-mpich packages
  • Fedora via the nwchem-openmpi or nwchem-mpich packages

Run the following python code:

import qcengine as qcng

import qcelemental as qcel

mol = qcel.models.Molecule.from_data("""
    O  0.0  0.000  -0.129
    H  0.0 -1.494  1.027
    H  0.0  1.494  1.027
""")

model = qcel.models.AtomicInput(
    molecule=mol,
    driver="energy",
    model={"method": "SCF", "basis": "sto-3g"}
)

ret = qcng.compute(model, "nwchem")

Expected behavior
Expected behavior is no error return

Additional context
I understand that there is the ability to utilize task_config to provide an mpiexec_command but I am unable to do so in a way that works. I am able to bypass this error by utilizing an executable bash script named "nwchem" in my PATH:

#!/bin/bash
REAL_NWCHEM="/home/jacob/.nix-profile/bin/nwchem"
if [[ "$0" == "$REAL_NWCHEM" ]]; then
    echo "Error: Wrapper is calling itself!" >&2
    exit 1
fi
exec mpirun "$REAL_NWCHEM" "$@"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions