LAMMPS not reading data file.

hello lammps users,

Plz help me out. My file is not being read by lammps. It doesnt give any error also. I tried it at different pcs. I have attached input script, data file and logfile. plz help.

Thanks.

Rajesh

data.bn.txt (20.8 KB)

in.bn.text (3.17 KB)

log.lammps (268 Bytes)

Better than that, I’ll show you one way to do it yourself.

Try loading your data file in another program, such as topotools
or moltemplate, and see what it says.

I have found topotools error messages can be useful to help me
get a general idea where the problem is. Try this first.

Moltemplate comes with a utility named “ltemplify.py” which can read LAMMPS data files and convert them into moltemplate (LT) files. Then you can use moltemplate.sh to check for errors in the LT files (which closely resemble the original data file). This can give you detailed error messages that pinpoint problems in your (LT) files, from which you can try to infer where the problem was in your data file. You will also need an input script for your system containing the atom_style and force-field coeffs (both input scripts and data files are checked.) The process is described here:

http://lammps.sandia.gov/threads/msg37461.html
http://lammps.sandia.gov/threads/msg43982.html

(Be sure to download the most recent version of moltemplate tools
from moltemplate.org before you try this.)

Andrew

Most of the text of this messages was stolen from here:
http://lammps.sandia.gov/threads/msg42424.html

Hey,

Please reformat the data file. Find the modified data.bn.txt in the attached file.

Regards
Afshin

data.bn.txt (20.8 KB)

Thank you Andrew.

I created this data file from VMD using a command “topo writelammpsdata nanotube.data full” as suggested on page http://moltemplate.org/examples/nanotube+water/chiral_nanotubes.html. I followed the style as mentioned in lammps read_data command. Still it is giving problem. Dont know? And why lammps not giving any error?

thanks u Afshin,

But it is still not working. Plz let me know how to reformat it?

Rajesh please use the reformatted data.bn.txt (attached in my previous email), and use the correct name for your input data in in.bn.text.

read_data data.bn ----> should change to: read_data data.bn.txt

the rest is OK.

Regards
Afshin

thank you Afshin. It working now. I am really grateful to u for this.

thank you Afshin. It working now. I am really grateful to u for this.

​let us step back now, and quickly review what *you* could have done
yourself to avoid a lot of unnecessary hassle​ to the people on this list:

- the nanotube plugin in VMD has options to enable/disable
bonds/angles/dihedrals, so it would have been trivial to just generate a
new data file from scratch.
  lesson: read the documentation more carefully

- the topotools plugin in VMD allows to write out data files for different
atom styles. the choice "full" is the default, because that is the most
commonly used one for people who generate data files in VMD. you could have
specified writing the data file in style atomic and then the data file
would have been correct, even if you had had bonds in the topology in VMD.
as a bonus, it would have worked immediately with your initial input.
lesson: you really need to put more care into studying the documentation.

- it has been demonstrated, that you have a rather old LAMMPS version
(note: the "10 commandments" for the mailing list strongly suggest to
always mention the exact version LAMMPS and the platform/os you are running
on when reporting problems). newer versions of LAMMPS have been checking of
input data and will print more often warnings or error messages in case it
can detect inconsistencies for mistakes. if you had upgraded your LAMMPS
version, you would not have had LAMMPS stop on you without any output. this
is doubly important for somebody that doesn't pay much attention to detail
and documentation.
lesson: keep a current LAMMPS version around to validate that input decks
work correctly

- actually, the discrepancy between the atom style requested in the LAMMPS
input file and the atom style used to generate the data file, could have
been detected, if you had used the latest VMD version with the latest
topotools plugin. in more recent topotools generated LAMMPS data file,
additional comment "hints" are embedded in the data file and the
correspondingly current LAMMPS version can detect a mismatch.
  lesson: it really helps to keep software current, in case there are
problems.

​if you look at this altogether, it is pretty sad that you couldn't solve
the issue yourself, as simply following common sense and general best
practices in computer simulation with scientific software should have
prevented a lot of frustration and chaos.

axel.​

Dear Axel,

Thank you for your valuable suggestions. The problem was in input script where I did not add .txt to the datafile. Even after upgrading to the latest version of lammps no error was reported due this .txt. The only problem I was facing I think was due to this.

Thank you.

Rajesh

Dear Axel,

Thank you for your valuable suggestions. The problem was in input script
where I did not add .txt to the datafile. Even after upgrading to the
latest version of lammps no error was reported due this .txt. The only
problem I was facing I think was due to this.

​no.

if you run a current version of LAMMPS trying to read a non-existing ​file
you *do* get an error message like this:

LAMMPS (26 Oct 2015)
Reading data file ...
ERROR on proc 0: Cannot open file data.step2e (../read_data.cpp:1770)

please see the attached log file attached with very first mail. It is clearly showing the lammps version of 26 Oct, 2015 but no error after read_data command.

please see the attached log file attached with very first mail. It is
clearly showing the lammps version of 26 Oct, 2015 but no error after
read_data command.

​not all messages printed to the screen are​ in the log, since files are
block buffered and most OS's don't flush those buffers to disk when an
executable is aborted.

what ever be the reason but I did not get any error message even in latest version.

​i have reviewed the corresponding source code, and it is practically
impossible to *not* have these messages printed. the semantics of the
function calls used to print out the error messages requires the OS to
flush and close the file. all pending buffers need to be committed by then.

thus there must be something in the way how your run or where you run or
what kind of file system and/or OS configuration you have the prevents
these (C standard library mandated) operations to happen.​

i for one cannot reproduce this behavior on any various (virtual) machines
that i have tried it.​

axel.

Thank you Axel to delve so deep in the problem. I dont know why his is not happening in my system. I tried it on two different PCs and both of them had no error message but just closing of the lammps window without any message.

Truly

Rajesh.

Thank you Axel to delve so deep in the problem. I dont know why his is not
happening in my system. I tried it on two different PCs and both of them
had no error message but just closing of the lammps window without any
message.

​this is making even less sense to me than anything you mentioned before.
if LAMMPS exits it cannot terminate shell program it list launched from.
also, LAMMPS is a console application, so it doesn't open a "LAMMPS window".

so tell us how *exactly* do you run/launch​ LAMMPS? what kind of OS/version
do you run on?
i am *very* confident that LAMMPS *is* printing the error messages i
mentioned, only that you don't get to see them due to how you are
using/running/launching LAMMPS.

axel.

My PC is running on Window 8.1. I copied lmp_serial from bin directory of lammps in a folder along with input script, datafile and potential file. Then just double click the lmp_serial and a command prompt like window open. In this windows I just paste my script and it starts running. In this case as I paste the script it runs well up read_data command. After that window closes itself without giving any error in logfile generated.

Thanks

Rajesh

My PC is running on Window 8.1. I copied lmp_serial from bin directory of
lammps in a folder along with input script, datafile and potential file.
Then just double click the lmp_serial and a command prompt like window open.
In this windows I just paste my script and it starts running. In this case
as I paste the script it runs well up read_data command. After that window
closes itself without giving any error in logfile generated.

ok. i already suspected that you are running windows. your process
sounds needlessly complicated and error prone.
the "normal" way is to open a command prompt in the directory of
choice. and then just run lammps:

lmp_serial -in in.run

..and in case of problems with the input it is highly recommended to
run it like this:

lmp_serial -echo both -in in.run

no need to copy the executable, as that is placed into the global
search path during installation, and this way you are not bypassing
the command shell and thus you will get the error output.

this is actually how the LAMMPS documentation and also the
documentation on the download area for windows installers describe it.

in other words, you don't get any error output, because of how you run LAMMPS.

axel.

Thank you Axel. Tried to run lammps using commands provided by you but it did not work

In this windows I just paste my script and it starts running. In this case as I paste the script it runs well up read_data >command. After that window closes itself without giving any error in logfile generated.

Is is possible the error message is printed to the screen, but

the window closes immediately, so you don’t see it?

Steve