LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Problem when calling back to LAMMPS from Python
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Problem when calling back to LAMMPS from Python


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Wed, 21 Jun 2017 19:47:21 -0400



On Wed, Jun 21, 2017 at 6:14 PM, Shuang Yang <ysmashimaro@...43...4...> wrote:
Hi,

I am trying to build LAMMPS with Python support and it works for the most part for my tests. Calling LAMMPS from Python works fine (including PyLammps) and Python commands works fine too, but when I try to callback to LAMMPS, errors happen. Here is the situation:

in2.python:

python           loop input 4 10 1.0 -4.0 SELF format iffp file funcs.py
python           loop invoke

funcs.py:

def loop(N,cut0,thresh,lmpptr):
  print "LOOP ARGS",N,cut0,thresh,lmpptr
  from lammps import lammps

log.lammps:

LAMMPS (31 Mar 2017)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
python           loop input 4 10 1.0 -4.0 SELF format iffp file funcs.py
python           loop invoke

Output on console:

~/lammps/examples/python$ ../../src/lmp_wheeler -in in2.python

LAMMPS (31 Mar 2017)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
LOOP ARGS 10 1.0 -4.0 <PyCObject object at 0x7f0b4cbd6620>
ERROR on proc 0: Python function evaluation failed (../python.cpp:253)
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1
:
system msg for write_line failure : Bad file descriptor

Could anyone help me please? Thanks a lot!

​please update LAMMPS to the lastest patch, but at least to version 19 May 2017​.

​axel.​
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...6297....sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...12...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.