pair_comb3.cpp question

Hello LAMMPS community,

I have several questions regarding the development of pair_comb3.cpp. It has 4 communicating functions, namely pack_forward_comm(), unpack_forward_comm(), pack_reverse_comm(), unpack_reverse_comm()

why would in the pack_reverse_comm() and pack_forward_comm(), it is ‘return m;’ but not ‘return 1;’ as in many other pair functions, e.g. pair_eam or pair_eim.cpp?

Thank you for your time and effort.

Sincerely,

Anh Tran

PhD student

Georgia Institute of Technology

Hello LAMMPS community,

I have several questions regarding the development of pair_comb3.cpp. It has 4 communicating functions, namely pack_forward_comm(), unpack_forward_comm(), pack_reverse_comm(), unpack_reverse_comm()

why would in the pack_reverse_comm() and pack_forward_comm(), it is ‘return m;’ but not ‘return 1;’ as in many other pair functions, e.g. pair_eam or pair_eim.cpp?

I don’t follow. I see all of the pack comm functions return m. As they should.

Axel

Hello LAMMPS community,

I have several questions regarding the development of pair_comb3.cpp. It
has 4 communicating functions, namely pack_forward_comm(),
unpack_forward_comm(), pack_reverse_comm(), unpack_reverse_comm()

why would in the pack_reverse_comm() and pack_forward_comm(), it is
'return m;' but not 'return 1;' as in many other pair functions, e.g.
pair_eam or pair_eim.cpp?

I don't follow. I see all of the pack comm functions return m. As they
should.

perhaps you should specifically quote which version of LAMMPS this is
in reference to and list the line numbers.

e.g. here is pack_forward_comm() for PairEAM in the current
development version via git.
http://git.lammps.org/git/?p=lammps-ro.git;a=blob;f=src/MANYBODY/pair_eam.cpp;hb=HEAD#l818

axel.

Dr. Kohlmeyer,

Thank you for pointing it out… if you don’t mind, please have a look at 28Jun14 version. I know it’s been a while and a lot of patches have been introduced to fix bugs here and there. For example, line 818 and line 841 in pair_eam.cpp.

Also, would you please explain to me why it has been changed it this way?

here is the results of the differences, I couldn’t see much were changed.
diff 7Dec15/src/pair_eam.cpp 28Jun14/src/pair_eam.cpp
18,21c18,21
< #include <math.h>
< #include <stdio.h>
< #include <stdlib.h>
< #include <string.h>

Those functions are just returning how many values they packed.

It could be 1 or some other number (e.g. m).

Steve

Dr. Plimpton,

Thank you for the elaboration. I have one follow-up question and this may be the last for you:

what functions in what files that comm->reverse_comm_pair(this) and comm->forward_comm_pair(this) call? There are some relevant information in http://sourceforge.net/p/lammps/mailman/message/29656166/ as well but I couldn’t find the exact names of the files.

Thanks again for your kind help,

Anh

Dr. Plimpton,

Thank you for the elaboration. I have one follow-up question and this may be
the last for you:

what functions in what files that comm->reverse_comm_pair(this) and
comm->forward_comm_pair(this) call? There are some relevant information in
http://sourceforge.net/p/lammps/mailman/message/29656166/ as well but I
couldn't find the exact names of the files.

that is outdated information.

grep is your friend! try something like this:

[[email protected] src]$ grep forward_comm_pair *.h
comm_brick.h: virtual void forward_comm_pair(class Pair *); //
forward comm from a Pair
comm.h: virtual void forward_comm_pair(class Pair *) = 0;
comm_tiled.h: void forward_comm_pair(class Pair *); // forward
comm from a Pair

and you can see that there is an abstract interface for those calls in
comm.h and implementations for two different communication styles in
comm_brick.cpp and comm_brick.h and comm_tiled.cpp and comm_tiled.h

you really should not need to worry about how these are implemented,
but just about what they are supposed to achieve. i.e. read up on what
LAMMPS understands when there is mention of forward communication and
reverse communication. this has also been discussed in the mailing
list quite a few times, so another look into the archives might be
beneficial.

axel.

axel.