what size_vector variable in Fix control?

Hello LAMMPS community and developers,

I have a question regarding LAMMPS source codes: in almost every Fix styles, there is a variable called size_vector, which (I think) controls the size (length) of the data sent. I’m looking for a MPI command that directly or indirectly relates this variable to to the code.

Also, would somebody please let me know how this variable is determined for an arbitrary Fix?

Thank you very much for your time and effort.

Sincerely,
Anh Tran
PhD student
Georgia Institute of Technology

Hello LAMMPS community and developers,

I have a question regarding LAMMPS source codes: in almost every Fix styles,
there is a variable called size_vector, which (I think) controls the size
(length) of the data sent. I'm looking for a MPI command that directly or
indirectly relates this variable to to the code.

your thinking is not correct. the answer about the purpose is easily
inferred from looking at fix.h

  int scalar_flag; // 0/1 if compute_scalar() function exists
  int vector_flag; // 0/1 if compute_vector() function exists
  int array_flag; // 0/1 if compute_array() function exists
  int size_vector; // length of global vector
  int size_array_rows; // rows in global array
  int size_array_cols; // columns in global array
  int size_vector_variable; // 1 if vec length is unknown in advance
  int size_array_rows_variable; // 1 if array rows is unknown in advance
  int global_freq; // frequency s/v data is available at

this whole section is about global data that a fix provides in a
fashion that it can be accessed from variables, other fixes, or for
thermo output with the f_fix-id syntax.
it has *nothing* to do with communication. what kind of communication
for what kind of data exactly are you looking for?

Also, would somebody please let me know how this variable is determined for
an arbitrary Fix?

it is determined by the amount of data that the fix provides. again,
the study of some simple examples should make it obvious.

axel.

Axel,

Thank you very much for pointing me to fix.h. I have a follow-up question for you: would you please explain how this variable size_vector is being used in the Fix? I don’t see it being used anywhere else except for thermo.cpp and variable.cpp. Also, can you please point me to at least several lines of any Fix that use this variable?

I’m particularly looking at this chunk of the code in fix_nh.cpp

Axel,

Thank you very much for pointing me to fix.h. I have a follow-up question
for you: would you please explain how this variable size_vector is being
used in the Fix? I don't see it being used anywhere else except for
thermo.cpp and variable.cpp. Also, can you please point me to at least

i just explained how and why this is the case in my previous response.

several lines of any Fix that use this variable?

why don't you use grep?

I'm particularly looking at this chunk of the code in fix_nh.cpp

[...]

what kind of communication for what kind of data exactly are you looking
for?

I'm actually looking for an answer for a question, rather than a
communication for data. Please allow me to explain: a typical decomposition
scheme for LAMMPS (as far as I know) is spatial decomposition; so my
question is after the force acting on 1 atom is computed, are the
acceleration and velocity of 1 atom computed by 1 processor or several
processors? My guess is 1, but probably it doesn't hurt to confirm. I was
thinking that the acceleration and velocity were computed by several
processors, but after seeing your email I know that I was wrong.

why do you look at the most complex time integration fix for that? why
not look at fix_nve.cpp? the part of fix_nh.cpp you were looking at is
related to the nose-hoover chains and not atoms. as the documentation
for fix nvt/npt/nph states, the state of the nose-hoover chains can be
accessed as a global vector of the fix.

and the confirmation you are seeking is easily had from the LAMMPS
paper and also from pretty much any workshop presentation that steve
did, where he explained how LAMMPS works and how the time integration
is done. it should also be described in the developer's guide
document.

axel.

Axel,
​​
Thanks again for your response. The reason is that I have to modify NPT ensemble, so I end up being with fix_nh instead of fix_nve, even though I should have picked the later one.

Here are the documentation in http://lammps.sandia.gov/doc/fix_nh.html

These fixes compute a global scalar and a global vector of quantities, which can be accessed by various output commands. The scalar value calculated by these fixes is “extensive”; the vector values are “intensive”.

I think I guess the idea: this is to assess the Fix states by any Compute classes, for example, to compute pressure/temperature/other interested quantities. Does it sound about right to you?

Thanks,
Anh

Axel,
Thanks again for your response. The reason is that I have to modify NPT
ensemble, so I end up being with fix_nh instead of fix_nve, even though I

what kind of modification?
nose-hoover thermostats and barostats are a not exactly
straightforward to do right and i get the impression that you are not
very familiar with either LAMMPS or nose-hoover chains.

should have picked the later one.

Here are the documentation in http://lammps.sandia.gov/doc/fix_nh.html

These fixes compute a global scalar and a global vector of quantities, which
can be accessed by various output commands. The scalar value calculated by
these fixes is “extensive”; the vector values are “intensive”.

I think I guess the idea: this is to assess the Fix states by any Compute
classes, for example, to compute pressure/temperature/other interested
quantities. Does it sound about right to you?

no. it would help you massively, if you would stop speculating and
rather read the available texts and pay closer attention to what
you've been told. you seem to making a lot of assumptions about LAMMPS
that have absolutely no foundation in the actual implementation. the
compute_XXX() methods in fixes allow to access information made
available by the fix. in case of the nose-hoover fixes, you can access
a scalar and a vector and the latter is the state of the nose-hoover
chains, the documentation gives a detailed list of it.
temperature/pressure are computed very differently in LAMMPS.