Segmentation fault with NNP (neural network potential) based GCMC

Hi Users,
I am trying to run NNP (neural network potential) based GCMC simulation of CO2 in MOF. However, I am ending up in getting a segmentation fault. Before posting here, I looked into mailing list but could not get fix the issue.

Note that I developed my model using the nequip architecture (GitHub - mir-group/nequip: NequIP is a code for building E(3)-equivariant interatomic potentials) and
I am using 17 Apr 2024 - Development version of LAMMPS.

To reproduce the error, the files are attached.

CO2.txt (168 Bytes)
data.mof (34.4 KB)
in.mof.co2 (1.8 KB)
nnp_model.pth (1.2 MB)

Can anyone help me in fixing this error? Thanks in advance.

Thanks,
Omer

You are using code that is not part of LAMMPS. Thus you either have to reproduce the segfault with features that are available in LAMMPS or you have to contact the developers of the external code. Since LAMMPS is open source, people are free to add code or modify code, but unless this is integrated back into the LAMMPS distribution, they will also have to handle support for it and users of these external modules have to understand that these changes or additions have not been vetted and tested by the LAMMPS developers and may have problems when used in ways the original developers have not intended or expected.

Thanks Axel,
Yes, I know that Lammps has been patched with nequip, but the nequip model works perfectly with other features of Lammps (e.g. NPT, NVT MD simulations). It also gives no segfault error when I just add molecules to the system using MC. But when I do GCMC simulation (inserterion/deletion), it gives segfault error after a certain step (not immediately, see log file) I think similar error was faced for ReaxFF in previous issues (Unexpected behaviour during hybrid Monte-Carlo simulations (ReaxFF)). I have the same problem for nequip NNP, I would like to find out the source of this error, but I need help as I’m not an expert.

log.out (9.4 KB)

Best,
Omer

As I have already explained, you won’t get that help here unless you can reproduce the issue with features that are available in LAMMPS.

Then you need to find a collaborator that has the expertise you need. In no way does not having the expertise entitle you to get assistance from the LAMMPS developers for as long as you are using a modified version of LAMMPS.

have you tried applying the solution(s) discussed in that topic?

Yes, I have applied the solutions, I have listed the steps below;

  • I applied overlap cutoff. It works but after some insertion/deletion steps threw seqfault.
  • And after this I applied full_energy option and I used intra-energy keyword, but code threw seqfault also.
  • I have edited the code at src/MC/fix_gcmc.cpp FixGCMC::attempt_atomic_translation_full() :
- energy_stored = energy_before;
+ energy_stored = energy_full();

I don’t know if this information will help us, but in the meantime I noticed something; when I make only insertion to the GCMC by giving positive intra energy, the code does not break. My guess is that something goes wrong in the code during deletions.

Thank you in advance,
Omer

You have failed to provide any prove that this is an issue of LAMMPS itself. So I am closing this topic since there is nothing more that we can do.