next up previous index
Next: Parallelism and Side Up: Controlling and Analysing Previous: Amount of Parallelism

Adding and Removing Workers

Workers in a parallel ECLiPSe session can be in one of two states: active (awake) or asleep. As one would expect, only active workers take part in any computation. A newly created worker's default state is active. New workers can be added and the number of active workers   can be altered using the worker manager interface. These actions are performed asynchronously, thus the configuration can be altered even during parallel execution: a newly added worker will join the computation and when a worker is sent to sleep, it will stop working at an appropriate point of the execution.   Note that the worker manager interface be started either using the -wmi command-line option or via the wm_set/2 builtin.

Worker management is also possible under program control. Use the builtins wm_get/2 to inquire about, and wm_set/2 to affect the worker configuration. For example, to enquire about the number of workers currently active:

[eclipse 1]: wm_get(workers(Host), Awake+Asleep).

Host = "turing"
Awake = 2
Asleep = 1
yes.

This means that the there are a total of 3 workers on the machine ``turing'', out of which 2 are active. In the above example, if one wanted to have only one worker active:

[eclipse 2]: wm_set(workers(turing),1), wm_get(workers(turing),Status).

Status = 1 + 2
yes.


next up previous index
Next: Parallelism and Side Up: Controlling and Analysing Previous: Amount of Parallelism



Micha Meier
Mon Mar 4 12:11:45 MET 1996