|From:||Quang Ha <quang.t.ha.20@...24...>|
|Date:||Thu, 19 Apr 2018 16:05:40 -0400|
As Axel indicates, there are trade-offs in how detailed to makeerror messages. I think the generic ones you are frustratedwtih are the ones like "Illegal velocity command".The challenge is that for a command with many, many options,there could be 50 variants of that error message, one for each
param or whether the param is too big or too small or not a number, etc.
Not only would it be tedious to add them all to the code, but as Axelmentioned they also need to be added to the *.h files sothe Section_errors portion of the manual can be auto-generated.Personally, when I get that message and can't quickly figureout by staring at the input scriipt line, what i messed up,then I simply look at the line of source code indicated in theerror message. That quickly tells me what portion of theinput parsing failed.SteveOn Wed, Apr 18, 2018 at 4:06 PM, Axel Kohlmeyer <akohlmey@...24...> wrote:On Wed, Apr 18, 2018 at 5:30 PM, Quang Ha <quang.t.ha.20@...24...> wrote:
> Since I have gotten better at using LAMMPS (or so I thought) I kinda want to
> improve the some error messages - rather than the current 'Illegal foo
> command' ones.
> I wonder if this would be a good help on the project - and if there has
> already been other plans on this?
please have a discussion with steve on this subject before you start
anything. he is the best person to tell you what is considered helpful
and what not.
there is a reason why many error messages are so generic: making them
more specific will significantly increase the maintenance effort, and
LAMMPS is already a project that - due to its size and growing
complexity - requires a substantial effort to keep everything
consistent and synchronized. another source of vague or missing error
messages is that they are part of contributed code (e.g. user
packages), so the maintenance effort and the burden to write
meaningful error messages, is on the people contributing the code.
often people contribute something to LAMMPS and then move on and then
maintenance duties fall back on the core developers or the package is
considered abandoned and will be removed, if the effort to keep it in
sync is larger than the benefit of having it included. final reason
for vague error messages is, that due to the highly modular structure
of LAMMPS, for some code constructs it is very difficult to report
specific errors, since it cannot be reported where it originates or
the behavior is that something is an error unless some optional piece
of code is installed, but the code flagging the error has no simple
way to know what is there.
the LAMMPS developers are regularly discussing how to improve the
situation, but most ideas require more workforce, than what is
...and a final comment: a long time ago, i read through a discussion
on the Linux kernel mailing list, where somebody was suggesting to
implement a more "user friendly" behavior.
the discussion ended with the remark: if you try to idiot-proof a
software, the universe will create better idiots.
in trying to apply this to LAMMPS, i think that a lot of the problems
would be reduced when not the error messages are improved, but rather
the documentation re-organized. that way users are more likely to
spend time studying it, or more easily find the relevant parts. so
that in the end, we get smarter users instead of smarter error
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> lammps-users mailing list
Dr. Axel Kohlmeyer akohlmey@...24... http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.