next up previous
Next: Futures Up: UC++: The Language Previous: Marshallers

Locating Object on Particular Machines


It is possible to locate particular active objects onto particular machines. This is done in a two stage process. In the program source the programmer can name particular objects, using a NAME() function, which is passed in after all the other parameters to a constructor call for the active object, as follows:

Worker* w = activenew_Worker(g, f, NAME("worker1"));

This names the object as worker1. Any string can be passed in to the NAME() function, including a constructed one. The NAME() function must come after any other paramters to the constructor, and all other constructor parameters must be given: the other parameters cannot be let as defaults.

The mapping from object names to particular machines then takes place in a separate file, traditionally called UCconfig. This file takes the forms of a list of object name, machine name pairs, one per line, for example:

farmer   toorak
gatherer cereal
worker0  mushroom
worker1  stanley
worker2  tomato
worker3  tooronga
worker4  ANY
worker5  ANY

the machine name ANY can be used to indicate that the choice should be left to UC++/PVM.

The particular name of the config file must be specified on the command line, using the -UCconfig parameter flag, as follows:

polygon-overlay -UCconfig /cs/research/coside/common/croissant/uc++.examples/polygon/UCconfig

where the argument to -UCconfig is an explicit and absolute pathname. Currently there is no default path or file name mechanism, though this will follow.

Note that with version PVM 3.3.10 (the latest tested backend for UC++) installed here at UCL it is sometime necessary to give just a machine name (e.g. stanley) and sometime necessary to give fully qualified name (e.g. not clear yet why this happens.

Note also that use of a config file can cause problems if it leads to certain machines becoming overloaded. Often it is better to allow PVM some leeway in choosing the best machine to put a new task on.

next up previous
Next: Futures Up: UC++: The Language Previous: Marshallers

send comments or suggestions to

Click here for more information on UCL-CS.