git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8614 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2012-08-11 19:30:13 +00:00
parent f699bd6ca8
commit 3fea520ef9
2 changed files with 17 additions and 13 deletions

View File

@ -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 ends in ".so", like libatc.o. As we or others create and contribute
these Makefiles, we will add them to the LAMMPS distribution. these Makefiles, we will add them to the LAMMPS distribution.
</P> </P>
<HR>
<A NAME = "py_3"></A><H4>11.3 Extending Python with MPI to run in parallel <A NAME = "py_3"></A><H4>11.3 Extending Python with MPI to run in parallel
</H4> </H4>
<P>If you wish to run LAMMPS in parallel from Python, you need to extend <P>If you wish to run LAMMPS in parallel from Python, you need to extend
@ -346,21 +348,21 @@ correctly.
<P>Note that any Python script (not just for LAMMPS) can be invoked in <P>Note that any Python script (not just for LAMMPS) can be invoked in
one of several ways: one of several ways:
</P> </P>
<P>% python foo.script <PRE>% python foo.script
% python -i foo.script % python -i foo.script
% foo.script % foo.script
</P> </PRE>
<P>The last command requires that the first line of the script be <P>The last command requires that the first line of the script be
something like this: something like this:
</P> </P>
<P>#!/usr/local/bin/python <PRE>#!/usr/local/bin/python
#!/usr/local/bin/python -i #!/usr/local/bin/python -i
</P> </PRE>
<P>where the path points to where you have Python installed, and that you <P>where the path points to where you have Python installed, and that you
have made the script file executable: have made the script file executable:
</P> </P>
<P>% chmod +x foo.script <PRE>% chmod +x foo.script
</P> </PRE>
<P>Without the "-i" flag, Python will exit when the script finishes. <P>Without the "-i" flag, Python will exit when the script finishes.
With the "-i" flag, you will be left in the Python interpreter when With the "-i" flag, you will be left in the Python interpreter when
the script finishes, so you can type subsequent commands. As the script finishes, so you can type subsequent commands. As
@ -434,7 +436,7 @@ lmp.put_coords(x) # set all atom coords via x
</PRE> </PRE>
<HR> <HR>
<P>IMPORTANT NOTE: Currenlty, the creation of a LAMMPS object does not <P>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 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 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 desired, but I don't know how to do it from Pypar. So for now, it

View File

@ -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 ends in ".so", like libatc.o. As we or others create and contribute
these Makefiles, we will add them to the LAMMPS distribution. 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 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 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 foo.script
% python -i foo.script % python -i foo.script
% foo.script % foo.script :pre
The last command requires that the first line of the script be The last command requires that the first line of the script be
something like this: something like this:
#!/usr/local/bin/python #!/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 where the path points to where you have Python installed, and that you
have made the script file executable: 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. Without the "-i" flag, Python will exit when the script finishes.
With the "-i" flag, you will be left in the Python interpreter when 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 :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 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 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 desired, but I don't know how to do it from Pypar. So for now, it