matlab-setup-worker-state

Installation
SKILL.md

Set Up Worker State for Parallel Pools

By default, process workers in a parallel pool inherit MATLAB path state from their controlling client, but they do not inherit loaded libraries, open connections, or expensive pre-computed objects. Code that relies on any of these needs explicit setup. This skill teaches the correct APIs for each scenario. Most patterns target process-based pools; thread pool applicability is noted where relevant.

When to Use

  • Code needs a non-serializable resource on workers (database connections, COM objects, loaded shared libraries, file handles)
  • Code needs expensive one-time setup per worker (large object construction, data loading) that should not repeat every parfor iteration
  • Code needs paths or environment variables set on workers
  • User has existing code using spmd for side-effect setup before parfor (anti-pattern — help them modernise)
  • User sees errors about objects not being serializable when passed to parfor
Installs
10
GitHub Stars
692
First Seen
Jun 8, 2026
matlab-setup-worker-state — matlab/matlab-agentic-toolkit