lammps as python library

Hi,

I found something ‘weird’ that I could not explain and, maybe, somebody could help me understanding the reason behind.

I’m using lammps as a library for a very simple python code that runs twice the same simulation (intestine.in)

from lammps import lammps

import numpy as np

from mpi4py import MPI

comm = MPI.COMM_WORLD

me = comm.Get_rank()

lmp = lammps()

lmp.file(“intestine.in”)

lmp.close()

lmp = lammps()

lmp.file(“intestine.in”)

lmp.close()

If I run it in serial (no mpi4py etc.) it works perfectly and it runs both simulations.

If I run the parallel version, the first simulation runs correctly, but it crashes when it tries to run the second one (which is exactly the same of the first)

ERROR on proc 1: Divide by 0 in variable formula (src/variable.cpp:2876)

Last command: run ${Nsteps}

What it is even more puzzling to me is that this happens only if the initial geometry is read from a text data file , while if (the same geometry) is read from a restart binary file, both simulation ran as supposed.

If there were something wrong in any of my files or in how the lammps library was compiled, it wouldn’t run the first time. If there were something wrong in my python script, it wouldn’t work fine with the binary data file. I really do not understand.

Does anybody a clue of why this happens? The input files is attached, but the data file are too large.

On a non-related subject. I use the Digest version of the mailing list, but I am not sure how I can answer somebody’s post from there (other than copy and paste their email address and send a private message)

Best

Alessio

Dr. Alessio Alexiadis

intestine.in (3.63 KB)

Your input is too complex to track down anything.

You should see, if you can reproduce this issue with a (much) smaller data file and then try to remove as many instructions from your input file as possible so that the unexpected behavior is retained.

with the current input and information it is next to impossible to make any statement. and to track down possible issues, the input will need to be run with an instrumented binary or a memory checker like valgrind’s memcheck that can identify uninitialized memory reads or other issues causing unexpected/undetermined behavior.

axel.

Hi Axel,

Thanks for your answer

Your input is too complex to track down anything.

yes, I know. For the moment, I just wanted to know if this is a known issue… somehow.

As a matter of fact, my input works fine both in series and in parallel. It also works with both the binary and the text data-file. The problems seems to be limited only to the case when I try to run a sequence of 2 simulations, in the same pythons script, in parallel, and using the text data file.

Best

Hi Axel,

Thanks for your answer

Your input is too complex to track down anything.

yes, I know. For the moment, I just wanted to know if this is a known issue… somehow.

issues we know about or that people report to us are listed on github:

https://github.com/lammps/lammps/issues

if somebody reports an issue here, we also ask them to submit an issue on github and attach the necessary files to (easily and quickly and with as little compute power as possible) reproduce the issue.

axel.