Skip to content

Parallelism and vectorization (handbook)

Normative: execution surface spec.

You want In .li lic flags
Multi-core parallel for + disjoint --cores=8
SIMD inner @vectorized(lanes=8) none
Fast CI nothing lic check --workspace --jobs=8

Example 1 — MD kernel

parallel for i in 0..<N
  requires disjoint_atom(i, forces)
  decreases N - i
=
  @vectorized(lanes=4)
  for k in 0..<n_neighbors(i)
    accumulate_lj(i, k, positions, forces)
lic build md_step.li -o md_step --cores=8 --threads-per-core=1

Example 2 — Dot product (SIMD only)

@vectorized(lanes=8)
for i in 0..<N
  ...

Example 3 — Workspace (compile farm)

lic check --workspace path/to/li.toml --jobs=8 --max-memory=4096