Segmentation Fault when using the last version of fix gcmc

Hello,

I encountered a "segmentation fault" error when using the fix gcmc (lammps version of 22 Feb 2013). At the end of this email, I provide a simplified input file for which I obtain this error and the corresponding output. The error seems due to the gcmc fix: it disappears if I remove the gcmc fix. At first sight, "segmentation fault" sounds due to a compilation problem but I asked a colleague to compile the same version and run the same input file on is own computer and he got the same problem. In addition if I compile an older version before the last update of the package mc (version of 11 Aug 2012) I don't get any error with this input file and lammps runs perfectly. Therefore, it looks like a bug in the last update of gcmc. What do you think?

Best,

Laurent Brochard

/////////////////// Begin Input File /////////////////////////
#Initialization
units real
dimension 3
boundary p p p
atom_style full

#Atom definition
read_data SegFault_in.xyz # File attached to the email

#Settings
pair_style lj/cut 10.0
pair_coeff 2 2 0.238 3.41
pair_coeff 1 2 0.115 3.38
pair_coeff 1 1 1.0 1.423

fix md all nvt temp 300.0 300.0 10
group LJ type 2
fix mc LJ gcmc 10 100 0 2 23897 300.0 -9.0 2.0

thermo 1000
thermo_style custom step temp pe press

#Run
timestep 0.1
run 10000
/////////////////// End Input File /////////////////////////

/////////////////// Begin Output File /////////////////////////
LAMMPS (22 Feb 2013)
Scanning data file ...
Reading data file ...
  orthogonal box = (-21.345 -24.6471 -20) to (21.345 24.6471 20)
  1 by 1 by 1 MPI processor grid
  801 atoms
Finding 1-2 1-3 1-4 neighbors ...
  0 = max # of 1-2 neighbors
  0 = max # of 1-3 neighbors
  0 = max # of 1-4 neighbors
  1 = max # of special neighbors
1 atoms in group LJ
Setting up run ...
Memory usage per processor = 2.78599 Mbytes
Step Temp PotEng Press
       0 0 -475.76646 7068.9273
Segmentation fault (core dumped)
/////////////////// End Output File /////////////////////////

SegFault_in.xyz (23 KB)

Paul can look at this.

Steve

Please try the attached version of fix gcmc, which should solve the issue you were seeing. The problem was that as of Jan 31, 2013 (r9346), comm->borders() no longer zeroes out the atom->nghost variable, so I had to add that in to fix gcmc prior to each comm->borders() call.

Paul

fix_gcmc.cpp (40.6 KB)

fix_gcmc.h (6.11 KB)

It works perfectly now.
Thanks
Laurent

Crozier, Paul S a écrit :