[ase-users] Problems with LAMMPSlib interface for >8 CPUs
Ask Hjorth Larsen
asklarsen at gmail.com
Sat May 11 16:34:37 CEST 2019
Hi,
Am Sa., 11. Mai 2019 um 16:31 Uhr schrieb Andrew Logsdail
<LogsdailA at cardiff.ac.uk>:
>
> Thanks Ask. Looking at the test harness and the LAMMPSlib script, the communicator seems to be the only difference - LAMMPS works with mpi4py or pypar, with the former in my test harness but not the LAMMPSlib module.
>
> I’ll verify this isn’t the issue with some testing, as you suggest, at which point I will revert to the LAMMPS mailing list perhaps to see if there is something opaque about the LAMMPS library I am missing.
If you log all the calls that ASE makes to lammps, and their
arguments, you should be able to boil it down to something that isn't
"ASE/lammpslib" any longer but rather a generic invocation of lammps.
By then, the Lammps people can perhaps help (or maybe there'll be an
obvious problem already then).
Also it sounds great that Noam Bernstein would like to have a look as
well. Noam, can you reply-to-list though please? :)
Best regards
Ask
>
> Thanks again for your help so far.
>
> Andy
>
> On 11 May 2019, at 15:24, Ask Hjorth Larsen <asklarsen at gmail.com> wrote:
>
> Hi,
>
> Am Sa., 11. Mai 2019 um 15:47 Uhr schrieb Andrew Logsdail
> <LogsdailA at cardiff.ac.uk>:
>
>
> Dear Ask
>
> On 11 May 2019, at 11:49, Ask Hjorth Larsen <asklarsen at gmail.com> wrote:
>
> Dear Andrew,
>
> Am Fr., 10. Mai 2019 um 09:51 Uhr schrieb Andrew Logsdail via
> ase-users <ase-users at listserv.fysik.dtu.dk>:
>
>
> Dear ASE-users,
>
> I have been having problems with the LAMMPSlib interface and wonder if anyone has experience/knowledge of this interface and its implementation? (Or can scrutinise my use and spot some obvious mistake I’m making!)
>
> My problem is that, with the EAM example input provided for NiH, I cannot get the LAMMPSlib calculation to run on >8 CPUs without receiving a “Lost Atoms” error from LAMMPS (it works fine for =< 8 CPUs). I can get the calculation to run successfully for >8 CPUs with LAMMPSrun, i.e. writing input files and performing a system call. I can also take the input files generated from this LAMMPSrun approach and use a basic Python test harness to run the LAMMPS executable, again on >8 CPUs. So the problem seems to be isolated to LAMMPSlib in ASE, rather than the LAMMPS python library itself.
>
> Any input would be welcomed, and/or if anyone can attempt a testrun with LAMMPSlib on my behalf that would also be welcomed! It has been challenging to work this out (and also get compatible LAMMPSlib/LAMMPSrun commands setup) and I’ve updated the ASE documentation to help with this in the future.
>
> Files from my testing are attached, with EAM potential file downloadable from here: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dropbox.com%2Fs%2F9hqs00cwkjs8yy8%2FNiAlH_jea.eam.alloy%3Fdl%3D0&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=j%2BoDAa%2BZUE1X%2FZWRjPjXLKfMCTnUvkd8o23%2BuT%2Fg8DU%3D&reserved=0 (too big for mailing list; it’d be good to have this on the examples page for LAMMPS maybe?).
>
>
> I use the lammps package provided by Debian, but it does not come with
> lammpslib so I have never tested it. How exactly does the
> installation work?
>
>
> Good question, and not one I can easily answer; What exactly do you mean by “how does it work”? I’ve been primarily led by the ASE guide notes and my own sys admin so far (who provided the work test harness) - I have contacted the LAMMPS mailing list, but as the calculation works with the test harness this was deemed probably an ASE LAMMPSlib issue, rather than that of the LAMMPS Python library.
>
>
> I use the Lammps package distributed with Debian and it does not have
> lammpslib. Installing and all that is probably much more complicated
> than what I have time for, but it would be nice to understand and
> solve this problem nevertheless. I also remembering attempting to use
> lammpslib once and failing because of not knowing how to use it in
> parallel, then sticking with lammpsrun.
>
> Hence just some dumb questions:
>
> I think lammps provides parallelism through MPI, right? How does the
> lammps module (within lammps) deal with MPI? Does it use mpi4py? Are
> you certain that ASE picks up the mpi4py communicator correctly, and
> passes it correctly to lammpslib? From the fact that it works with 8
> cores I would assume that this is not the problem, but it would be a
> good idea to verify.
>
> askhl at hagen:~$ mpirun -np 1 python3 -c "from ase.parallel import
> world; print(world)"
> <ase.parallel.DummyMPI object at 0x7f2492aa2f60>
> askhl at hagen:~$ mpirun -np 1 python3 -c "import mpi4py; from
> ase.parallel import world; print(world)"
> <ase.parallel.MPI4PY object at 0x7fe81cc554e0>
>
> Note the difference in import order: world is either a dummy
> communicator or the MPI4PY world communicator.
>
> You need to make sure that the MPI4PY object is passed correctly. I
> also have no idea how Lammps expects the distribution of the atoms,
> since they are presumably not all expected to exist on all ranks
> (domain decomposition). From reading the code, the ASE lammpslib
> module does appear to provide any particular distribution (I don't see
> it working much with communicators and ranks at all). There could be
> any amount of complexity hidden within this if lammps wants to have
> the coordinates in a particular parallel distribution.
>
> Best regards
> Ask
>
>
>
> All the best,
>
> Andy
>
>
>
> Best regards
> Ask
>
>
> I look forward to your feedback.
>
> Andy
>
>
> —
>
> Dr. Andrew Logsdail
>
> School of Chemistry,
> Cardiff University,
> Main Building,
> Park Pl,
> Cardiff CF10 3AT
>
> T: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flogsdail.github.io&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=iTVipq2ewytlJSZ3VGnxcLQfUOy7bBbs2jf7H54AxUI%3D&reserved=0
> @: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fa_logsdail&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=8B7oDAIU7AqCQAqimDuhOujOvYMgA%2BpM%2FbZINO5FfZA%3D&reserved=0
>
> Yr Ysgol Cemeg,
> Prifysgol Caerdydd,
> Y Prif Adeilad,
> Plas-y-Parc,
> Caerdydd,
> CF10 3AT
>
> F: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flogsdail.github.io&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=iTVipq2ewytlJSZ3VGnxcLQfUOy7bBbs2jf7H54AxUI%3D&reserved=0
> @: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fa_logsdail&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=8B7oDAIU7AqCQAqimDuhOujOvYMgA%2BpM%2FbZINO5FfZA%3D&reserved=0
>
> The University welcomes correspondence in Welsh or English.
> Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.
>
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.fysik.dtu.dk%2Fmailman%2Flistinfo%2Fase-users&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=nlubQ%2BApZcTmU8R1Kxcss3hUMlHxisZW4iUdI4PZ2F8%3D&reserved=0
>
>
>
> —
>
> Dr. Andrew Logsdail
>
> School of Chemistry,
> Cardiff University,
> Main Building,
> Park Pl,
> Cardiff CF10 3AT
>
> T: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flogsdail.github.io&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=iTVipq2ewytlJSZ3VGnxcLQfUOy7bBbs2jf7H54AxUI%3D&reserved=0
> @: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fa_logsdail&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=8B7oDAIU7AqCQAqimDuhOujOvYMgA%2BpM%2FbZINO5FfZA%3D&reserved=0
>
> Yr Ysgol Cemeg,
> Prifysgol Caerdydd,
> Y Prif Adeilad,
> Plas-y-Parc,
> Caerdydd,
> CF10 3AT
>
> F: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flogsdail.github.io&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=iTVipq2ewytlJSZ3VGnxcLQfUOy7bBbs2jf7H54AxUI%3D&reserved=0
> @: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fa_logsdail&data=01%7C01%7CLogsdailA%40cardiff.ac.uk%7Cbfec84d1bacb4249f22008d6d61c5ce8%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=8B7oDAIU7AqCQAqimDuhOujOvYMgA%2BpM%2FbZINO5FfZA%3D&reserved=0
>
> The University welcomes correspondence in Welsh or English.
> Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.
>
>
>
> —
>
> Dr. Andrew Logsdail
>
> School of Chemistry,
> Cardiff University,
> Main Building,
> Park Pl,
> Cardiff CF10 3AT
>
> T: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: http://logsdail.github.io
> @: http://www.twitter.com/a_logsdail
>
> Yr Ysgol Cemeg,
> Prifysgol Caerdydd,
> Y Prif Adeilad,
> Plas-y-Parc,
> Caerdydd,
> CF10 3AT
>
> F: +44 2922 510 162
> E: LogsdailA at cardiff.ac.uk
> W: http://logsdail.github.io
> @: http://www.twitter.com/a_logsdail
>
> The University welcomes correspondence in Welsh or English.
> Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.
>
>
>
More information about the ase-users
mailing list