def methods_on_promises(): word_lengths = noodles.delay(my_dict()) for word in ['apple', 'orange', 'kiwi']: word_lengths[word] = word_length(word) return accumulate(word_lengths.values())
def test_broker_01(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) assert run_parallel(C, 4) == 42
def test_broker_02(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) assert run_single(C) == 42
def test_broker_01(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) assert run_parallel(C, 4) == 42
def test_broker_02(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) assert run_single(C) == 42
def test_broker_logging(): A = log_add(1, 1) B = sub(3, A) multiples = [mul(log_add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) with NCDisplay(title="Running the test") as display: assert run_parallel_with_display(C, 4, display) == 42
def test_xenon_42(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) result = run_parallel_timing(C, 4, sys.stdout) assert(result == 42)
def test_xenon_42(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) result = run_parallel_timing(C, 4, sys.stdout) assert (result == 42)
def test_broker_logging(): A = log_add(1, 1) B = sub(3, A) multiples = [mul(log_add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) with NCDisplay(title="Running the test") as display: assert run_parallel_with_display(C, 4, display) == 42
def test_prov_04(): db_file = "prov3.json" A = add2(1, 1) B = sub(3, A) multiples = [mul(add2(i, B), A) for i in range(6)] C = accumulate(gather(*multiples)) result = run_parallel_opt(C, 4, serial.base, db_file) assert result == 42 os.unlink(db_file)
def test_prov_03(): db_file = "prov2.json" A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(gather(*multiples)) result = run_parallel(C, 4, serial.base, db_file, JobKeeper(keep=True)) assert result == 42 os.unlink(db_file)
def test_prov_02(): db_file = "prov1.json" A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] C = accumulate(gather(*multiples)) result = run_single(C, serial.base, db_file) assert result == 42 os.unlink(db_file)
def test_get_intermediate_results(): r1 = add(1, 1) r2 = sub(3, r1) def foo(a, b, c): return mul(add(a, b), c) r3 = [foo(i, r2, r1) for i in range(6)] r4 = accumulate(noodles.gather_all(r3)) run_single(r4) assert noodles.result(r1) == 2 assert noodles.result(r2) == 1 assert [noodles.result(r) for r in r3] == [2, 4, 6, 8, 10, 12] assert noodles.result(r4) == 42
def test_xenon_42(): A = log_add(1, 1) B = sub(3, A) multiples = [mul(log_add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) xenon_config = XenonConfig(jobs_scheme='local') job_config = RemoteJobConfig(registry=serial.base, time_out=1000) with XenonKeeper() as Xe, NCDisplay() as display: result = run_xenon(C, Xe, "cache.json", 2, xenon_config, job_config, display=display) assert (result == 42)
def test_xenon_42(): A = log_add(1, 1) B = sub(3, A) multiples = [mul(log_add(i, B), A) for i in range(6)] C = accumulate(noodles.gather(*multiples)) xenon_config = XenonConfig( jobs_scheme='local' ) job_config = RemoteJobConfig( registry=serial.base, time_out=1000 ) with XenonKeeper() as Xe, NCDisplay() as display: result = run_xenon( C, Xe, "cache.json", 2, xenon_config, job_config, display=display) assert(result == 42)
def test_42(): A = add(1, 1) B = sub(3, A) multiples = [mul(add(i, B), A) for i in range(6)] return accumulate(noodles.gather(*multiples))