[lammps-users] MPI atom efield bug?

Dear LAMMPS users,

I found strange behavior of the LAMMPS:
script below works on 1 proc and 2 proc with MPI but holds up on 4proc and 8proc with MPI on “run”.
The root of the problem is in fix efield, when it is commented, everything is OK.
Does anybody knows the reason?

LAMMPS from 8 feb 2011
INTEL MPI FORTRAN COMPILER
SCIENTIFIC LINUX 4.8 CERN

units lj
atom_style charge
dimension 2
boundary m p p
lattice sq 0.017627 origin 0.0 0.0 0.0

region 1 block -20 20 -20 20 -0.1 0.1 units box # film
region 3 block -500 500 -20 20 -0.1 0.1 units box #all space for calculation

create_box 1 3
create_atoms 1 region 1

mass 1 100

pair_style coul/debye 0.01 10
pair_coeff * *

variable EFx atom 1.0
^M
fix 2 all efield v_EFx 0.0 0.0
fix 1 all nve
thermo_style custom elapsed step dt cpu
thermo 10
dump 4 all custom 10 dump_HHGA.dat id type x y z mass q

fix for2D all enforce2d

run 10

print “I have passed this!”

Dear LAMMPS users,

I found strange behavior of the LAMMPS:
script below works on 1 proc and 2 proc with MPI but holds up on 4proc and
8proc with MPI on "run".
The root of the problem is in fix efield, when it is commented, everything
is OK.
Does anybody knows the reason?

some of your processors have no atoms.
fix efield uses an indirect check, if your
atom style includes charge information.
this fix fails, if you have no local atoms.

axel.

phil,

here is the bugfix for your problem:
http://git.icms.temple.edu/git/?p=lammps-icms.git;a=commitdiff;h=9377f8223751f16e49784d1800f6c730b13de85f

you can just download the corrected fix_efield.cpp file from here:

http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blob_plain;f=src/fix_efield.cpp;h=78fa0fe47bfb3c9f03deb1aa848a4ce060f5c9ed;hb=9377f8223751f16e49784d1800f6c730b13de85f

and then recompile.

let me also commend you for providing a perfect example of
how to report a problem. your input example had only the
necessary content to reproduce the problem and it was extremely
easy to track down where it was coming from. this is very
much appreciated.

thanks,
    axel.

phil,

my apologies. the bug fix introduces a new bug. i also found that
the same problem applies to fix addforce and fix setforce.

the attached patch should be the correct bugfix for all of them.
you can download the corrected complete files from here:
http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blob_plain;f=src/fix_efield.cpp;hb=3c16fb097f91a4c0e5d629a816df448ab9a71df5
http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blob_plain;f=src/fix_addforce.cpp;hb=3c16fb097f91a4c0e5d629a816df448ab9a71df5
http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blob_plain;f=src/fix_setforce.cpp;hb=3c16fb097f91a4c0e5d629a816df448ab9a71df5

cheers,
   axel.

fix_atom_variable_force.diff (3.25 KB)

Ok, this seems reasonable. But how to overcome this?

Ok, this seems reasonable. But how to overcome this?

how about you real all of my responses?
particularly the last one.

axel.

[...]

Sorry, i did not see it (unstable internet connection)

Sorry, i did not see it (unstable internet connection)

i cannot help with that.

in those cases, you should always double check with the mailing list archives

at: http://lammps.sandia.gov/threads/threads.html
or: http://sourceforge.net/mailarchive/forum.php?forum_name=lammps-users

axel.

I'll post a patch for this - thanks

Steve