Parallelise MACE calculator

I’m slightly confused as to how to run the MACE calculator on multiple threads, I can’t seem to find anything in any of the documentation.

from mace.calculators import mace_mp
from ase import build

atoms = build.molecule('H2O')
calc = mace_mp(model="medium", dispersion=False, default_dtype="float32", device='cpu')
atoms.calc = calc
print(atoms.get_potential_energy())

That’s about as simple as the code can get. Thanks for any help!

This version of MACE is based on PyTorch, so I think you should get some parallelism controlled by OMP_NUM_THREADS.

You may be better off directing this question to the MACE developers here: ACEsuit/mace · Discussions · GitHub

1 Like

Thank you! It worked when using MKL_NUM_THREADS