Skip to content

Execution Backends

MoreMaps.jl provides multiple execution backends to suit different computational needs, from simple sequential execution to distributed computing across multiple machines.

All backends are subtypes of MoreMaps.Backend and are interchangeable: just pass an instance (or the bare type) to a Chart.

MoreMaps.Sequential Type
julia
Sequential()

A backend for sequential (single-threaded) execution. Maps one-at-a-time over elements of an array, in order Sequential is the default Chart backend.

Best for:

  • Small arrays

  • Operations with minimal computational cost

  • Debugging and development

Usage

julia
julia> using MoreMaps

julia> C = Chart(Sequential())
Chart{MoreMaps.All, Sequential, NoProgress, NoExpansion}(Sequential(), NoProgress(), NoExpansion())

julia> C = Chart() # Defaults to `Sequential`
Chart{MoreMaps.All, Sequential, NoProgress, NoExpansion}(Sequential(), NoProgress(), NoExpansion())

julia> data = [1, 2, 3, 4, 5];

julia> result = map(x -> x^2, C, data)
5-element Vector{Int64}:
  1
  4
  9
 16
 25


julia> nested_data = [[1, 2], [3, 4], [5, 6]]; # Works with nested arrays

julia> C_nested = Chart(Vector{Int}, Sequential());

julia> result = map(sum, C_nested, nested_data)
3-element Vector{Int64}:
  3
  7
 11

See also: Threaded, Chart

source