Remove mentions of Pypar
This commit is contained in:
@ -38,13 +38,14 @@ Once you have successfully wrapped LAMMPS, you can run the Python
|
|||||||
scripts in the examples sub-directory:
|
scripts in the examples sub-directory:
|
||||||
|
|
||||||
trivial.py read/run a LAMMPS input script thru Python
|
trivial.py read/run a LAMMPS input script thru Python
|
||||||
demo.py invoke various LAMMPS library interface routines
|
demo.py invoke various LAMMPS library interface routines
|
||||||
simple.py parallel example, mimicing examples/COUPLE/simple/simple.cpp
|
simple.py parallel example, mimicing examples/COUPLE/simple/simple.cpp
|
||||||
split.py parallel example
|
split.py parallel example
|
||||||
mc.py Monte Carlo energy relaxation wrapper on LAMMPS
|
mc.py Monte Carlo energy relaxation wrapper on LAMMPS
|
||||||
gui.py GUI go/stop/temperature-slider to control LAMMPS
|
gui.py GUI go/stop/temperature-slider to control LAMMPS
|
||||||
plot.py real-time temperature plot with GnuPlot via Pizza.py
|
plot.py real-time temperature plot with GnuPlot via Pizza.py
|
||||||
viz_tool.py real-time viz via some viz package
|
matplotlib_plot.py real-time temperature plot with Matplotlib via Pizza.py
|
||||||
|
viz_tool.py real-time viz via some viz package
|
||||||
vizplotgui_tool.py combination of viz.py and plot.py and gui.py
|
vizplotgui_tool.py combination of viz.py and plot.py and gui.py
|
||||||
|
|
||||||
For the viz_tool.py and vizplotgui_tool.py commands, replace "tool"
|
For the viz_tool.py and vizplotgui_tool.py commands, replace "tool"
|
||||||
@ -100,24 +101,24 @@ split.py in.simple # can run in parallel (see below)
|
|||||||
|
|
||||||
gui.py in.gui 100
|
gui.py in.gui 100
|
||||||
plot.py in.plot 10 1000 thermo_temp
|
plot.py in.plot 10 1000 thermo_temp
|
||||||
|
matplotlib_plot.py in.plot 10 1000 thermo_temp
|
||||||
viz_tool.py in.viz 100 5000
|
viz_tool.py in.viz 100 5000
|
||||||
vizplotgui_tool.py in.viz 100 thermo_temp
|
vizplotgui_tool.py in.viz 100 thermo_temp
|
||||||
|
|
||||||
To run LAMMPS in parallel from Python, so something like this:
|
To run LAMMPS in parallel from Python, so something like this:
|
||||||
|
|
||||||
% mpirun -np 4 simple.py in.simple
|
% mpirun -np P simple.py in.simple
|
||||||
% mpirun -np 4 python split.py in.simple
|
% mpirun -np P python split.py in.simple
|
||||||
|
|
||||||
If you run simple.py as-is, this will invoke P instances of a
|
If you run simple.py as-is, this will invoke P instances of a
|
||||||
one-processor run, where both Python and LAMMPS will run on single
|
one-processor run, where both Python and LAMMPS will run on single
|
||||||
processors. Each running job will read the same input file, and write
|
processors. Each running job will read the same input file, and write
|
||||||
to same log.lammps file, which isn't too useful.
|
to same log.lammps file, which isn't too useful.
|
||||||
|
|
||||||
However, if you have either the Pypar or mpi4py packages installed in
|
However, if you have the mpi4py Python package installed and uncomment mpi4py
|
||||||
your Python, and uncomment the Pypar or mpi4py code in simple.py, then
|
code in simple.py, then the above commands will invoke 1 instance of a
|
||||||
the above commands will invoke 1 instance of a P-processor run. Both
|
P-processor run. Both Python and LAMMPS will run on P processors. The job will
|
||||||
Python and LAMMPS will run on P processors. The job will read the
|
read the input file and write a single log.lammps file.
|
||||||
input file and write a single log.lammps file.
|
|
||||||
|
|
||||||
The split.py script can also be run in parallel. It uses mpi4py
|
The split.py script can also be run in parallel. It uses mpi4py
|
||||||
version 2.0.0 (or later), which makes it possible to pass a
|
version 2.0.0 (or later), which makes it possible to pass a
|
||||||
|
|||||||
1
python/examples/.gitignore
vendored
Normal file
1
python/examples/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/tmp*
|
||||||
@ -28,10 +28,10 @@ nsteps = int(sys.argv[3])
|
|||||||
compute = sys.argv[4]
|
compute = sys.argv[4]
|
||||||
|
|
||||||
me = 0
|
me = 0
|
||||||
# uncomment if running in parallel via Pypar
|
# uncomment this if running in parallel via mpi4py
|
||||||
#import pypar
|
#from mpi4py import MPI
|
||||||
#me = pypar.rank()
|
#me = MPI.COMM_WORLD.Get_rank()
|
||||||
#nprocs = pypar.size()
|
#nprocs = MPI.COMM_WORLD.Get_size()
|
||||||
|
|
||||||
from lammps import lammps
|
from lammps import lammps
|
||||||
lmp = lammps()
|
lmp = lammps()
|
||||||
@ -82,11 +82,8 @@ while ntimestep < nsteps:
|
|||||||
|
|
||||||
lmp.command("run 0 pre no post yes")
|
lmp.command("run 0 pre no post yes")
|
||||||
|
|
||||||
# uncomment if running in parallel via Pypar
|
# uncomment if running in parallel via mpi4py
|
||||||
#print("Proc %d out of %d procs has" % (me,nprocs), lmp)
|
#print("Proc %d out of %d procs has" % (me,nprocs), lmp)
|
||||||
#pypar.finalize()
|
|
||||||
|
|
||||||
if sys.version_info[0] == 3:
|
if me == 0:
|
||||||
input("Press Enter to exit...")
|
input("Press Enter to exit...")
|
||||||
else:
|
|
||||||
raw_input("Press Enter to exit...")
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# Parallel syntax: mpirun -np 4 simple.py in.lammps
|
# Parallel syntax: mpirun -np 4 simple.py in.lammps
|
||||||
# in.lammps = LAMMPS input script
|
# in.lammps = LAMMPS input script
|
||||||
# also need to uncomment either Pypar or mpi4py sections below
|
# also need to uncomment mpi4py sections below
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
@ -27,11 +27,6 @@ infile = sys.argv[1]
|
|||||||
|
|
||||||
me = 0
|
me = 0
|
||||||
|
|
||||||
# uncomment this if running in parallel via Pypar
|
|
||||||
#import pypar
|
|
||||||
#me = pypar.rank()
|
|
||||||
#nprocs = pypar.size()
|
|
||||||
|
|
||||||
# uncomment this if running in parallel via mpi4py
|
# uncomment this if running in parallel via mpi4py
|
||||||
#from mpi4py import MPI
|
#from mpi4py import MPI
|
||||||
#me = MPI.COMM_WORLD.Get_rank()
|
#me = MPI.COMM_WORLD.Get_rank()
|
||||||
@ -133,8 +128,5 @@ lmp.reset_box([0,0,0],[10,10,8],0,0,0)
|
|||||||
boxlo,boxhi,xy,yz,xz,periodicity,box_change = lmp.extract_box()
|
boxlo,boxhi,xy,yz,xz,periodicity,box_change = lmp.extract_box()
|
||||||
if me == 0: print("Box info",boxlo,boxhi,xy,yz,xz,periodicity,box_change)
|
if me == 0: print("Box info",boxlo,boxhi,xy,yz,xz,periodicity,box_change)
|
||||||
|
|
||||||
# uncomment if running in parallel via Pypar
|
|
||||||
#print("Proc %d out of %d procs has" % (me,nprocs), lmp)
|
|
||||||
|
|
||||||
# uncomment if running in parallel via mpi4py
|
# uncomment if running in parallel via mpi4py
|
||||||
#print("Proc %d out of %d procs has" % (me,nprocs), lmp)
|
#print("Proc %d out of %d procs has" % (me,nprocs), lmp)
|
||||||
|
|||||||
Reference in New Issue
Block a user