<div dir="ltr">Hi Kacper,<div><br></div><div>Thank you, this is great!  I will look into this once we get this release out.</div><div><br></div><div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jul 28, 2014 at 4:19 PM, Kacper Kowalik <span dir="ltr"><<a href="mailto:xarthisius.kk@gmail.com" target="_blank">xarthisius.kk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 07/28/2014 04:05 PM, Britton Smith wrote:<br>
> Hi all,<br>
><br>
> Does anyone, perhaps Kacper, know if we can do any answer testing in<br>
> parallel?  I would like to add a test for the rockstar halo finder, but it<br>
> has to be run with a minimum of 3 MPI tasks.  This would not require 3<br>
> actual CPUs to run on since each the tasks sort of take turns.  Is there a<br>
> way to do this?<br>
<br>
</div></div>Hi Britton,<br>
bear in mind that I don't have any experience with mixing mpi and nose,<br>
but I'd go for mpi_spawn. Roughly, it would look like that:<br>
<br>
shakuras ~/codes/britton $ cat test_foo.py<br>
#!/usr/bin/env python<br>
<br>
from mpi4py import MPI<br>
import sys<br>
def test_blah():<br>
    comm = MPI.COMM_SELF.Spawn("blah.py", maxprocs=3)<br>
    status = MPI.Status()<br>
    comm.Disconnect()<br>
    assert True<br>
<br>
shakuras ~/codes/britton $ cat blah.py<br>
#!/usr/bin/env python<br>
<br>
from mpi4py import MPI<br>
import sys<br>
<br>
comm = MPI.Comm.Get_parent()<br>
size = comm.Get_size()<br>
rank = comm.Get_rank()<br>
<br>
sys.stderr.write("size = %i, rank = %i\n" % (size, rank))<br>
comm.Disconnect()<br>
<br>
<br>
blah.py would be an actual test in your case. I think it'd be safer to<br>
evaluate if test passed/failed after comm.Disconnect() so that mpi<br>
processes are not left hanging, but it needs to be verified empirically ;)<br>
<br>
Cheers,<br>
Kacper<br>
<br>
P.s. There's a project that does something similar:<br>
<a href="https://github.com/dagss/mpinoseutils" target="_blank">https://github.com/dagss/mpinoseutils</a>  but I don't know its state.<br>
<br>
<br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>