pyphi.mcp.server.configure_parallel#

pyphi.mcp.server.configure_parallel(enable=None, levels=None, workers=None, reset=False)[source]#

Read or set the server’s parallelization configuration.

Settings persist for the life of the server process; a per-call analyze(parallel=...) argument takes precedence for that call. With no arguments, reports the current state without changing anything.

Parameters:
  • enable (bool, optional) – true opens the global gate and switches on levels (or the recommended set — "partitions", "purviews", "distinctions" — when levels is omitted), switching every other level off. false closes the global gate, which disables all parallelism regardless of the per-level flags.

  • levels (list of str, optional) – The levels to switch on: "partitions", "purviews", "distinctions", "complexes", "mechanism_partitions", "relations", "macro_systems". Implies enable=true. Read get_iit_reference("parallelization") for which levels pay off for which workloads.

  • workers (int, optional) – Worker-process count (-1 = all cores). On its own, changes only the worker count.

  • reset (bool) – Restore every parallelization option to PyPhi’s defaults (all parallelism off), ignoring the other arguments.

Returns:

dict – The resulting configuration: the global gate, worker count, backend, and each level’s flag and sequential threshold.

Return type:

dict[str, Any]