Top Up Prev Next Bottom Contents Index Search

2.15 Multi-domain universes

The domain of a facet is set using the pigi "Edit:edit-domain" or "d" command. This command causes a checklist to appear listing all domains currently linked into the system. All examples in the SDF Demo palette are one-domain applications, using only SDF. Several examples of multi-domain applications can be found in the DDF and DE Demo palettes. It is instructive to explore these applications, using the edit-domain command at all levels of the hierarchy to see what domains are used. In addition, the section "Wormholes" on page 12-4 in the DE chapter contains a useful discussion on mixing the DE domain with other domains in Ptolemy.

Recall that a Wormhole in Ptolemy is a block that has a different domain on the outside than on the inside. In pigi, wormholes look exactly like galaxies -- in fact, they are both just facets with ports. The only difference is that the domain is different on the inside than on the outside. Thus, whether a particular facet compiles into a plain galaxy or a wormhole depends on whether it is referenced from an outer facet of the same domain or a different domain. You get a wormhole if the domains are different.

To build multi-domain applications, it is necessary to understand the models of computation in each domain, to ensure that application will behave consistently at the domain boundaries. For this, it is necessary to refer to the domain chapters in this user's manual.

In some domains, it is possible to select one of several targets, which manage the execution of the domain in different ways. The target for a facet is set using the pigi "Edit:edit-target" or "T" command. This command causes a checklist to appear listing all targets available for the current domain. If a target is selected (rather than pushing "Cancel"), another dialog box appears containing whatever parameters the selected target may have. Both the current target selection and the parameters for it are recorded with the facet when you execute "save-window".

If "edit-target" is executed in a galaxy facet (not a universe facet), then it offers a choice labeled <parent> in addition to the target(s) for the facet's domain. This choice simply means "use the outer facet's target selection and target parameters". If you select this choice, then no target parameter dialog box appears.

The <parent> target choice is extremely important, because . If you choose anything other than <parent>, then your galaxy will always be compiled into a wormhole, so that it can have a separate target from the outer galaxy or universe. A wormhole will be created even if you have in fact selected the same domain, same target and same target parameters as in the outer facet --- pigi doesn't check. Thus, if you accidentally set the target choice to something besides <parent>, you'll end up with wormholes rather than plain galaxies. This can cause unexpected behavior, because the semantics of an XXX-in-XXX wormhole aren't necessarily the same as just embedding a galaxy into another galaxy. (DE domain, in particular, has some oddities with DE-in-DE wormholes as of this writing.) Even if the semantics are unaffected, a wormhole will be slower than a plain galaxy. So be careful to use <parent> in galaxies, unless you really intend to create a wormhole having a different target. In most cases, you only want to make specific target selections in universe facets.

Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.