def _open_graph(): scheduler, storage, spec_roots, symbol_table_cls = setup() # Populate the graph for the given request, and print the resulting Addresses. engine = LocalSerialEngine(scheduler, storage) engine.start() try: graph = ExpGraph(scheduler, engine, symbol_table_cls) addresses = tuple(graph.inject_specs_closure(spec_roots)) yield graph, addresses finally: print('Cache stats: {}'.format(engine._cache.get_stats()), file=sys.stderr) engine.close()
def open_exp_graph(*args, **kwargs): with _open_scheduler(*args, **kwargs) as (scheduler, engine, symbol_table_cls, spec_roots): graph = ExpGraph(scheduler, engine, symbol_table_cls) addresses = tuple(graph.inject_specs_closure(spec_roots)) yield graph, addresses, scheduler