[yt-users] Storing multiple calculations using yt.parallel_objects

Britton Smith brittonsmith at gmail.com
Sun May 24 09:19:45 PDT 2015


Hi Josh,

The reason that's not working is that there is still only one storage item
(the sto variable) per iteration of the loop.  You could keep both things
if you make sto.result a list object and just append each of those things
to that list.

Britton

On Sun, May 24, 2015 at 11:12 AM, Joshua Wall <joshua.e.wall at gmail.com>
wrote:

> Dear users,
>
>
>      This there a simple way to store multiple values at each step using
> parallel_objects? I'm doing:
>
> ########################################################
> yt.enable_parallelism()
> num_procs = 4
> plot = glob.glob(./plot*)
> my_storage = {}
>
> for sto, p in yt.parallel_objects(plots, num_procs, my_storage):
>
>   sto.result_id = 'energy' + p
>   sto.resutl     = dd["total_energy"]
>
>   sto.result_id = 'Px' + p
>   sto.result     = dd["total_mom_x"]
>
> ######################################################
>
> which is just overwriting my energy with the momentum. I also tried to
> just set to different dictionaries without passing it to
> yt.parallel_objects as storage, but of course each proc as only a local
> copy then.
>
> Cordially,
>
> Josh
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150524/72c44edc/attachment.html>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list