Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Weilei Zeng at qlab01 committed Apr 26, 2024
1 parent 5e40756 commit 52646bb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pymatching/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from multiprocessing import Pool


def fun(i):
print(i)
for j in range(i*10,i*10+10):
pass
return
# print(j,end=',')
print()

def test_pool():
with Pool(5) as pool:
pool.map(fun, range(20))

test_pool()

#result, use pool.map_async() instead
# see https://stackoverflow.com/questions/33447055/python-multiprocess-pool-how-to-exit-the-script-when-one-of-the-worker-process


def main():
foo()
def foo():
print('foo')
bar()

def bar():
print('bar')

main()

0 comments on commit 52646bb

Please sign in to comment.