Hi there!
I have a question. Every time I run a simple cadCAD ABM example, the code is executed 4 times even though the the ExecutionContext is set to exec_mode.single_proc. Does anyone know why is this happening and how could I obtain one run per execution?
Many thanks!
Hi @anabele, can you provide a sample so we can better under stand the issue you are running into?
Best,
-Z
hi Z!
When I execute my script, it runs several times. In my terminal I see the cadCAD logo several times per run.
My output file, where I write out raw_result, contains 4 sets of results.
Here are parts of my code that I guess are relevant:
“”"### Workaround against interrupted execution and no agent update during the execution - from the cadCAD community “”"
if name == ‘main’:
client = Client()
“”"### Configuration and Execution"""
config = Configuration(initial_state=initial_conditions,
partial_state_update_blocks=partial_state_update_blocks,
sim_config=simulation_parameters
)
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
exec_mode = ExecutionMode()
exec_context = ExecutionContext(exec_mode.single_proc)
executor = Executor(exec_context, [config])
raw_result, tensor = executor.execute()
Please let me know if I should send something else. I can also put together a very basic script that reproduces the issue.
Many thanks!
Anabele
This would help a lot, thanks! From the snippets above it’s not clear to me what’s causing the issue.