Illegal pair style

Did formatting of pair_style linear change? I am getting the Illegal pair style command when I use:

pair_style table linear 1000 pppm

I have used this before and it has worked fine.

Ben

Did formatting of pair_style linear change? I am getting the Illegal pair
style command when I use:

pair_style table linear 1000 pppm

I have used this before and it has worked fine.

probably some non-printable character somewhere. or an O instead of a
0 or something.

axel.

Any other suggestions? I have checked that many times. Plus, even when I take the file directly from the Paul Crozier’s files, I still get the same error, and I am not changing anything. It is working fine on my linux machines, but not on windows.

Ben

The files I am referring to are the tabulated potential from Paul Crozier’s repulsive core for SiO2.

Ben

Now that is a very different story.

Please provide test inputs that are confirmed to work and fail, so that this can be checked independently.

There may still be text encoding issues that you are simply not aware of.

Axel

The error is from the input not the table files.

Right. I understand that it is not the table file. The log file stops right after it gets to the pair_style:

If I run the script below, it works for linux, not for windows. The log file is:

LAMMPS (12 Apr 2013)
units real
atom_style full
pair_style table linear 1000 pppm
ERROR: Illegal pair_style command (…/pair_table.cpp:199)

The script is:

units real
atom_style full
pair_style table linear 1000 pppm
kspace_style pppm 0.0001
kspace_modify gewald 0.29
read_data SiO2.data
pair_coeff 1 1 silica.tabulated BKS_1_1
pair_coeff 1 2 silica.tabulated BKS_1_2
pair_coeff 2 2 silica.tabulated BKS_2_2

velocity all create 300.0 25484595 dist gaussian

fix 1 all nvt temp 300 300 0.1
run 100000

Right. I understand that it is not the table file. The log file stops right
after it gets to the pair_style:

If I run the script below, it works for linux, not for windows. The log file
is:

well, it works on windows for me. please see the attached snapshot.

you should make certain that the input file is proper. as i mentioned
before, this could be caused by having non-ascii characters in your
input, e.g. through cut-n-paste.

axel.

windows-table-screenshot.png

Right. I understand that it is not the table file. The log file stops right
after it gets to the pair_style:

If I run the script below, it works for linux, not for windows. The log file
is:

LAMMPS (12 Apr 2013)

mind you, this is an old version. is your linux version the same
version? have you checked http://lammps.sandia.gov/bug.html if you are
not using a feature that was introduced *after* the 12 April 2013
patch?

axel.

Ok, I will try and troubleshoot. I am now having a new issue. When I run the below code with read_data, everything works fine; but when I run it with read_restart (restarting after equilibration), it tells me the kspace_style is incompatible with pair_style. How can it be compatible in the original data file, but not in the restart file generated by the same data file?

Ben

units real
atom_style full
pair_style table linear 1000 pppm
kspace_style pppm 0.0001
kspace_modify gewald 0.29
read_restart data.restart
pair_coeff 1 1 silica.tabulated BKS_1_1
pair_coeff 1 2 silica.tabulated BKS_1_2
pair_coeff 2 2 silica.tabulated BKS_2_2

Ok, I will try and troubleshoot. I am now having a new issue. When I run the

please *always* post a new issue with a new subject.

below code with read_data, everything works fine; but when I run it with
read_restart (restarting after equilibration), it tells me the kspace_style
is incompatible with pair_style. How can it be compatible in the original
data file, but not in the restart file generated by the same data file?

this has nothing to do with the data file, but how restarts work. any
style settings before reading the restart will become invalid and will
be replaced with a newly created style from the restart file. in your
specific case, the table style wasn't storing all necessary settings
for the various kspace related flags. the patch below fixes it.

diff --git a/src/pair_table.cpp b/src/pair_table.cpp
index f9ec6a3..d6ea173 100644
--- a/src/pair_table.cpp
+++ b/src/pair_table.cpp
@@ -882,6 +882,11 @@ void PairTable::write_restart_settings(FILE *fp)
{
   fwrite(&tabstyle,sizeof(int),1,fp);
   fwrite(&tablength,sizeof(int),1,fp);
+ fwrite(&ewaldflag,sizeof(int),1,fp);
+ fwrite(&pppmflag,sizeof(int),1,fp);
+ fwrite(&msmflag,sizeof(int),1,fp);
+ fwrite(&dispersionflag,sizeof(int),1,fp);
+ fwrite(&tip4pflag,sizeof(int),1,fp);
}

/* ----------------------------------------------------------------------
@@ -893,9 +898,19 @@ void PairTable::read_restart_settings(FILE *fp)
   if (comm->me == 0) {
     fread(&tabstyle,sizeof(int),1,fp);
     fread(&tablength,sizeof(int),1,fp);
+ fread(&ewaldflag,sizeof(int),1,fp);
+ fread(&pppmflag,sizeof(int),1,fp);
+ fread(&msmflag,sizeof(int),1,fp);
+ fread(&dispersionflag,sizeof(int),1,fp);
+ fread(&tip4pflag,sizeof(int),1,fp);
   }
   MPI_Bcast(&tabstyle,1,MPI_INT,0,world);
   MPI_Bcast(&tablength,1,MPI_INT,0,world);
+ MPI_Bcast(&ewaldflag,1,MPI_INT,0,world);
+ MPI_Bcast(&pppmflag,1,MPI_INT,0,world);
+ MPI_Bcast(&msmflag,1,MPI_INT,0,world);
+ MPI_Bcast(&dispersionflag,1,MPI_INT,0,world);
+ MPI_Bcast(&tip4pflag,1,MPI_INT,0,world);
}

/* ---------------------------------------------------------------------- */

Axel, how do I apply this patch?

Axel, how do I apply this patch?

with the patch program.

Axel, how do I apply this patch?

with the patch program.

or you can now download the modified file from the LAMMPS-ICMS repository:

http://git.icms.temple.edu/git/?p=lammps-icms.git;a=commit;h=5cc97a99b74a6611d78ae2e7467852f2116213ff

nice catch Axel - those settings were added later

I added them to the main LAMMPS version, it
will be part of a patch today.

Steve

Axel, I copied the .cpp and pasted it over the old data file in the LAMMPS sourcecode, and am still getting the same error. Should redownloading LAMMPS fix the problem?

Ben

Axel, I copied the .cpp and pasted it over the old data file in the LAMMPS

i have no idea what this is supposed to mean. either your fixed the
source code correctly or you don't. you can find the correct version
in both the LAMMPS and LAMMPS-ICMS source code repositories.

sourcecode, and am still getting the same error.

reading a newly created or an old restart file?

mind you, the old restart files simply don't have the information
about kspace settings and thus you cannot work.

Should redownloading LAMMPS
fix the problem?

well, you really only need the one corrected file and compile a new
executable with that. since we have the public svn and git
repositories, a lot of people don't download full tarballs or patches
anymore but update their lammps code through updating the SCM
checkouts. if you plan to do that regularly, it is quite convenient
and efficient.

axel.

Axel, I completely redownloaded LAMMPS along with an executable, tried loading a restart file that used this pair style and I am getting the same error. From what I read, the patches are applied instantly, so should not my new tarball and executable reflect this?

Ben

Axel, I completely redownloaded LAMMPS along with an executable, tried
loading a restart file that used this pair style and I am getting the same
error. From what I read, the patches are applied instantly, so should not my
new tarball and executable reflect this?

at this point, it is extremely difficult to not use any offensive words.

the main job of a scientist is to analyze and interpret facts and
provide proof for hypotheses, however your statements are pure
speculation and devoid of any facts that somebody could check.

a) it is easy to see if a patch is applied by simply *comparing* the
old version to the new.
b) you don't say which executable you downloaded from where, so this
is useless. even more so, just running the executable will print the
version of LAMMPS, so you have to explicitly ignorant to not see which
version of LAMMPS you are using
c) it is not quite clear (again) from your formulation whether this
restart was written with the old or the new executable, but i already
stated, that - due to the nature of the missing code - old restart
files do not contain the necessary information and thus cannot work,
despite the patch. this is a fundamental thing. you cannot read what
is not there.

i *really* would appreciate, if you would apply a bit more rational
thinking and common sense to your inquiries and make a bit of an
effort to understand what you are trying to do instead of playing
trial and error with the mailing list. this is frustrating for both
sides and wastes everybody's time.

thanks,
     axel.

I am using Linux - the executable is simply the Lammps-daily executable that the doc page suggests for Linux-Ubuntu users. The LAMMPS version is 12 Aug 2013, but I have applied the patch, and then ran the simulation (meaning that this is not an old restart file).

I regret wasting your time.

Ben