Ex4pmEngine.Bench.VirtualCost (ex4pm v26.9.9)

Copy Markdown View Source

Real virtual-cost counter for distributed-engine topology benchmarks.

Tracks Hardware-Interaction-Instructions-style operation counts — :compute, :store, :send — as plain non-negative integers. This is not a wall-clock timer: it is an explicit, real, incrementable counter that benchmark code calls at each real operation site (one increment per real local computation step, one per real write to an accumulator/store, one per real inter-process message sent), so the resulting totals reflect actual operations performed during a real run, not an estimate.

Summary

Functions

Increment the :compute counter by n (default 1).

Merge two counters by summing each field. Used to combine per-process counters.

A fresh zeroed counter.

Increment the :send counter by n (default 1).

Increment the :store counter by n (default 1).

Sum a list of counters into one total.

Total operation count across all three dimensions.

Types

t()

@type t() :: %Ex4pmEngine.Bench.VirtualCost{
  compute: non_neg_integer(),
  send: non_neg_integer(),
  store: non_neg_integer()
}

Functions

compute(c, n \\ 1)

@spec compute(t(), pos_integer()) :: t()

Increment the :compute counter by n (default 1).

merge(a, b)

@spec merge(t(), t()) :: t()

Merge two counters by summing each field. Used to combine per-process counters.

new()

@spec new() :: t()

A fresh zeroed counter.

send_op(c, n \\ 1)

@spec send_op(t(), pos_integer()) :: t()

Increment the :send counter by n (default 1).

store(c, n \\ 1)

@spec store(t(), pos_integer()) :: t()

Increment the :store counter by n (default 1).

sum(counters)

@spec sum([t()]) :: t()

Sum a list of counters into one total.

total(virtual_cost)

@spec total(t()) :: non_neg_integer()

Total operation count across all three dimensions.