where is wrong in my code

Dear LAMMPS administrator:

I am working on shear viscosity calculation on water at room temperature and pressure using the lammps-Aug2011 edition. I have the major part of my input script as following to output the velocity profile and off-diagonal components at each step:

variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz

fix 1 all nvt/sllod temp 298.15 298.15 100.0

fix 2 all deform 1 x trate 0.1 y volume z volume remap v

fix 3 all ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile units box

thermo 1

compute 1 all pressure thermo_temp

thermo_style custom step temp pe etotal press v_pxy v_pxz v_pyz vol

I got following error message when the run crashed:

123304 1.193532e+09 16427326 1.0685946e+10 1.6354104e+10 298874.44 42478.414 79479.391 29808.028
ERROR on proc 2: Failed to allocate 13972388976bytes for array ewald:vg

Could I know where is my problem? Thank you very much.

The same system could run well without problem using rNEMD method to calculate the viscosity.

Best,

Laura

dear laura,

2011/9/21 zhangliqun <[email protected]...>:

Dear LAMMPS administrator:

I am working on shear viscosity calculation on water at room temperature and
pressure using the lammps-Aug2011 edition. I have the major part of my input
script as following to output the velocity profile and off-diagonal
components at each step:

variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz

fix 1 all nvt/sllod temp 298.15 298.15 100.0

fix 2 all deform 1 x trate 0.1 y volume z volume remap v

fix 3 all ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file
vel.profile units box

thermo 1

compute 1 all pressure thermo_temp

thermo_style custom step temp pe etotal press v_pxy v_pxz v_pyz vol

I got following error message when the run crashed:

123304 1.193532e+09 16427326 1.0685946e+10 1.6354104e+10
298874.44 42478.414 79479.391 29808.028
ERROR on proc 2: Failed to allocate 13972388976bytes for array ewald:vg

Could I know where is my problem? Thank you very much.

which problem are you referring to?

the fact that your temperature has exceeded a billion kelvin
(i.e. about 100 times hotter than what is the estimated temperature
in the center of the sun), that your pressure is enormous, your volume
huge, or that your are running out of memory??

i think you should be positively surprised that your simulation
was able to run this far.

cheers,
     axel.

Dear Lammps administrator:

Thanks for pointing out the problem. In fact, I also found the abnormal behavior of the temperature. The initial temp was around 192 K, then during the simulations, it increased so fast that it reached a huge number when it crashed. I saw some posts complaining about that. But I do not know how to solve that. Could I get some help there? Thanks again.

Best,

Laura

dear laura,

2011/9/21 zhangliqun <[email protected]...>:

Dear Lammps administrator:

FYI, this is the lammps _users_ not administrators list.

Thanks for pointing out the problem. In fact, I also found the abnormal
behavior of the temperature. The initial temp was around 192 K, then during
the simulations, it increased so fast that it reached a huge number when it
crashed. I saw some posts complaining about that. But I do not know how to
solve that. Could I get some help there? Thanks again.

molecular dynamics simulations follow a simple principle
called "garbage in, garbage out". if your coordinates or
force field parameters or otherwise the physics of your
system is not correct, then you get useless data.

the second principle you have to keep in mind is:
"software is dumb", i.e. it doesn't know what you
_want_ to do, it only does what you _tell_ it to do.
that is, you have to think for the program and have
to make sure that everything you feed it is checked
and double checked and perfectly correct.

learning how to do that, is part of the basic training
when learning how to run MD, and something that
is very difficult to teach via e-mail.

axel.

Dear axel:

Thanks for explaining the general idea of LAMMPS. I think they are useful, although specific suggestions may be more useful for me right now. I just like to know two things:

1)for a well-equilibrated system, using nvt/sllod command should not cause dramatical temperature increase, right? I just want to remove the source code reason for my results.

2)since my system is well equilibrated based on my check, the other factors could lead to such kind of temperature increase could come from the shear parameters. Probably the shear force is too large for water. Is there any other way to control the thermal change? for example in my input script that can help to control the temperature?

Thank you very much again.

Laura

2011/9/21 zhangliqun <[email protected]...>:

Dear axel:

Thanks for explaining the general idea of LAMMPS. I think they are useful,
although specific suggestions may be more useful for me right now. I just
like to know two things:

1)for a well-equilibrated system, using nvt/sllod command should not cause
dramatical temperature increase, right? I just want to remove the source
code reason for my results.

you are asking the wrong way. nobody can just tell you
that what you are doing is correct without having a
tangible example, and quoting a few (random) lines from
your input just doesn't cut it.

there is an nemd example shipped with lammps. try and
test it and see if it works correctly for you. if not come back
and tell people here about it. if it does, try to transfer those
settings to a (simple!!) 3d system and try again and check.
only after that all was successful, i would start with the real
problem. in any case, if you don't present a complete yet
simple and readable input, chances are near zero, that
somebody will even look at it seriously.

2)since my system is well equilibrated based on my check, the other factors
could lead to such kind of temperature increase could come from the shear
parameters. Probably the shear force is too large for water. Is there any
other way to control the thermal change? for example in my input script that
can help to control the temperature?

again, you are thinking backwards. an exploding kinetic energy
is _always_ a sign of doing something wrong. forcing the temperature
to be lower, only makes your calculations even less useful
than they already are. something has to be wrong, but since i
have no psychic powers, i cannot tell you what.

axel.

Thank you very much for your guidance. I think the nvt/sllod command should be correct based on my test. After checking my codes again, I still got large temperature fluctuating in my test run. I put my input file in the attachment. Could you help to find out where could be wrong? It is 1000 water molecules inside the box. Thank you very much again.

Laura

in.shear_viscosity-2 (877 Bytes)

Hi All,

I'm probably missing something really obvious here, but I thought I'd
ask for help anyway.

I compiled the GPU library, resulting in the libgpu.a library being
created. The program nvc_get_devices executes ok, and displays the
correct number of tesla cards on my system.
I then moved to the main source directory. I added the following
packages (in this order) Molecule, KSpace, GPU, then compiled. All goes
fine until the link stage. I then get a lot of undefined references to
functions that are in the libgpu.a. e.g.;
lmp_init_device
lmp_clear_device
lmp_gpu_forces
cl_gpu_clear
to name a few.

(I've attached the full output from the main make)

Has anyone seen something similar, and if so, do you know what I'm doing
wrong, and do you have any pointers to help me along?

Cheers,

Chris.

lammps-17Sep11.make.out2.txt (185 KB)

Can I get some help on my topic?

in.shear_viscosity-2 (877 Bytes)

I presume libgpu.a is in your link line, due to being
listed as -lgpu in src/Makefile.package. If not, something
went wrong. Maybe Mike has another idea.

Steve

What topic? Axel has already answered several of your Qs.
No one is likely to just run an input script you post
and look for issues ... you need a more specific Q.

Steve

Hi Chris,

Not sure if you got this fixed already. If you haven't found the issue, plz check the link line to make sure that the location of libgpu.a is specified with the -L flag. Also make sure that the same or compatible compilers are being used to compile both the library and LAMMPS (e.g. the same MPI wrappers) and that both or 32 or 64 bit. If you are still having problems, let me know.
- Mike

Hi Mike and Steve,

I've checked, and the link line includes the location of libgpu.a (if I remove the -L../../lib/gpu bit is says it can't find libgpu.

The library libgpu is being compiled with nvcc from cuda_3.2 and intel 11.1 64bit with openmpi

And the main lammps source is compiled with openmpi and intel 11.1

Chris.

Hi Chris,

you can check if these functions are defined in libgpu.a, like using

strings libgpu.a | grep lmp_init_device

If they are already in libgpu.a the above command would return something like:

_Z15lmp_init_deviceP19ompi_communicator_tS0_iiidii

then I don’t know why the functions are not recognized by the same linker (intel-11.1).

Otherwise, these functions might be not successfully compiled into libgpu.a. Please check if pair_gpu_device.cpp (where lmp_init_device, lmp_gpu_forces and lmp_clear_device are defined) is compiled by looking at Nvidia.makefile or the list of .o files produced when you built libgpu.a.

Another thing I’d try is to use another compiler, for example, GNU.

Good luck,
-Trung