RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • codistributed
    • codistributed.build
    • codistributor
    • codistributor1d
    • codistributor2dbc
    • distributed
    • fetchNext
    • fetchOutputs
    • gcat
    • gcp
    • getCodistributor
    • getCurrentJob
    • getCurrentTask
    • getCurrentWorker
    • getLocalPart
    • globalIndices
    • gop
    • gplus
    • iscodistributed
    • isComplete
    • labBarrier
    • labBroadcast
    • labindex
    • labProbe
    • labReceive
    • labSend
    • labSendReceive
    • numlabs
    • parfeval
    • parfevalOnAll
    • parpool
    • redistribute
    • spmdBarrier
    • spmdBroadcast
    • spmdCat
    • spmdIndex
    • spmdPlus
    • spmdProbe
    • spmdReceive
    • spmdReduce
    • spmdSend
    • spmdSendReceive
    • spmdSize

codistributor2dbc — Create a two-dimensional block-cyclic distribution description.

codistributor2dbc describes a matrix distributed in blocks across a two-dimensional worker grid.

Syntax

codist = codistributor2dbc(worker_grid, block_size, orientation, global_size)

Inputs

worker_grid
Type
Any
Required
No
Default
—
Description
Optional two-element worker grid.
block_size
Type
IntegerScalar
Required
No
Default
—
Description
Optional positive block size.
orientation
Type
StringScalar
Required
No
Default
row
Description
Worker-grid rank orientation, row or col.
global_size
Type
Any
Required
No
Default
—
Description
Optional complete matrix size.
NameTypeRequiredDefaultDescription
worker_gridAnyNo—Optional two-element worker grid.
block_sizeIntegerScalarNo—Optional positive block size.
orientationStringScalarNorowWorker-grid rank orientation, row or col.
global_sizeAnyNo—Optional complete matrix size.

Returns

result
Type
Any
Description
Result produced by the parallel operation.
NameTypeDescription
resultAnyResult produced by the parallel operation.

Errors

RunMat:parallel:LoweringRequired
When
The operation is invoked without an active compiler-owned SPMD or distributed execution context.
Message
parallel operation requires executor-aware lowering
IdentifierWhenMessage
RunMat:parallel:LoweringRequiredThe operation is invoked without an active compiler-owned SPMD or distributed execution context.parallel operation requires executor-aware lowering

Behavior

A codistributor is an immutable distribution description. A one-dimensional description records a distribution dimension, one partition length per worker, and an optional global size. A two-dimensional block-cyclic description records a worker grid, block size, row- or column-major grid orientation, and an optional global matrix size.

Constructors may leave properties unresolved. The distribution service resolves omitted values against the array shape and admitted worker count when a distributed value is created or redistributed. Declared partition lengths, grids, dimensions, and global sizes must agree at that boundary.

Codistributor objects contain exact integer structural values. They describe placement but do not own partition payloads, a pool generation, or accelerator buffers.

Execution placement

Constructing or inspecting a codistributor is local and does not launch workers. Distribution begins only when an operation such as codistributed or redistribute resolves the description against a pool.

Examples

Describe a complete block-cyclic matrix layout

codist = codistributor2dbc(uint32([2 2]), uint64(1), "col", uint64([4 4]))

Expected output:

a 2-by-2 column-oriented worker grid with unit blocks

Use row-oriented worker-grid numbering

codist = codistributor2dbc(uint32([1 2]), uint64(8))

Expected output:

Orientation is row

Using codistributor2dbc with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how codistributor2dbc changes the result.

Run a small codistributor2dbc example, explain the result, then change one input and compare the output.

FAQ

Does construction start a pool?⌄

No. A codistributor is a local immutable description; distribution resolves it against a pool later.

What makes a codistributor complete?⌄

Its GlobalSize property is present and valid. Other properties may still be resolved or validated when used.

Are dimensions and partitions stored as doubles?⌄

No. Structural properties use exact unsigned integer values.

Can a codistributor be reused?⌄

Yes when its declared shape and layout are valid for the target array and admitted worker count.

Related Parallel functions

codistributed · codistributed.build · codistributor · codistributor1d · distributed · fetchNext · fetchOutputs · gcat · gcp · getCodistributor · getCurrentJob · getCurrentTask · getCurrentWorker · getLocalPart · globalIndices · gop · gplus · iscodistributed · isComplete · labBarrier · labBroadcast · labindex · labProbe · labReceive · labSend · labSendReceive · numlabs · parfeval · parfevalOnAll · parpool · redistribute · spmdBarrier · spmdBroadcast · spmdCat · spmdIndex · spmdPlus · spmdProbe · spmdReceive · spmdReduce · spmdSend · spmdSendReceive · spmdSize

Related guides

  • Parallel execution

Source you can read

Every RunMat function's source is public. Read exactly how codistributor2dbc is executed, line by line, in Rust.

  • View the source for codistributor2dbc in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Behavior
  • Execution placement
  • Examples
  • Describe a complete block-cyclic matrix layout
  • Use row-oriented worker-grid numbering
  • Using codistributor2dbc with coding agents
  • FAQ
  • Related Parallel functions
  • Related guides
  • Source you can read
  • About RunMat