<div dir="ltr">Hi Yingchao,<div><br></div><div>I don't think covering grid construction is parallelized at the moment - in your script each processor is creating its own copy of the covering grid. I haven't tried experimenting with this though so it's possible I'm misreading the code or missing something happening elsewhere to make this operation parallel.</div><div><br></div><div>One way around this with the current version of yt would be to handle the parallelism yourself - i.e. have each processor construct a subvolume of the covering grid and then combine it yourself using e.g. mpi4py.</div><div><br></div><div>I think it might also be possible to make yt construct the covering grid in a parallel-aware fashion. The relevant code is here:</div><div><br></div><div><a href="https://github.com/yt-project/yt/blob/master/yt/data_objects/construction_data_containers.py#L686" target="_blank">https://github.com/yt-project/<wbr>yt/blob/master/yt/data_<wbr>objects/construction_data_<wbr>containers.py#L686</a><br></div><div><br></div><div>One would need to make the loop over io chunks a parallel loop and then add a reduction step at the end.</div><div><br></div><div>If you don't feel like taking on this task yourself please feel free to open an issue about it on github so that we don't lose track of the feature request.</div><div><br></div><div>-Nathan</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 7:53 PM, Yingchao Lu <span dir="ltr"><<a href="mailto:yingchao.lu@gmail.com" target="_blank">yingchao.lu@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 dir="ltr"><div>Dear yt users,</div><div><br></div><div>I am trying to read some AMR data and convert them into 3D array. The test code:</div><div>######################### BEGIN ######################### <br></div><div><div>import yt</div><div>from time import time</div><div>yt.enable_parallelism()</div><div><br></div><div>ds = yt.load("flash_hdf5_plt_cnt_00<wbr>00")</div><div>tstart = time()</div><div>cg = ds.covering_grid(level=ds.max_<wbr>level, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions*2**d<wbr>s.max_level)</div><div>cg['dens']</div><div><br></div><div>if yt_isroot(): print "It takes {0}s".format(time()-tstart)</div></div><div>######################### END ######################### </div><div><br></div><div>I tried to run to serial or parallel on an interactive session on stampede:</div><div> ######################### BEGIN ######################### </div><div>[yclu@ test]$ ls</div><div>flash_hdf5_plt_cnt_0000  test.py</div><div>[yclu@ test]$ python test.py</div><div>It takes 34.0571820736s</div><div>[yclu@ test]$ export OMP_NUM_THREADS=68</div><div>[yclu@ test]$ python test.py           </div><div>It takes 33.1969199181s</div><div>[yclu@ test]$ export OMP_NUM_THREADS=1 </div><div>[yclu@ test]$ mpirun -np 68 python test.py</div><div>It takes 58.0391800404s</div><div>######################### END ######################### <br></div><div><br></div><div>The time does not seem to be reduced by parallelism. And multi-process seem to have huge communication overhead. Is there a way to increase the speed by parallelism? </div><div><br></div><div>Thanks,</div><div>Yingchao</div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-users-spacepope.<wbr>org</a><br>
<br></blockquote></div><br></div></div>