On Sat, Feb 14, 2009 at 1:56 PM, rsoares <span dir="ltr"><<a href="mailto:dlleuz@xmission.com">dlleuz@xmission.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I meant that I use mpich2 on all my computers, some which are "server" only, no gui stuff.</blockquote><div><br>I don't really see what this has to do with anything. <br><br>I think I've covered this already, but I'll say it again.  Openmpi works.  It installs, it runs with both enzo and yt.<br>

It works.<br>
I use it.<br>
If you can get mpich2 to work, then use that.  If not, I've given you an alternative that I know works.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font color="#888888">
<br>
rsoares wrote:<br>
</font><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Yt  /python2.6 is of course compatible with openmpi then?<br>
<br>
Britton Smith wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Here's how it works.<br>
mpi4py is a module like any other.  You build it with the python installation that you built all the other modules with, ala python setup.py build and install.  In order for that to work, you need some mpi libraries installed.  As I said, I prefer openmpi for this because they were the easiest for me to install and build mpi4py with.  Before you do python build install in the mpi4py directory, you'll need to edit the .cfg file (can't remember exactly what it's called) so that the installation has the proper paths to your mpi install.<br>

<br>
When you've got mpi4py properly built, you will be able to run some yt operations in parallel in the following manner.<br>
1. Whatever you want to do needs to be in some python script.  As far as I know, you can't do parallel entering lines directly into the interpreter.<br>
Here's an example:<br>
<br>
### Start<br>
from yt.mods import *<br>
from yt.config import ytcfg<br>
pf = EnzoStaticOutput("EnzoRuns/cool_core_rediculous/DD0252/DD0252")<br>
pc = PlotCollection(pf,center=[0.5,0.5,0.5])<br>
pc.add_projection("Density",0)<br>
<br>
if ytcfg.getint("yt","__parallel_rank") == 0:<br>
           pc.save("DD0252")<br>
### End<br>
That if statement at the end assures that the final image save is done by the root process only.  The nice thing is this script can be run in exactly the same form in serial, too.<br>
<br>
2. Let's say this script is called proj.py.  You'll run it like this:<br>
mpirun -np 4 python proj.py --parallel<br>
<br>
If you don't unclude the --parallel, you'll see 4 instances of your proj.py script running separately, but each one doing the entire projection and not working together.<br>
<br>
Hope that helps,<br>
<br>
Britton<br>
<br>
On Fri, Feb 13, 2009 at 11:15 PM, rsoares <<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a> <mailto:<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a>>> wrote:<br>

<br>
    What Python do you parallelize to install mpi4py into - or do you<br>
    build /use mpi4py without python, then how?<br>
<br>
    R.Soares<br>
<br>
    Britton Smith wrote:<br>
<br>
        I recommend using openmpi.  I have been able to build openmpi<br>
        on multiple platforms and then build mpi4py with it without<br>
        any customization.  As Matt has said, though, you won't see<br>
        any benefit to using parallel until your simulations are at<br>
        least 256^3 cells or more.<br>
<br>
        On Thu, Feb 12, 2009 at 8:16 PM, Matthew Turk<br>
        <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a> <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>><br>
        <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a> <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>>>><br>
        wrote:<br>
<br>
           Hi again,<br>
<br>
           I just realized that I should say a couple important caveats --<br>
<br>
           1. We haven't released 'yt-trunk' as 1.5 yet because it's<br>
        not quite<br>
           done or stable.  It's going well, and many people use it for<br>
           production-quality work, but it's not really<br>
        stamped-and-completed.<br>
           2. I should *also* note that you won't really get a lot out of<br>
           parallel yt unless you have relatively large datasets or<br>
        relatively<br>
           large amounts of computation on each cell while creating a<br>
        derived<br>
           field.  It might end up being a bit more work than you're<br>
        looking for,<br>
           if you just want to get some plots out quickly.<br>
<br>
           -Matt<br>
<br>
           On Thu, Feb 12, 2009 at 7:12 PM, Matthew Turk<br>
           <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a> <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>><br>
        <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a> <mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>>>><br>
        wrote:<br>
           > Hi!<br>
           ><br>
           > yt-trunk is now parallelized.  Not all tasks work in<br>
        parallel, but<br>
           > projections, profiles (if done in 'lazy' mode) and halo<br>
        finding (if<br>
           > you use the SS_HopOutput module) are now parallelized.<br>
         Slices are<br>
           > almost done, and the new covering grid will be.  It's not<br>
           documented,<br>
           > but those tasks should all run in parallel.  We will be<br>
        rolling<br>
           out a<br>
           > 1.5 release relatively soon, likely shortly after I<br>
        defend my thesis<br>
           > in April, that will have documentation and so forth.<br>
           ><br>
           > I'm surprised you can't compile against the mpich<br>
        libraries in a<br>
           > shared fashion.  Unfortunately, I'm not an expert on MPI<br>
           > implementations, so I can't quite help out there.  In my<br>
        personal<br>
           > experience, using OpenMPI, I have needed to except when<br>
        running on<br>
           > some form of linux without a loader -- the previous<br>
        discussion about<br>
           > this was related to Kraken, which runs a Cray-specific<br>
        form of linux<br>
           > called "Compute Node Linux."  I don't actually know<br>
        offhand (anybody<br>
           > else?) of any non-Cray machines at supercomputing out<br>
        there require<br>
           > static linking as opposed to a standard installation of<br>
        Python.<br>
            (I'm<br>
           > sure they do, I just don't know of them!)<br>
           ><br>
           > As for the second part, usually when instantiating you<br>
        have to<br>
           run the<br>
           > executable via mpirun.  (On other MPI implementations,<br>
        this could be<br>
           > something different.)  One option for this -- if you're<br>
        running off<br>
           > trunk -- would be to do something like:<br>
           ><br>
           > mpirun -np 4 python my_script.py --parallel<br>
           ><br>
           > where the file my_script.py has something like:<br>
           ><br>
           > --<br>
           > from yt.mods import *<br>
           > pf = EnzoStaticOutput("my_output")<br>
           > pc = PlotCollection(pf, center=[0.5,0.5,0.5])<br>
           > pc.add_projection("Density",0)<br>
           > pc.save("hi_there")<br>
           > --<br>
           ><br>
           > The projection would be executed in parallel, in this case.<br>
            (There is<br>
           > a command line interface called 'yt' that also works in<br>
           parallel, but<br>
           > it's still a bit in flux.)  You can't just run "python"<br>
        because<br>
           of the<br>
           > way the stdin and stdout streams work; you have to supply a<br>
           script, so<br>
           > that it can proceed without input from the user.  (IPython's<br>
           parallel<br>
           > fanciness notwithstanding, which we do not use in yt.)<br>
           ><br>
           > But, keep in mind, running "mpirun -np 4" by itself,<br>
        wihtout setting<br>
           > up a means of distributing tasks (usually via a tasklist)<br>
        will run<br>
           > them all on the current machine.  I am, unfortunately,<br>
        not really<br>
           > qualified to speak to setting up MPI implementations.<br>
         But please do<br>
           > let us know if you have problems with the yt aspects of this!<br>
           ><br>
           > -Matt<br>
           ><br>
           > On Thu, Feb 12, 2009 at 6:59 PM, rsoares<br>
        <<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a> <mailto:<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a>><br>
           <mailto:<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a> <mailto:<a href="mailto:dlleuz@xmission.com" target="_blank">dlleuz@xmission.com</a>>>><br>
        wrote:<br>
           >> Hi,<br>
           >><br>
           >> I'm trying to run mpi4py on my 4 machines, but I need a<br>
           parallelized version<br>
           >> of Python. Tried to compile one with Python 2.5 and<br>
        mpich2 but<br>
           mpich2 won't<br>
           >> let me built dynamic /shares libraries which it needs.<br>
         Trying<br>
           with the<br>
           >> static ones involves alot of headers errors from both.<br>
           >> Is yt-trunk capable of doing python in parallel?<br>
           >><br>
           >> Without parallel-python, I mpdboot -n 4 then<br>
           >><br>
           >> python<br>
           >>>>>import MPI<br>
           >>>>> rank, size = MPI.COMM_WORLD.rank, MPI.COMM_WORLD.size<br>
           >>>>> print 'Hello World! I am process', rank, 'of', size<br>
           >> Hello World! I am process 0 of 1<br>
           >>>>><br>
           >><br>
           >> not 4 processes, and  mpirun -np 4 python just hangs.<br>
         mpi4py<br>
           installed on<br>
           >> all 4 nodes.<br>
           >><br>
           >> Thanks.<br>
           >><br>
           >> R.Soares<br>
           >> _______________________________________________<br>
           >> yt-users mailing list<br>
           >> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a>><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a>>><br>
<br>
           >><br>
        <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
           >><br>
           ><br>
           _______________________________________________<br>
           yt-users mailing list<br>
           <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a>><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
        <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a>>><br>
<br>
           <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
<br>
        ------------------------------------------------------------------------<br>
<br>
        _______________________________________________<br>
        yt-users mailing list<br>
        <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a> <mailto:<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a>><br>
        <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
        <br>
</blockquote>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
</div></div><div class="Ih2E3d"><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
</div></blockquote>
</blockquote></div><br>