#!/usr/bin/env python # coding: utf-8 # In[1]: import ipyparallel as ipp ipp.__version__ # In[2]: import os get_ipython().system("sh -c 'cd {os.path.dirname(ipp.__file__)} && git describe'") # In[3]: with ipp.Cluster(n=4) as rc: view = rc.load_balanced_view() tic = time.perf_counter() ar = view.map_async(time.sleep, [0.1] * 100) toc = time.perf_counter() print(f"Submitted {len(ar)} tasks in {toc-tic:.3f}s") ar.wait_interactive() print(f"Completed in {ar.wall_time:.1f}s")