Hi G.S.,<br><br>For whatever reason, the python you're using doesn't think it has mpi4py installed.  If you installed yt from the install script, you should have set the PYTHONPATH environment variable.  One way you can verify whether you actually have mpi4py installed with that python is by going into the PYTHONPATH directory and checking if there is anything in there named mpi4py.  Can you verify this?<br>
<br>Britton<br><br><div class="gmail_quote">On Mon, Mar 21, 2011 at 7:52 PM,  <span dir="ltr"><<a href="mailto:gso@physics.ucsd.edu">gso@physics.ucsd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Just had a revelation, I just had to get rid of the yt.func part for it to<br>
work since they're already imported from yt.mods... so first issue<br>
resolved<br>
<br>
but the mpi4py issue remains.<br>
<br>
From<br>
G.S.<br>
<div><div></div><div class="h5"><br>
> Hi all,<br>
><br>
> I was trying to use a script that calls yt.func.only_on_root to write the<br>
> results to an output file if my script is ran in parallel, when it gave me<br>
> the following:<br>
><br>
> Traceback (most recent call last):<br>
>   File "QuantityTotal.py", line 127, in <module><br>
>     yt.funcs.only_on_root(flush, "frames/StarFormationRate.txt", "%12.12e<br>
> %12.12e %12.12e %12.12i %12.12e %12.12i %12.12i %12.12i %12.12i\n" %<br>
> (yr, TotEmis, redshift, num_sources, 0, Ion10, IonE3, IonE5,<br>
> num_star))<br>
> NameError: name 'yt' is not defined<br>
><br>
> I was wondering if either I messed up an import or something similar since<br>
> this script was from an older version of yt... with<br>
> #from yt.config import ytcfg<br>
> #ytcfg["lagos","serialize"] = "False"<br>
> commented out at the top.  I also thought that maybe because I was using<br>
> only 1 processor so I tried this on multiple processors on Triton after<br>
> installing mpi4py by hand, instead I got:<br>
><br>
>     from mpi4py import MPI<br>
> ImportError: No module named mpi4py<br>
> Traceback (most recent call last):<br>
>   File "QuantityTotal.py", line 6, in <module><br>
>     from yt.mods import *<br>
>   File "/home/gso/TritonYT/src/yt-hg/yt/mods.py", line 44, in <module><br>
>     from yt.data_objects.api import \<br>
>   File "/home/gso/TritonYT/src/yt-hg/yt/data_objects/api.py", line 34, in<br>
> <module><br>
>     from hierarchy import \<br>
>   File "/home/gso/TritonYT/src/yt-hg/yt/data_objects/hierarchy.py", line<br>
> 40, in <module><br>
>     from yt.utilities.parallel_tools.parallel_analysis_interface import \<br>
>   File<br>
> "/home/gso/TritonYT/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py",<br>
> line 47, in <module><br>
><br>
> I used the same directory for both my YT installation and mpi4py, so I<br>
> shouldn't have to change anything for my environment variables such as<br>
> where the /lib and /bin are (dev yt 2.1 works fine in serial), so I'm not<br>
> sure what's going on now.  Has anyone else encountered anything similar?<br>
> Are they two different problems or one of the same?<br>
><br>
> From<br>
> G.S.<br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">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>
<br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">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>
</div></div></blockquote></div><br>