Preliminary 3 Simulations

Rerun some simulations from the paper.


In [1]:
from distributed import LocalCluster
from distributed import Client
from extremefill2D.fextreme import init_sim, restart_sim, iterate_sim, multi_init_sim
from extremefill2D.fextreme.plot import vega_plot_treants, vega_plot_treant
import vega
from extremefill2D.fextreme.tools import get_by_uuid, outer_dict, pmap
from toolz.curried import map, pipe, curry
import itertools

%reload_ext yamlmagic

In [6]:
cluster = LocalCluster(nanny=True, n_workers=8, threads_per_worker=1)
client = Client(cluster)
client


Out[6]:
<Client: scheduler="127.0.0.1:8786" processes=8 cores=8>
Exception ignored in: <generator object handle_stream at 0x7f5658c236d0>
RuntimeError: generator ignored GeneratorExit
Exception ignored in: <generator object handle_stream at 0x7f5658be1938>
RuntimeError: generator ignored GeneratorExit
Exception ignored in: <generator object handle_stream at 0x7f5658be1888>
RuntimeError: generator ignored GeneratorExit

In [7]:
1. / 0.065


Out[7]:
15.384615384615383

In [5]:
client.shutdown()

In [10]:
treants = multi_init_sim('../../scripts/params.json',
                         '../../data',
                         pmap(client),
                         dict(appliedPotential=[-0.45],
                              bulkSuppressor=[0.06],
                              kPlus=[546.0],
                              kMinus=[3.79e7],
                              rBoundary=[28e-6]),
                         tags=['prelim3a'])

In [11]:
print(treants)


[<Treant: '8af1d0b8-47a3-4d00-b4b8-f7e5c15c5639'>]

In [12]:
treant_and_errors = pmap(client)(iterate_sim(iterations=30, steps=100), treants)

In [ ]: