What are the most confusing error messages or warnings in LAMMPS?

Dear LAMMPS users and developers,

I just set up a small “community project” of the LAMMPS core developers on GitHub, where we will make an effort to provide additional explanations for frequently asked about error messages and make it so they can be looked up quickly. For example the error message

ERROR: Unknown identifier in data file

is followed by:

For more information see https://docs.lammps.org/err0001 

and that URL will take you to:

https://docs.lammps.org/Errors_details.html#err0001

where some more details about what causes this error are given. The idea is that if people understand why an error happens, it will be much easier for them to find the best way to avoid it. In many of these cases, there is not a single cause and not a single “do this, not that” kind of solution.

But to make this most useful for everybody, we need your input.
What are error messages that should have a paragraph with explanations in the same way?

Of course, if any of you wants to contribute an explanation for a suggested error (or warning) as well, this would be even more welcome. :wink:

You can find a draft pull request with a list of possible errors and warnings (culled from the forum here by looking a the list of most viewed topics) on GitHub: [Community project] Add short explanations and URL to them for common errors and warnings by akohlmey · Pull Request #4432 · lammps/lammps · GitHub
and you can add your suggestions either on GitHub or here.

8 Likes

Thanks :+1:

Probably not that common, but this error tripped me up:

ERROR: Illegal variable command: expected 3 arguments but found 5 (../variable.cpp:475

The issue was I had whitespace in the variable. I needed to remove the whitespace or put in single or double quotes. But spaces shouldn’t count for arguments, so the error message is very confusing.

Yes I agree. This error:

ERROR: Illegal variable command: expected 3 arguments but found 4 (src/variable.cpp:437)

comes up when using:

myvar equal xcm(group, x)

instead of

myvar equal xcm(group,x)

which is a very difficult error to spot.

1 Like

Actually, it is very logical when you know how LAMMPS parses inputs.

  1. it reads a line
  2. if a line ends in ‘&’ then the ‘&’ removed and the next line added. repeat until no ‘&’ at end
  3. search for ‘$’ unless inside of quotes and then do variable substitution based on the argument following the $, repeat until no more substitutions.
  4. split the string into “args” on whitespace
  5. pass the list of args to the input parser
  6. execute command and pass remaining args as argument

This is done for all of the input and way before the variable command is invoked.
When assembling the arguments, any (outer) quotes are removed, so that you can have arguments with blanks, yet they require quotes.

Now with this in mind, here is an idea to sidestep this issue, at least for selected types of variables, where this is most confusing. This works, because there are no optional arguments for those variable styles, e.g. equal style, atom style, or vector style. What we can do is have a loop where those excess arguments are joined with the 3rd argument to a single string.
This is implemented in this commit: Collected small changes and fixes by akohlmey · Pull Request #4434 · lammps/lammps · GitHub
With these changes, those variable commands will have no more than 3 arguments and no longer trigger those error messages.

2 Likes

What user actually knows this :joy:

Anybody, who remembers the documentation: 5.2. Parsing rules for input scripts — LAMMPS documentation :wink:

1 Like