Andrew:
Thanks very much for your kind help. I will try your suggestions.
The two ways you mentioned of changing the angle types, they both need to be
done. One (anglelist[][]) is for angles in the neighbor list (temporal
list), and the other (atom->angle_type[][]) is for the permanent angle list
which will be written to the restart file.
If I understand right, GCMC involves insertions and deletions of molecules.
When a new molecule is inserted, will there be new bonds and angles added to
the permanent bond and angle list? If so, this actually resembles my
problem. And one issues is, how the new bond and angle can be added on each
processor if run parallely. My problem is, for an angle a1-a2-a3 (atom ids),
if a1 and a2 are on processor P1 while a3 is on processor P2, when bond
a1-a2 is broken the angle (a1-a2-a3) stored on P1 is set type 0 but the same
angle stored on P2 is not be changed.
After looking at your code, it occurs to me that you are not using any
MPI_ functions to communicate changes in the bonds to the other
processors. I would think that you should broadcast changes to the
bonds and angle-lists to the other processors using MPI_Bcast().
--- for example ---
For example, after you set an angle type to zero:
atom->angle_type[ai1][am] = 0;
perhaps you should invoke MPI_Bcast() on it to share it with the other
processors.
MPI_Bcast(&(atom->angle_type[ai1][am]),1,MPI_INT,0,world);
(I'm not sure if you need to broadcast any changes to "anglelist[][]"
to neighboring processors.)
Strangely (to me at least) I noticed that for some reason the current
version of BondQuartic::compute() in "bond_quartic.cpp" does not make
any MPI calls. Does the current version of "bond_style quartic" work
in parallel?
I'm not sure if this will help, but if you have not done this yet,
take a look at the source code for "fix bond/break" and "fix
bond/create". Those files are at:
src/MC/fix_bond_break.cpp
src/MC/fix_bond_create.cpp
(After a casual glance, I was not able to figure out what was going on.)
The problem with your original post was that it's hard to ask
people to go through your code and look for errors. Perhaps once you
have a more tangible and easy-to-answer questions about something you
are confused about, you will get more replies.
Alas, I suspect that more qualified people might not be replying to
your post because I did, which is a shame because I am not qualified
to talk about MPI.
Good luck!
Andrew