Next: Task-mapping functions, Previous: Log-file functions, Up: Run-time library functions [Contents][Index]
Randomness appears in various forms in the coNCePTuaL language,
such as when assigning a task to
A RANDOM PROCESSOR
(see Reordering task
IDs) or when let-binding A RANDOM TASK
or A RANDOM TASK OTHER
THAN
a given task ID to a variable (see Binding variables).
The following functions are used to select tasks at random.
coNCePTuaL currently uses the Mersenne Twister as its random-number
generator. Hence, given the same seed, a coNCePTuaL program will
see the same random-number sequence on every platform.
Initialize the random-number generator needed by ncptl_random_task()
. If
seed is zero,
ncptl_seed_random_task()
selects an arbitrary seed value.
ncptl_seed_random_task()
returns the seed that was used. procID specifies the
(physical) processor ID of the calling task and is needed to seed
the task-local random-number generators used by some of the
functions in
Language-visible functions.
Return a randomly selected task number from lower_bound to upper_bound (both inclusive). If excluded is nonnegative then that task number will never be selected, even if it’s within range.