1111import multiprocessing
1212from tonpy .tvm .c7 import C7
1313from tqdm import tqdm
14- from c7_data import c7_data
14+ from tonpy . tests . c7_data import c7_data
1515from tonpy .scheduler import init_thread_scheduler
1616
1717faulthandler .enable ()
1818
1919
2020def f (params ):
21- """Synchronous function: Creates TVM, sets C7, and runs."""
2221 index , code , c7_entry = params # Unpack arguments
2322 if isinstance (c7_entry , Cell ):
2423 c7_entry = C7 (time = 321 , block_lt = 999 , trans_lt = 291 , global_config = c7_entry ).to_stack_entry ()
@@ -34,14 +33,12 @@ def f(params):
3433
3534
3635async def af (tvm_instance ):
37- """Asynchronous function execution."""
3836 final_stack = await tvm_instance .arun (True , allow_non_success = True )
3937 assert tvm_instance .success is False
4038 return True
4139
4240
4341def run_multiprocessing (num_instances , code , c7_data ):
44- """Run TVM instances in parallel using multiprocessing."""
4542 params = [(i , code , c7_data ) for i in range (num_instances )] # Generate args for processes
4643 with multiprocessing .Pool (processes = multiprocessing .cpu_count ()) as pool :
4744 results = pool .map (f , params , chunksize = 1 )
@@ -50,7 +47,7 @@ def run_multiprocessing(num_instances, code, c7_data):
5047
5148@pytest .mark .asyncio
5249async def test_tvm_c7_complex (cs , mode ):
53- init_thread_scheduler (128 )
50+ init_thread_scheduler (30 )
5451
5552 code = """<{ ZERO ZERO WHILE:<{ 1 INT }>DO<{ DUP }> }>c"""
5653 num_instances = cs
0 commit comments