From 3fea520ef9802f55bd52cbb8c12f41312edf6c19 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Sat, 11 Aug 2012 19:30:13 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8614 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Section_python.html | 20 +++++++++++--------- doc/Section_python.txt | 10 ++++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/Section_python.html b/doc/Section_python.html index e2fb6ee55d..b761ee73c3 100644 --- a/doc/Section_python.html +++ b/doc/Section_python.html @@ -180,6 +180,8 @@ with a C++ (or Fortran) compiler, as well as an output target that ends in ".so", like libatc.o. As we or others create and contribute these Makefiles, we will add them to the LAMMPS distribution.

+
+

11.3 Extending Python with MPI to run in parallel

If you wish to run LAMMPS in parallel from Python, you need to extend @@ -346,21 +348,21 @@ correctly.

Note that any Python script (not just for LAMMPS) can be invoked in one of several ways:

-

% python foo.script +

% python foo.script
 % python -i foo.script
-% foo.script
-

+% foo.script +

The last command requires that the first line of the script be something like this:

-

#!/usr/local/bin/python -#!/usr/local/bin/python -i -

+
#!/usr/local/bin/python 
+#!/usr/local/bin/python -i 
+

where the path points to where you have Python installed, and that you have made the script file executable:

-

% chmod +x foo.script -

+
% chmod +x foo.script 
+

Without the "-i" flag, Python will exit when the script finishes. With the "-i" flag, you will be left in the Python interpreter when the script finishes, so you can type subsequent commands. As @@ -434,7 +436,7 @@ lmp.put_coords(x) # set all atom coords via x


-

IMPORTANT NOTE: Currenlty, the creation of a LAMMPS object does not +

IMPORTANT NOTE: Currently, the creation of a LAMMPS object does not take an MPI communicator as an argument. There should be a way to do this, so that the LAMMPS instance runs on a subset of processors if desired, but I don't know how to do it from Pypar. So for now, it diff --git a/doc/Section_python.txt b/doc/Section_python.txt index 9d9ec04b1c..7386e8b53e 100644 --- a/doc/Section_python.txt +++ b/doc/Section_python.txt @@ -176,6 +176,8 @@ with a C++ (or Fortran) compiler, as well as an output target that ends in ".so", like libatc.o. As we or others create and contribute these Makefiles, we will add them to the LAMMPS distribution. +:line + 11.3 Extending Python with MPI to run in parallel :link(py_3),h4 If you wish to run LAMMPS in parallel from Python, you need to extend @@ -344,18 +346,18 @@ one of several ways: % python foo.script % python -i foo.script -% foo.script +% foo.script :pre The last command requires that the first line of the script be something like this: #!/usr/local/bin/python -#!/usr/local/bin/python -i +#!/usr/local/bin/python -i :pre where the path points to where you have Python installed, and that you have made the script file executable: -% chmod +x foo.script +% chmod +x foo.script :pre Without the "-i" flag, Python will exit when the script finishes. With the "-i" flag, you will be left in the Python interpreter when @@ -429,7 +431,7 @@ lmp.put_coords(x) # set all atom coords via x :pre :line -IMPORTANT NOTE: Currenlty, the creation of a LAMMPS object does not +IMPORTANT NOTE: Currently, the creation of a LAMMPS object does not take an MPI communicator as an argument. There should be a way to do this, so that the LAMMPS instance runs on a subset of processors if desired, but I don't know how to do it from Pypar. So for now, it