[lammps-users] variable tracking size limit exceeded

Dear all,

I find the following messages while compiling lammps recently.

lammps/src/lammps.cpp: In member function ‘void LAMMPS_NS::LAMMPS::init_pkg_lists()’:

lammps/src/lammps.cpp:908:13: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without

void _noopt LAMMPS::init_pkg_lists()

^

I tried with the most recent version for check and an old version with no extension files. However, the code compiles and builds the executable and I can run jobs with the executable. However, I was wondering whether I should be worried about the message. Can anyone tell me why the message appears and how to get rid of it?

Thank you.
Chandana

Dear all,

I find the following messages while compiling lammps recently.

lammps/src/lammps.cpp: In member function ‘void LAMMPS_NS::LAMMPS::init_pkg_lists()’:

lammps/src/lammps.cpp:908:13: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without

void _noopt LAMMPS::init_pkg_lists()

^

I tried with the most recent version for check and an old version with no extension files. However, the code compiles and builds the executable and I can run jobs with the executable. However, I was wondering whether I should be worried about the message. Can anyone tell me why the message appears and how to get rid of it?

the message appears because that init_pkg_lists() subroutine uses a lot of temporary variables and you have compiler optimization enabled.

to get rid of it, you would need to disable compiler optimization, but that would result in a significant slowdown of LAMMPS execution, unless there is a way to disable it for only this one subroutine. this way exists, but it works reliably only for compilers that are newer than yours or that don’t use by default options that have conflicts.

you omitted to mention the things that should always be mentioned when you have a question about LAMMPS:

  • what platform/OS are you running on?
  • which specific LAMMPS version do you use (“most recent” is very imprecise and can become invalid overnight)?
  • which compiler toolchain do you use?

so this is as much as is possible to say.

axel.

Dear Axel,

Thank you for your reply.

Do I lose any feature of lammps if I use the executable that is produced even after showing this message? Please let me know.

To answer your questions:

I am running on linux os.
The lammps version is 29Oct, 2020 obtained by doing: git clone -b stable https://github.com/lammps/lammps.git
About the compiler toolchain: I got the message both with make and cmake command. cmake version is 3.17.2, intelmpi/18.1.163
Do you want information about any other compiler?

Best regards,
Chandana

It would be very helpful to also see the output of ./lmp -h

Here is the output of ./lmp -h:

Large-scale Atomic/Molecular Massively Parallel Simulator - 29 Oct 2020

Git info (stable / stable_29Oct2020)

Usage example: ./lmp -var t 300 -echo screen -in in.alloy

List of command line options supported by this LAMMPS executable:

-echo none/screen/log/both : echoing of input script (-e)

-help : print this help message (-h)

-in filename : read input from file, not stdin (-i)

-kokkos on/off … : turn KOKKOS mode on or off (-k)

-log none/filename : where to send log output (-l)

-mpicolor color : which exe in a multi-exe mpirun cmd (-m)

-nocite : disable writing log.cite file (-nc)

-package style … : invoke package command (-pk)

-partition size1 size2 … : assign partition sizes (-p)

-plog basename : basename for partition logs (-pl)

-pscreen basename : basename for partition screens (-ps)

-restart2data rfile dfile … : convert restart to data file (-r2data)

-restart2dump rfile dgroup dstyle dfile …

: convert restart to dump file (-r2dump)

-reorder topology-specs : processor reordering (-r)

-screen none/filename : where to send screen output (-sc)

-suffix gpu/intel/opt/omp : style suffix to apply (-sf)

-var varname value : set index style variable (-v)

OS: Linux 3.10.0-1160.11.1.el7.x86_64 on x86_64

Compiler: GNU C++ 4.8.5 20150623 (Red Hat 4.8.5-44) with OpenMP 3.1

C++ standard: C++11

MPI v3.1: Intel(R) MPI Library 2018 Update 3 for Linux* OS

Active compile time flags:

-DLAMMPS_GZIP

-DLAMMPS_PNG

-DLAMMPS_JPEG

-DLAMMPS_SMALLBIG

sizeof(smallint): 32-bit

sizeof(imageint): 32-bit

sizeof(tagint): 32-bit

sizeof(bigint): 64-bit

Installed packages:

ASPHERE COLLOID DIPOLE GRANULAR KSPACE MANYBODY MC MOLECULE

Best regards,
Chandana

This confirms my suspicion. You are using RHEL or CentOS 7, which is bundled with a rather old compiler (GCC 4.8 from six years ago, current is GCC 11.1) and that compiler cannot safely use the feature that turns off the compiler optimization and variable tracking on a per-function basis (you need GCC 4.9 or later).

That said, there is no functionality lost with GCC 4.8. You just get the warning and compilation takes a bit longer.

Axel.

Dear Axel,

Thank you very much for explaining it. It is really helpful.

Best regards,
Chandana