pfc_execute_task
Submit a Python script for asynchronous execution in PFC. The tool returns a task ID and runs the script in the background, allowing monitoring and control via companion tools.
Instructions
Submit a Python script file for asynchronous execution in PFC.
Returns a task_id immediately; the script runs in the background. Use the companion tools to manage the task lifecycle:
pfc_check_task_status: poll output, progress, and final status
pfc_interrupt_task: cancel a running task
pfc_list_tasks: browse task history
While the task is cycling, you can call pfc_execute_code at any time to inspect or modify simulation state — including variables the task depends on. This is the standard way to probe progress, tune parameters mid-run, swap callbacks, or trigger early termination via a sentinel variable. Both tools share the same main namespace in PFC's main thread.
Console output from itasca.command() inside the script — table dumps, list output, command summaries — is captured and interleaved with Python prints in the task log, visible through pfc_check_task_status.
Do NOT have the script invoke program call '<file>.p3dat'
(or .p2dat / .dat). PFC's command-script interpreter blocks
the bridge for the script's entire duration with no cycle-gap
interleaving, leaving the bridge unreachable until PFC is
stopped manually. If the user asks to run a .dat / .p3dat /
.p2dat file, read the file and translate its commands into a
sequence of itasca.command(...) calls in the Python script
instead.
This is the async / background execution path: pollable via pfc_check_task_status, cancellable via pfc_interrupt_task. Submission does not lock parameters — start with reasonable values and refine live via pfc_execute_code as the task cycles. For synchronous, inline execution, use pfc_execute_code directly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry_script | Yes | Absolute path to entry Python script in PFC workspace | |
| description | Yes | Brief task purpose |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||