Write typed numerical output regions
Give each task a checked output region, preserve Float32 results and inspect complete immutable output in iteration order.
import aner.parallel
// Each realization writes its own [step, metric] region. The input snapshot
// is shared read-only across tasks, while local simulation state stays private.
fn simulate(parameters: List, iteration: Int64, seed: Int64,
output: OutputRegion<Float32>) -> Unit {
let input = cast<FrozenArray<Float32>>(parameters.get(0))
var state = input[iteration % input.len()]
var step = 0
while step < 8 {
state = state + Float32(0.25)
output[step, 0] = state
output[step, 1] = Float32(iteration)
step += 1
}
}
let input = Array<Float32>(4, Float32(1.0)).snapshot()
let history = parallel.repeat(iterations: 1000, task: simulate,
parameters: List(input), output_shape: List(8, 2), seed: 2026)
print(type_of(history)) // OutputResults<Float32>
print(history.shape()) // List(1000, 8, 2)
print(history[999, 7, 0]) // 3.0
print(history.value(999, 15)) // 999.0: flat column within one region
print(history.bytes()) // 64000 packed payload bytes
print(history.summary()) // Includes coverage/control and input accounting
Make it your experiment.
With Aner 0.0.3 or newer installed, save this program as examples/parallel/repeat_output.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/parallel/repeat_output.aner
aner run examples/parallel/repeat_output.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires Aner 0.0.4 or newer. This complete example runs locally with synthetic numerical inputs and no external files, service or credentials. The guide describes memory limits and optional cluster setup separately.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution