ASE LAMMPSrun with N2P2 lammps-nnp binary

I'm trying to do parallel N2P2 calculations using the LAMMPS interface with the neural network potential for water. I'm not sure what would be the best place to post this issue, but since I believe this is an ASE issue, I'm trying here.

I've successfully compiled the lammps-nnp interface (https://compphysvienna.github.io/n2p2/interfaces/if_lammps.html) and am able to run the example code in n2p2/examples/interface-LAMMPS/H2O_RPBE-D3 directly in LAMMPS via the command line without any issues.

The parameters I am using in ASE are identical to what is being done in LAMMPS:

parameters = {'pair_style': 'nnp showew no showewsum 10 resetew no maxew 100 cflength 1.8897261328 cfenergy 0.0367493254 emap "1:H,2:O"',
              'pair_style': 'nnp dir ' + directory,
              'pair_coeff': ['* * 6.36']

I am creating the ASE calculator with:

from ase.calculators.lammpsrun import LAMMPS
lammps = LAMMPS(**parameters)

However, when I try to run a water system using ASE, I get the error:

ERROR: LAMMPS cutoff via pair_coeff keyword is smaller than maximum symmetry function cutoff.

I really do not understand what could be causing the error, since the pair_coeff is exactly the same as in the LAMMPS input files. I am also using the exact same files for the potential (the "dir" in the 'pair_style' parameter points to the same example directory).

Running the same LAMMPS binary directly prints out a confirmation that the radii are correct:

Checking consistency of cutoff radii (in LAMMPS units):
LAMMPS Cutoff (via pair_coeff)  :   6.360E+00
Maximum symmetry function cutoff:   6.350E+00
Cutoff radii are consistent.

Thus this clearly seems to be an issue with the LAMMPSrun calculator in ASE, probably somehow not setting the radii correctly. Maybe my syntax is incorrect, but currently the correct use of LAMMPSrun is not properly documented (that I know of).

I've attached my script with a modification for a cell with a single water molecule that reproduces the error, though you'll need a compiled lammps-nnp binary and the neural network potential files – if someone wants to test this out, I can share those privately.

lammpsrun_fail.py.txt

Edited by Toma Susi