ERROR: Invalid range string: -1 (src/CLASS2/improper_class2.cpp:516)

Hello dear all,

When I try to run a simulation in an HPC Cluster (not my local PC) I encounter the folowing error

LAMMPS (27 Jun 2024)
using 1 OpenMP thread(s) per MPI task
Reading data file …
orthogonal box = (-31.93235 -31.93235 -31.93235) to (31.93235 31.93235 31.93235)
2 by 4 by 5 MPI processor grid
reading atom labelmap …
reading bond labelmap …
reading angle labelmap …
reading dihedral labelmap …
reading improper labelmap …
ERROR: Invalid range string: -1 (src/CLASS2/improper_class2.cpp:516)
Last command: read_data 128_64_peg_n3_dab_low_density_labels.data extra/special/per/atom 20 extra/bond/per/atom 10 extra/angle/per/atom 20 extra/dihedral/per/atom 50 extra/improper/per/atom 20
srun: error: node074: tasks 0-19: Exited with exit code 1
srun: Terminating job step 1691362.0
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
srun: error: node075: tasks 20-39: Exited with exit code 1

I have searched online and I have not found anything similar. On my local PC I can run my simulation with no problems. I attach my files (both data and input)

128_64_peg_n3_dab_low_density_labels.data (1.7 MB)
in.initialisation (508 Bytes)
in.precrosslink (3.3 KB)

Thank you in advance

The data file does not match the input.

LAMMPS (4 Feb 2025)
  using 1 OpenMP thread(s) per MPI task
ERROR: Cannot open file 128_64_peg_n3_dab_low_density.data: No such file or directory (src/read_data.cpp:367)
Last input line: read_data 128_64_peg_n3_dab_low_density.data #filename

So does your local PC have a more recent or an older LAMMPS version?
Since the 27 Jun 2024 version on the cluster is neither the latest stable nor the latest feature release version, you should test whether this error is due to a bug that has since been fixed, or is a problem of your data file that hasn’t been flagged in older versions of LAMMPS, or whether this is a new bug that has been introduced.

Sorry, you are correct. I attach the correct one.

Maybe but the weird fact is that if I save the topology in .rst format, the cluster reads the file with no problem and the simulation is running properly.

in.precrosslink (3.3 KB)

This is not weird at all. Binary restart files do not need parsing. They are read directly. So there cannot be any issue with parsing text like the error message indicates. The only problem with binary restart files is that they are not designed to be backward or forward compatible. That means you can only read them, if there has been no change in any of the sections. If there is, read_restart will error out or worse.

This input reads the data file without an error with both the stable 29 Aug 2024 version and the 4 Feb 2025 version, which supports that there was a bug in the 27 Jun 2024 version which has been fixed since. If you want to minimize the probability of running across a bug, you should use the latest update for the latest LAMMPS stable version. Update 1 for version 29 Aug 2024 was released last fall (with rather minor bugfixes) and update 2 is almost ready (with mostly rather obscure bugfixes to rarely used code).

1 Like

Perfect Axel, thanks for the immediate response!

Best!

Hello again @akohlmey . I downloaded the latest version of LAMMPS (4 Feb 2025) and the error still exists on the cluster I am runngin. In my personal computer there is no error at all. I attach the .log files.

  1. The log file “4Feb_log.log” is the log file that tries to read the data file witht this version. (and the ERROR exists)
  2. The log file “data_file_production_log_4Feb.log” is the log file that created the “label.data” file with the same version in the same machine. I also attach it.

labels.data (3.6 MB)
4Feb_log.log (688 Bytes)
data_file_production_log_4Feb.log (1.9 KB)

Since I cannot reproduce the error either, the logical explanation would be that the compiler on your cluster is broken and miscompiles parts of LAMMPS. What is the output of ./lmp -h on the cluster?

At any rate, for as long as I cannot reproduce the error, there is nothing that I can do to resolve it.