SimulationTaskManager#

class ansys.additive.core.simulation_task_manager.SimulationTaskManager#

Provides a manager for simulation tasks.

Overview#

add_task

Add a task to this manager.

status

Get status of each operation stored in this manager.

wait_all

Wait for all simulations to finish. A simple loop that waits for each task will wait for the

cancel_all

Cancel all simulations belonging to this simulation task manager.

summaries

Get a list of the summaries of completed simulations only.

tasks

Get the list of tasks managed by this manager.

simulation_ids

Get the list of the simulation ids managed by this manager.

done

Check if all tasks are done.

Import detail#

from ansys.additive.core.simulation_task_manager import SimulationTaskManager

Property detail#

property SimulationTaskManager.tasks: list[ansys.additive.core.simulation_task.SimulationTask]#

Get the list of tasks managed by this manager.

property SimulationTaskManager.simulation_ids: list[str]#

Get the list of the simulation ids managed by this manager.

property SimulationTaskManager.done: bool#

Check if all tasks are done.

Method detail#

SimulationTaskManager.add_task(task: ansys.additive.core.simulation_task.SimulationTask)#

Add a task to this manager.

Parameters:
task: SimulationTask

The simulation task holding the long-running operation and corresponding server.

SimulationTaskManager.status(progress_handler: ansys.additive.core.progress_handler.IProgressHandler | None = None) list[tuple[str, ansys.additive.core.progress_handler.Progress]]#

Get status of each operation stored in this manager.

Parameters:
progress_handler: IProgressHandler, None, default: None

Handler for progress updates. If None, no progress updates are provided.

Returns:
List of tuples with each tuple containing the operation name and an instance of Progress
SimulationTaskManager.wait_all(progress_handler: ansys.additive.core.progress_handler.IProgressHandler | None = None) None#

Wait for all simulations to finish. A simple loop that waits for each task will wait for the simulation that takes the longest. This works because wait returns immediately if operation is done.

Parameters:
progress_handler: IProgressHandler, None, default: None

Handler for progress updates. If None, no progress updates are provided.

SimulationTaskManager.cancel_all() None#

Cancel all simulations belonging to this simulation task manager.

SimulationTaskManager.summaries()#

Get a list of the summaries of completed simulations only.