Next: Processor/task mapping functions, Previous: Mesh/torus functions, Up: Built-in functions [Contents][Index]
coNCePTuaL programs can utilize randomness in one of two ways.
The functions described below are unsynchronized across
tasks. That is, they can—and usually do—return a different value to
each task on each invocation. One consequence is that these
functions are not permitted within a task expression (see Task descriptions)
because randomness would cause the tasks to disagree about who the
sources and targets of an operation are. In contrast, the A RANDOM
TASK
construct described in Binding variables
returns a value guaranteed to be synchronized across tasks and
thereby enables random-task selection.
Return a number selected at random from a uniform distribution over the range [lower_bound, upper_bound).
Return a number selected at random from a Gaussian distribution with mean mean and standard deviation stddev.
Return an integer selected at random from a Poisson distribution with mean mean and standard deviation sqrt(mean).
With the two-argument form, return an integer selected at random from a Pareto distribution with shape shape and scale scale. With the three-argument form, return an integer selected at random from a bounded Pareto distribution with shape shape and bounded by the range [lower_bound, upper_bound].