[ase-users] Unable to use LAMMPS via ASE

Jacob Madsen jamad at fysik.dtu.dk
Fri Aug 5 18:12:03 CEST 2016


Dear Toma,

Sorry about the late response.

The answer to your second question is

   parameters = { 'pair_style' : 'eam', 'pair_coeff' : '* * Pd_u3.eam' }
   calc = LAMMPS(parameters=parameters, files=['Pd_u3.eam'])

I was unable to find good answers to your other questions.
I don't personally use LAMMPSrun, since it lacks support for the charge optimized potentials I use.

I use a new lammps calculator, that I am currently developing, you are welcome to give it a try.
It is available from my gitlab: https://gitlab.com/jamad/lammps-ase

A small example is included, it shows how to do what you describe in your questions.

The calculator is currently only tested for the EAM and COMB type potentials, but it should work for all simple potentials.
Write back if you decide to try it and have any questions.

Best,

Jacob

________________________________
Fra: Toma Susi [toma.susi at univie.ac.at]
Sendt: 11. juli 2016 16:28
Til: Jacob Madsen
Cc: ase-users; jani.kotakoski at univie.ac.at; a1063348 at unet.univie.ac.at
Emne: Re: [ase-users] Unable to use LAMMPS via ASE

Dear Jacob,

Sorry for the delay, we only now got to fully testing this... but at least I can confirm that this version of LAMMPSrun does work. Thank you!

I do have a few questions, though:
– Is there a way to write each step of the optimization to a trajectory? Attaching anything to the calculator or giving a "traj = " command to the optimizer do not seem to be implemented. Copying the LAMMPS dump command into the commands doesn't seem to work either (no xyz is written and it only dumps one structure into the trj temp file)
– What is the correct syntax for specifying the pair_coeff command to LAMMPS? It seems to weirdly read only the first letter even despite the quotes. I tried just specifying the potential file and leaving the command out, but that seemed to fall back to the default potential.
– Does LAMMPSrun parallelize? Ie. can I just run "mpirun -np 4 gpaw-python ase-lammps-script.py" and trust it will work well?

Many thanks for your help,
Toma


On 28 Jun 2016, at 16:16, Jacob Madsen <jamad at fysik.dtu.dk<mailto:jamad at fysik.dtu.dk>> wrote:

Dear Toma,

I got the same error as you using LAMMPSrun. I have tracked down the bug and submitted a merge request.
The fixed lammpsrun.py script is attached, the wiki example works for me with the changes made.

You may want to create the calculator as below, in order to inspect the LAMMPS code generated by ASE.
calc = LAMMPS(tmp_dir="dir_name", keep_tmp_files=True)


Best,
Jacob


________________________________
Fra: ase-users-bounces at listserv.fysik.dtu.dk<mailto:ase-users-bounces at listserv.fysik.dtu.dk> [ase-users-bounces at listserv.fysik.dtu.dk<mailto:ase-users-bounces at listserv.fysik.dtu.dk>] på vegne af Toma Susi via ase-users [ase-users at listserv.fysik.dtu.dk<mailto:ase-users at listserv.fysik.dtu.dk>]
Sendt: 28. juni 2016 13:00
Til: ase-users
Cc: jani.kotakoski at univie.ac.at<mailto:jani.kotakoski at univie.ac.at>; a1063348 at unet.univie.ac.at<mailto:a1063348 at unet.univie.ac.at>
Emne: Re: [ase-users] Unable to use LAMMPS via ASE

Dear users,

We would really appreciate any information on running LAMMPS via ASE, even if just to confirm this works for some software configuration.

Thank you,
Toma


On 22 Jun 2016, at 13:58, Toma Susi <toma.susi at univie.ac.at<mailto:toma.susi at univie.ac.at>> wrote:

Dear all,
 We've been trying to use ASE with a LAMMPS calculator, both using the LAMMPSrun example (https://wiki.fysik.dtu.dk/ase/ase/calculators/lammpsrun.html) and the LAMMPSlib implentation (https://svn.fysik.dtu.dk/projects/ase-extra/trunk/ase/calculators/lammpslib.py) and the example found there.

Starting with the LAMMPSlib example script, first I should note that I get an error with just the atom addition "alh = al + h", but that's not the main issue.

If I try to run the script for just Al (or anything else), setting the calculator produces no error, but commands such as get_potential_energy() simply produce no output, and no errors, nothing.

---------

Turning then to the LAMMPSrun implementation. When we try to run the simple example on the ASE wiki, we get the following error:

>>> print(NaCl.get_stress())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/daryoush/.local/lib/python2.7/site-packages/ase/atoms.py", line 716, in get_stress
stress = self._calc.get_stress(self)
File "/home/daryoush/.local/lib/python2.7/site-packages/ase/calculators/lammpsrun.py", line 141, in get_stress
self.update(atoms)
File "/home/daryoush/.local/lib/python2.7/site-packages/ase/calculators/lammpsrun.py", line 149, in update
self.calculate(atoms)
File "/home/daryoush/.local/lib/python2.7/site-packages/ase/calculators/lammpsrun.py", line 167, in calculate
self.run()
File "/home/daryoush/.local/lib/python2.7/site-packages/ase/calculators/lammpsrun.py", line 270, in run
''.format(cwd,exitcode))
RuntimeError: LAMMPS exited in /tmp/LAMMPS-y73Ufn with exit code: /tmp/LAMMPS-y73Ufn.

 The mentioned tmp directory is empty, so that probably explains the error, but why is it empty?

--------

Some software version info:

Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2 (Debian)
ASE '3.11.0'
LAMMPS (25 Sep 2015)

We can run ASE with other classical potentials and standalone LAMMPS with no problems.

Could someone please try if the example scripts really run, or provide an example that does?

Many thanks,
Toma

________________________________
Dr. Toma Susi
Principal investigator
FWF Project HeQuCoG
University of Vienna, Austria
http://mostlyphysics.net<http://mostlyphysics.net/>

<lammpsrun.py>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20160805/0c4812ea/attachment.html>


More information about the ase-users mailing list