Merge branch 'master' into lammps-icms
This commit is contained in:
@ -58,12 +58,13 @@ operations within LAMMPS, such as running a simulation for a
|
|||||||
reasonable number of timesteps, then the overhead cost of invoking
|
reasonable number of timesteps, then the overhead cost of invoking
|
||||||
LAMMPS thru Python will be negligible.
|
LAMMPS thru Python will be negligible.
|
||||||
</P>
|
</P>
|
||||||
<P>Before using LAMMPS from a Python script, you have to do two things.
|
<P>Before using LAMMPS from a Python script, you need to do two things.
|
||||||
You need to set two environment variables. And you need to build
|
You need to build LAMMPS as a dynamic shared library, so it can be
|
||||||
LAMMPS as a dynamic shared library, so it can be loaded by Python.
|
loaded by Python. And you need to tell Python how to find the library
|
||||||
Both these steps are discussed below. If you wish to run LAMMPS in
|
and the Python wrapper file python/lammps.py. Both these steps are
|
||||||
parallel from Python, you also need to extend your Python with MPI.
|
discussed below. If you wish to run LAMMPS in parallel from Python,
|
||||||
This is also discussed below.
|
you also need to extend your Python with MPI. This is also discussed
|
||||||
|
below.
|
||||||
</P>
|
</P>
|
||||||
<P>The Python wrapper for LAMMPS uses the amazing and magical (to me)
|
<P>The Python wrapper for LAMMPS uses the amazing and magical (to me)
|
||||||
"ctypes" package in Python, which auto-generates the interface code
|
"ctypes" package in Python, which auto-generates the interface code
|
||||||
@ -131,7 +132,7 @@ python/lammps.py file.
|
|||||||
</P>
|
</P>
|
||||||
<P>You can invoke install.py from the python directory as
|
<P>You can invoke install.py from the python directory as
|
||||||
</P>
|
</P>
|
||||||
<PRE>% python install.py <B>libdir</B> <B>pydir</B>
|
<PRE>% python install.py [libdir] [pydir]
|
||||||
</PRE>
|
</PRE>
|
||||||
<P>The optional libdir is where to copy the LAMMPS shared library to; the
|
<P>The optional libdir is where to copy the LAMMPS shared library to; the
|
||||||
default is /usr/local/lib. The optional pydir is where to copy the
|
default is /usr/local/lib. The optional pydir is where to copy the
|
||||||
@ -146,12 +147,12 @@ non-standard locations, such as within your own user space, you will
|
|||||||
need to set your PYTHONPATH and LD_LIBRARY_PATH environment variables
|
need to set your PYTHONPATH and LD_LIBRARY_PATH environment variables
|
||||||
accordingly, as above.
|
accordingly, as above.
|
||||||
</P>
|
</P>
|
||||||
<P>If the instally.py script does not allow you to copy files into system
|
<P>If the install.py script does not allow you to copy files into system
|
||||||
directories, prefix the python command with "sudo". If you do this,
|
directories, prefix the python command with "sudo". If you do this,
|
||||||
make sure that the Python that root runs is the same as the Python you
|
make sure that the Python that root runs is the same as the Python you
|
||||||
run. E.g. you may need to do something like
|
run. E.g. you may need to do something like
|
||||||
</P>
|
</P>
|
||||||
<PRE>% sudo /usr/local/bin/python install.py <B>libdir</B> <B>pydir</B>
|
<PRE>% sudo /usr/local/bin/python install.py [libdir] [pydir]
|
||||||
</PRE>
|
</PRE>
|
||||||
<P>You can also invoke install.py from the make command in the src
|
<P>You can also invoke install.py from the make command in the src
|
||||||
directory as
|
directory as
|
||||||
@ -269,20 +270,27 @@ and type:
|
|||||||
<PRE>>>> from lammps import lammps
|
<PRE>>>> from lammps import lammps
|
||||||
>>> lmp = lammps()
|
>>> lmp = lammps()
|
||||||
</PRE>
|
</PRE>
|
||||||
<P>If you get no errors, you're ready to use LAMMPS from Python.
|
<P>If you get no errors, you're ready to use LAMMPS from Python. If the
|
||||||
If the load fails, the most common error to see is
|
2nd command fails, the most common error to see is
|
||||||
</P>
|
</P>
|
||||||
<PRE>OSError: Could not load LAMMPS dynamic library
|
<PRE>OSError: Could not load LAMMPS dynamic library
|
||||||
</PRE>
|
</PRE>
|
||||||
<P>which means Python was unable to load the LAMMPS shared library. This
|
<P>which means Python was unable to load the LAMMPS shared library. This
|
||||||
typically occurs if the system can't find the LAMMMPS shared library
|
typically occurs if the system can't find the LAMMPS shared library or
|
||||||
or one of the auxiliary shared libraries it depends on.
|
one of the auxiliary shared libraries it depends on, or if something
|
||||||
|
about the library is incompatible with your Python. The error message
|
||||||
|
should give you an indication of what went wrong.
|
||||||
</P>
|
</P>
|
||||||
<P>Python (actually the operating system) isn't verbose about telling you
|
<P>You can also test the load directly in Python as follows, without
|
||||||
why the load failed, so carefully go through the steps above regarding
|
first importing from the lammps.py file:
|
||||||
environment variables, and the instructions in <A HREF = "Section_start.html#start_5">Section_start
|
</P>
|
||||||
5</A> about building a shared library and
|
<PRE>>>> from ctypes import CDLL
|
||||||
about setting the LD_LIBRARY_PATH envirornment variable.
|
>>> CDLL("liblammps.so")
|
||||||
|
</PRE>
|
||||||
|
<P>If an error occurs, carefully go thru the steps in <A HREF = "Section_start.html#start_5">Section_start
|
||||||
|
5</A> and above about building a shared
|
||||||
|
library and about insuring Python can find the necessary two files
|
||||||
|
it needs.
|
||||||
</P>
|
</P>
|
||||||
<H5><B>Test LAMMPS and Python in serial:</B>
|
<H5><B>Test LAMMPS and Python in serial:</B>
|
||||||
</H5>
|
</H5>
|
||||||
|
|||||||
@ -55,12 +55,13 @@ operations within LAMMPS, such as running a simulation for a
|
|||||||
reasonable number of timesteps, then the overhead cost of invoking
|
reasonable number of timesteps, then the overhead cost of invoking
|
||||||
LAMMPS thru Python will be negligible.
|
LAMMPS thru Python will be negligible.
|
||||||
|
|
||||||
Before using LAMMPS from a Python script, you have to do two things.
|
Before using LAMMPS from a Python script, you need to do two things.
|
||||||
You need to set two environment variables. And you need to build
|
You need to build LAMMPS as a dynamic shared library, so it can be
|
||||||
LAMMPS as a dynamic shared library, so it can be loaded by Python.
|
loaded by Python. And you need to tell Python how to find the library
|
||||||
Both these steps are discussed below. If you wish to run LAMMPS in
|
and the Python wrapper file python/lammps.py. Both these steps are
|
||||||
parallel from Python, you also need to extend your Python with MPI.
|
discussed below. If you wish to run LAMMPS in parallel from Python,
|
||||||
This is also discussed below.
|
you also need to extend your Python with MPI. This is also discussed
|
||||||
|
below.
|
||||||
|
|
||||||
The Python wrapper for LAMMPS uses the amazing and magical (to me)
|
The Python wrapper for LAMMPS uses the amazing and magical (to me)
|
||||||
"ctypes" package in Python, which auto-generates the interface code
|
"ctypes" package in Python, which auto-generates the interface code
|
||||||
@ -127,7 +128,7 @@ python/lammps.py file.
|
|||||||
|
|
||||||
You can invoke install.py from the python directory as
|
You can invoke install.py from the python directory as
|
||||||
|
|
||||||
% python install.py [libdir] [pydir] :pre
|
% python install.py \[libdir\] \[pydir\] :pre
|
||||||
|
|
||||||
The optional libdir is where to copy the LAMMPS shared library to; the
|
The optional libdir is where to copy the LAMMPS shared library to; the
|
||||||
default is /usr/local/lib. The optional pydir is where to copy the
|
default is /usr/local/lib. The optional pydir is where to copy the
|
||||||
@ -142,12 +143,12 @@ non-standard locations, such as within your own user space, you will
|
|||||||
need to set your PYTHONPATH and LD_LIBRARY_PATH environment variables
|
need to set your PYTHONPATH and LD_LIBRARY_PATH environment variables
|
||||||
accordingly, as above.
|
accordingly, as above.
|
||||||
|
|
||||||
If the instally.py script does not allow you to copy files into system
|
If the install.py script does not allow you to copy files into system
|
||||||
directories, prefix the python command with "sudo". If you do this,
|
directories, prefix the python command with "sudo". If you do this,
|
||||||
make sure that the Python that root runs is the same as the Python you
|
make sure that the Python that root runs is the same as the Python you
|
||||||
run. E.g. you may need to do something like
|
run. E.g. you may need to do something like
|
||||||
|
|
||||||
% sudo /usr/local/bin/python install.py [libdir] [pydir] :pre
|
% sudo /usr/local/bin/python install.py \[libdir\] \[pydir\] :pre
|
||||||
|
|
||||||
You can also invoke install.py from the make command in the src
|
You can also invoke install.py from the make command in the src
|
||||||
directory as
|
directory as
|
||||||
@ -265,20 +266,27 @@ and type:
|
|||||||
>>> from lammps import lammps
|
>>> from lammps import lammps
|
||||||
>>> lmp = lammps() :pre
|
>>> lmp = lammps() :pre
|
||||||
|
|
||||||
If you get no errors, you're ready to use LAMMPS from Python.
|
If you get no errors, you're ready to use LAMMPS from Python. If the
|
||||||
If the load fails, the most common error to see is
|
2nd command fails, the most common error to see is
|
||||||
|
|
||||||
OSError: Could not load LAMMPS dynamic library :pre
|
OSError: Could not load LAMMPS dynamic library :pre
|
||||||
|
|
||||||
which means Python was unable to load the LAMMPS shared library. This
|
which means Python was unable to load the LAMMPS shared library. This
|
||||||
typically occurs if the system can't find the LAMMMPS shared library
|
typically occurs if the system can't find the LAMMPS shared library or
|
||||||
or one of the auxiliary shared libraries it depends on.
|
one of the auxiliary shared libraries it depends on, or if something
|
||||||
|
about the library is incompatible with your Python. The error message
|
||||||
|
should give you an indication of what went wrong.
|
||||||
|
|
||||||
Python (actually the operating system) isn't verbose about telling you
|
You can also test the load directly in Python as follows, without
|
||||||
why the load failed, so carefully go through the steps above regarding
|
first importing from the lammps.py file:
|
||||||
environment variables, and the instructions in "Section_start
|
|
||||||
5"_Section_start.html#start_5 about building a shared library and
|
>>> from ctypes import CDLL
|
||||||
about setting the LD_LIBRARY_PATH envirornment variable.
|
>>> CDLL("liblammps.so") :pre
|
||||||
|
|
||||||
|
If an error occurs, carefully go thru the steps in "Section_start
|
||||||
|
5"_Section_start.html#start_5 and above about building a shared
|
||||||
|
library and about insuring Python can find the necessary two files
|
||||||
|
it needs.
|
||||||
|
|
||||||
[Test LAMMPS and Python in serial:] :h5
|
[Test LAMMPS and Python in serial:] :h5
|
||||||
|
|
||||||
|
|||||||
@ -850,7 +850,7 @@ should be the file /usr/local/lib/libmpich.so.
|
|||||||
the environment variable LD_LIBRARY_PATH. So you may wish to copy the
|
the environment variable LD_LIBRARY_PATH. So you may wish to copy the
|
||||||
file src/liblammps.so or src/liblammps_g++.so (for example) to a place
|
file src/liblammps.so or src/liblammps_g++.so (for example) to a place
|
||||||
the system can find it by default, such as /usr/local/lib, or you may
|
the system can find it by default, such as /usr/local/lib, or you may
|
||||||
wish to add the lammps src directory to LD_LIBRARY_PATH, so that the
|
wish to add the LAMMPS src directory to LD_LIBRARY_PATH, so that the
|
||||||
current version of the shared library is always available to programs
|
current version of the shared library is always available to programs
|
||||||
that use it.
|
that use it.
|
||||||
</P>
|
</P>
|
||||||
|
|||||||
@ -844,7 +844,7 @@ The operating system finds shared libraries to load at run-time using
|
|||||||
the environment variable LD_LIBRARY_PATH. So you may wish to copy the
|
the environment variable LD_LIBRARY_PATH. So you may wish to copy the
|
||||||
file src/liblammps.so or src/liblammps_g++.so (for example) to a place
|
file src/liblammps.so or src/liblammps_g++.so (for example) to a place
|
||||||
the system can find it by default, such as /usr/local/lib, or you may
|
the system can find it by default, such as /usr/local/lib, or you may
|
||||||
wish to add the lammps src directory to LD_LIBRARY_PATH, so that the
|
wish to add the LAMMPS src directory to LD_LIBRARY_PATH, so that the
|
||||||
current version of the shared library is always available to programs
|
current version of the shared library is always available to programs
|
||||||
that use it.
|
that use it.
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
#include <compute.h>
|
#include <compute.h>
|
||||||
#include <modify.h>
|
#include <modify.h>
|
||||||
#include <error.h>
|
#include <error.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
|||||||
@ -21,12 +21,6 @@
|
|||||||
library.h. All prototypes herein COULD be added to library.h instead of
|
library.h. All prototypes herein COULD be added to library.h instead of
|
||||||
including this as a separate file. See the README for instructions. */
|
including this as a separate file. See the README for instructions. */
|
||||||
|
|
||||||
/* These prototypes probably belong in mpi.h in the src/STUBS directory. */
|
|
||||||
#ifndef OPEN_MPI
|
|
||||||
#define MPI_Comm_f2c(a) a
|
|
||||||
#define MPI_Fint int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -38,7 +32,7 @@ int lammps_extract_compute_vectorsize (void*, char*, int);
|
|||||||
void lammps_extract_compute_arraysize (void*, char*, int, int*, int*);
|
void lammps_extract_compute_arraysize (void*, char*, int, int*, int*);
|
||||||
int lammps_extract_fix_vectorsize (void*, char*, int);
|
int lammps_extract_fix_vectorsize (void*, char*, int);
|
||||||
void lammps_extract_fix_arraysize (void*, char*, int, int*, int*);
|
void lammps_extract_fix_arraysize (void*, char*, int, int*, int*);
|
||||||
void lammps_error_all (void *ptr, const char*, int, const char*);
|
void lammps_error_all (void*, const char*, int, const char*);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ questions:
|
|||||||
Karl D. Hammond
|
Karl D. Hammond
|
||||||
University of Tennessee, Knoxville
|
University of Tennessee, Knoxville
|
||||||
karlh at ugcs.caltech.edu
|
karlh at ugcs.caltech.edu
|
||||||
karlh atutk.edu
|
karlh at utk.edu
|
||||||
|
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ compile.
|
|||||||
The following steps will work to compile this module (replace ${LAMMPS_SRC}
|
The following steps will work to compile this module (replace ${LAMMPS_SRC}
|
||||||
with the path to your LAMMPS source directory):
|
with the path to your LAMMPS source directory):
|
||||||
(1) Compile LAMMPS as a static library. Call the resulting file ${LAMMPS_LIB},
|
(1) Compile LAMMPS as a static library. Call the resulting file ${LAMMPS_LIB},
|
||||||
which will have an actual name lake liblammps_openmpi.a. If compiling
|
which will have an actual name lake liblmp_openmpi.a. If compiling
|
||||||
using the MPI stubs in ${LAMMPS_SRC}/STUBS, you will need to know where
|
using the MPI stubs in ${LAMMPS_SRC}/STUBS, you will need to know where
|
||||||
libmpi.a is as well (I'll call it ${MPI_STUBS} hereafter)
|
libmpi.a is as well (I'll call it ${MPI_STUBS} hereafter)
|
||||||
(2) Copy said library to your Fortran program's source directory or include
|
(2) Copy said library to your Fortran program's source directory or include
|
||||||
@ -61,7 +61,7 @@ with the path to your LAMMPS source directory):
|
|||||||
need to have the .mod file from part (3).
|
need to have the .mod file from part (3).
|
||||||
|
|
||||||
It is also possible to add LAMMPS.o and LAMMPS-wrapper.o into the
|
It is also possible to add LAMMPS.o and LAMMPS-wrapper.o into the
|
||||||
LAMMPS library (e.g., liblammps_openmpi.a) instead of creating a separate
|
LAMMPS library (e.g., liblmp_openmpi.a) instead of creating a separate
|
||||||
library, like so:
|
library, like so:
|
||||||
ar rs ${LAMMPS_LIB} LAMMPS.o LAMMPS-wrapper.o
|
ar rs ${LAMMPS_LIB} LAMMPS.o LAMMPS-wrapper.o
|
||||||
In this case, you can now use the Fortran wrapper functions as if they
|
In this case, you can now use the Fortran wrapper functions as if they
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
|
|
||||||
# Path to LAMMPS extraction directory
|
# Path to LAMMPS extraction directory
|
||||||
LAMMPS_ROOT = ../svn-dist
|
LAMMPS_ROOT = ../../..
|
||||||
LAMMPS_SRC = $(LAMMPS_ROOT)/src
|
LAMMPS_SRC = $(LAMMPS_ROOT)/src
|
||||||
|
|
||||||
# Remove the line below if using mpicxx/mpic++ as your C++ compiler
|
# Remove the line below if using mpicxx/mpic++ as your C++ compiler
|
||||||
|
|||||||
@ -1,35 +1,67 @@
|
|||||||
#!/usr/local/bin/python
|
#!/usr/local/bin/python
|
||||||
|
|
||||||
# copy LAMMPS shared library src/liblammps.so and lammps.py to system dirs
|
# copy LAMMPS src/liblammps.so and lammps.py to system dirs
|
||||||
# Syntax: python install.py [libdir] [pydir]
|
|
||||||
# libdir = target dir for src/liblammps.so, default = /usr/local/lib
|
|
||||||
# pydir = target dir for lammps.py, default = Python site-packages dir
|
|
||||||
|
|
||||||
import sys,commands
|
instructions = """
|
||||||
|
Syntax: python install.py [-h] [libdir] [pydir]
|
||||||
|
libdir = target dir for src/liblammps.so, default = /usr/local/lib
|
||||||
|
pydir = target dir for lammps.py, default = Python site-packages dir
|
||||||
|
"""
|
||||||
|
|
||||||
if len(sys.argv) > 3:
|
import sys,os,commands
|
||||||
print "Syntax: python install.py [libdir] [pydir]"
|
|
||||||
|
if (len(sys.argv) > 1 and sys.argv[1] == "-h") or len(sys.argv) > 3:
|
||||||
|
print instructions
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if len(sys.argv) >= 2: libdir = sys.argv[1]
|
if len(sys.argv) >= 2: libdir = sys.argv[1]
|
||||||
else: libdir = "/usr/local/lib"
|
else: libdir = "/usr/local/lib"
|
||||||
|
|
||||||
if len(sys.argv) == 3: pydir = sys.argv[2]
|
if len(sys.argv) == 3: pydir = sys.argv[2]
|
||||||
|
else: pydir = ""
|
||||||
|
|
||||||
|
# copy C lib to libdir if it exists
|
||||||
|
# warn if not in LD_LIBRARY_PATH or LD_LIBRARY_PATH is undefined
|
||||||
|
|
||||||
|
if not os.path.isdir(libdir):
|
||||||
|
print "ERROR: libdir %s does not exist" % libdir
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if "LD_LIBRARY_PATH" not in os.environ:
|
||||||
|
print "WARNING: LD_LIBRARY_PATH undefined, cannot check libdir %s" % libdir
|
||||||
else:
|
else:
|
||||||
paths = sys.path
|
libpaths = os.environ['LD_LIBRARY_PATH'].split(':')
|
||||||
for i,path in enumerate(paths):
|
if libdir not in libpaths:
|
||||||
index = path.rfind("site-packages")
|
print "WARNING: libdir %s not in LD_LIBRARY_PATH" % libdir
|
||||||
if index < 0: continue
|
|
||||||
if index == len(path) - len("site-packages"): break
|
|
||||||
pydir = paths[i]
|
|
||||||
|
|
||||||
str = "cp ../src/liblammps.so %s" % libdir
|
str = "cp ../src/liblammps.so %s" % libdir
|
||||||
print str
|
print str
|
||||||
outstr = commands.getoutput(str)
|
outstr = commands.getoutput(str)
|
||||||
if len(outstr.strip()): print outstr
|
if len(outstr.strip()): print outstr
|
||||||
|
|
||||||
str = "cp ../python/lammps.py %s" % pydir
|
# copy lammps.py to pydir if it exists
|
||||||
print str
|
# if pydir not specified, install in site-packages via distutils setup()
|
||||||
outstr = commands.getoutput(str)
|
|
||||||
if len(outstr.strip()): print outstr
|
|
||||||
|
|
||||||
|
if pydir:
|
||||||
|
if not os.path.isdir(pydir):
|
||||||
|
print "ERROR: pydir %s does not exist" % pydir
|
||||||
|
sys.exit()
|
||||||
|
str = "cp ../python/lammps.py %s" % pydir
|
||||||
|
print str
|
||||||
|
outstr = commands.getoutput(str)
|
||||||
|
if len(outstr.strip()): print outstr
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
print "installing lammps.py in Python site-packages dir"
|
||||||
|
|
||||||
|
os.chdir('../python') # in case invoked via make in src dir
|
||||||
|
|
||||||
|
from distutils.core import setup
|
||||||
|
sys.argv = ["setup.py","install"] # as if had run "python setup.py install"
|
||||||
|
setup(name = "lammps",
|
||||||
|
version = "15Aug12",
|
||||||
|
author = "Steve Plimpton",
|
||||||
|
author_email = "sjplimp@sandia.gov",
|
||||||
|
url = "http://lammps.sandia.gov",
|
||||||
|
description = "LAMMPS molecular dynamics library",
|
||||||
|
py_modules = ["lammps"])
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
# Python wrapper on LAMMPS library via ctypes
|
# Python wrapper on LAMMPS library via ctypes
|
||||||
|
|
||||||
import types
|
import sys,traceback,types
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
@ -27,6 +27,8 @@ class lammps:
|
|||||||
if not name: self.lib = CDLL("liblammps.so")
|
if not name: self.lib = CDLL("liblammps.so")
|
||||||
else: self.lib = CDLL("liblammps_%s.so" % name)
|
else: self.lib = CDLL("liblammps_%s.so" % name)
|
||||||
except:
|
except:
|
||||||
|
type,value,tb = sys.exc_info()
|
||||||
|
traceback.print_exception(type,value,tb)
|
||||||
raise OSError,"Could not load LAMMPS dynamic library"
|
raise OSError,"Could not load LAMMPS dynamic library"
|
||||||
|
|
||||||
# create an instance of LAMMPS
|
# create an instance of LAMMPS
|
||||||
|
|||||||
@ -39,6 +39,8 @@ class FFT3d : protected Pointers {
|
|||||||
|
|
||||||
E: Could not create 3d FFT plan
|
E: Could not create 3d FFT plan
|
||||||
|
|
||||||
The FFT setup in pppm failed.
|
The FFT setup for the PPPM solver failed, typically due
|
||||||
|
to lack of memory. This is an unusual error. Check the
|
||||||
|
size of the FFT grid you are requesting.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -100,7 +100,6 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
|||||||
// see JCP 109, pg 7698 for derivation of coefficients
|
// see JCP 109, pg 7698 for derivation of coefficients
|
||||||
// higher order coefficients may be computed if needed
|
// higher order coefficients may be computed if needed
|
||||||
|
|
||||||
memory->destroy(acons);
|
|
||||||
memory->create(acons,8,7,"pppm:acons");
|
memory->create(acons,8,7,"pppm:acons");
|
||||||
acons[1][0] = 2.0 / 3.0;
|
acons[1][0] = 2.0 / 3.0;
|
||||||
acons[2][0] = 1.0 / 50.0;
|
acons[2][0] = 1.0 / 50.0;
|
||||||
|
|||||||
@ -85,9 +85,6 @@ $(EXE): $(OBJ)
|
|||||||
lib: $(OBJ)
|
lib: $(OBJ)
|
||||||
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
|
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
|
||||||
|
|
||||||
#shlib: $(OBJ)
|
|
||||||
# $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
|
|
||||||
|
|
||||||
shlib: $(OBJ)
|
shlib: $(OBJ)
|
||||||
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
|
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
|
||||||
$(OBJ) $(EXTRA_LIB) $(LIB)
|
$(OBJ) $(EXTRA_LIB) $(LIB)
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
# Make.sh = update Makefile.lib or Makefile.list or style_*.h files
|
# Make.sh = update Makefile.lib, Makefile.shlib, Makefile.list
|
||||||
|
# or style_*.h files
|
||||||
# Syntax: sh Make.sh style
|
# Syntax: sh Make.sh style
|
||||||
# sh Make.sh Makefile.lib
|
# sh Make.sh Makefile.lib
|
||||||
|
# sh Make.sh Makefile.shlib
|
||||||
# sh Make.sh Makefile.list
|
# sh Make.sh Makefile.list
|
||||||
|
|
||||||
# function to create one style_*.h file
|
# function to create one style_*.h file
|
||||||
|
|||||||
@ -130,7 +130,7 @@ makelist:
|
|||||||
@$(SHELL) Make.sh style
|
@$(SHELL) Make.sh style
|
||||||
@$(SHELL) Make.sh Makefile.list
|
@$(SHELL) Make.sh Makefile.list
|
||||||
|
|
||||||
# install LAMMPS shared lib and Python wrapper in Python
|
# install LAMMPS shared lib and Python wrapper for Python usage
|
||||||
|
|
||||||
install-python:
|
install-python:
|
||||||
@python ../python/install.py
|
@python ../python/install.py
|
||||||
|
|||||||
@ -21,9 +21,6 @@ help:
|
|||||||
@files="`ls MAKE/Makefile.*`"; \
|
@files="`ls MAKE/Makefile.*`"; \
|
||||||
for file in $$files; do head -1 $$file; done
|
for file in $$files; do head -1 $$file; done
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf Obj_*
|
|
||||||
|
|
||||||
.DEFAULT:
|
.DEFAULT:
|
||||||
@test -f MAKE/Makefile.$@
|
@test -f MAKE/Makefile.$@
|
||||||
@if [ ! -d Obj_$@ ]; then mkdir Obj_$@; fi
|
@if [ ! -d Obj_$@ ]; then mkdir Obj_$@; fi
|
||||||
|
|||||||
@ -21,9 +21,6 @@ help:
|
|||||||
@files="`ls MAKE/Makefile.*`"; \
|
@files="`ls MAKE/Makefile.*`"; \
|
||||||
for file in $$files; do head -1 $$file; done
|
for file in $$files; do head -1 $$file; done
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf Obj_*
|
|
||||||
|
|
||||||
.DEFAULT:
|
.DEFAULT:
|
||||||
@test -f MAKE/Makefile.$@
|
@test -f MAKE/Makefile.$@
|
||||||
@if [ ! -d Obj_$@ ]; then mkdir Obj_$@; fi
|
@if [ ! -d Obj_$@ ]; then mkdir Obj_$@; fi
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -410,6 +410,8 @@ void Cuda::setDomainParams()
|
|||||||
cu_domain->boxlo_lamda[i] = domain->boxlo_lamda[i];
|
cu_domain->boxlo_lamda[i] = domain->boxlo_lamda[i];
|
||||||
cu_domain->boxhi_lamda[i] = domain->boxhi_lamda[i];
|
cu_domain->boxhi_lamda[i] = domain->boxhi_lamda[i];
|
||||||
cu_domain->prd_lamda[i] = domain->prd_lamda[i];
|
cu_domain->prd_lamda[i] = domain->prd_lamda[i];
|
||||||
|
cu_domain->sublo[i] = domain->sublo_lamda[i];
|
||||||
|
cu_domain->subhi[i] = domain->subhi_lamda[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
cu_domain->xy = domain->xy;
|
cu_domain->xy = domain->xy;
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#ifdef PAIR_CLASS
|
#ifdef PAIR_CLASS
|
||||||
|
|
||||||
PairStyle(lj/cut/omp,PairLJExpandOMP)
|
PairStyle(lj/expand/omp,PairLJExpandOMP)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,9 @@
|
|||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
#include "comm.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -383,8 +385,13 @@ void lammps_gather_atoms(void *ptr, char *name,
|
|||||||
|
|
||||||
// error if tags are not defined or not consecutive
|
// error if tags are not defined or not consecutive
|
||||||
|
|
||||||
if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) return;
|
int flag = 0;
|
||||||
if (lmp->atom->natoms > MAXSMALLINT) return;
|
if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1;
|
||||||
|
if (lmp->atom->natoms > MAXSMALLINT) flag = 1;
|
||||||
|
if (flag && lmp->comm->me == 0) {
|
||||||
|
lmp->error->warning(FLERR,"Library error in lammps_gather_atoms");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int natoms = static_cast<int> (lmp->atom->natoms);
|
int natoms = static_cast<int> (lmp->atom->natoms);
|
||||||
|
|
||||||
@ -464,10 +471,16 @@ void lammps_scatter_atoms(void *ptr, char *name,
|
|||||||
{
|
{
|
||||||
LAMMPS *lmp = (LAMMPS *) ptr;
|
LAMMPS *lmp = (LAMMPS *) ptr;
|
||||||
|
|
||||||
// error if tags are not defined or not consecutive
|
// error if tags are not defined or not consecutive or no atom map
|
||||||
|
|
||||||
if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) return;
|
int flag = 0;
|
||||||
if (lmp->atom->natoms > MAXSMALLINT) return;
|
if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1;
|
||||||
|
if (lmp->atom->natoms > MAXSMALLINT) flag = 1;
|
||||||
|
if (lmp->atom->map_style == 0) flag = 1;
|
||||||
|
if (flag && lmp->comm->me == 0) {
|
||||||
|
lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int natoms = static_cast<int> (lmp->atom->natoms);
|
int natoms = static_cast<int> (lmp->atom->natoms);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user