Top Up Prev Next Bottom Contents Index Search

14.2 CGC Targets


The targets of the CGC domain generate C code from dataflow program graphs. Code generation is controlled by the host, directory, and file parameters as described in "Targets" on page 13-1. The command used to compile the code is determined by the compileCommand, compileOptions, and linkOptions parameters. Compilation and execution are controlled by the display?, compile?, and run? parameters, also described in "Targets" on page 13-1. The other parameters common to all CGC targets are listed below. Not all of these parameters are made available to the user by every target, and some targets define additional parameters.

staticBuffering (INT) Default = TRUE
If TRUE, then attempt to use static, compile-time addressing of data buffers between stars. Otherwise, generate code for dynamic, run-time addressing.
funcName (STRING) Default = main
The name of the main function. The default value of main is suitable for generating stand-alone programs. Choose another name if you wish to use the generated code as a procedure that is called from your own main program.
compileCommand (STRING) Default = cc
Command name of the compiler.
compileOption (STRING) Default =
Options passed to the compiler. The default is the empty string.
linkOptions (STRING) Default = -lm
Options passed to the linker.
resources (STRING) Default = STDIO
List of abstract resources that the host computer has.

14.2.1 Single-Processor Targets

The default-CGC target generates C code for a single processor from a SDF program graph. The parameters available to the user are shown in Table 14-1, "Parameters of the default-CGC target," on page 14-2. See "Targets" on page 13-1 and "CGC Targets" on page 14-1 for detailed descriptions of these parameters.

compile? 			file 			Looping Level
compileCommand			funcName			resources
compileOptions 			host 			run? 
directory 			linkOptions 			staticBuffering
display? 
TABLE 14-1: Parameters of the default-CGC target

The Makefile_C target compiles CGC binaries with makefiles so that compile time architecture and site dependencies can be handled. The Makefile_C target generates a small makefile that is rcp'd over to the remote machine. The generated makefile is named after the universe. If the universe is called bigBang, then the makefile will be called bigBang.mk. We name the generated makefiles so that more than one makefile can exist in the users' directory.

The generated makefile uses $PTOLEMY/lib/cgc/makefile_C.mk as a starting point, and then appends lines to it. The generated makefile includes $PTOLEMY/mk/config-$PTARCH.mk, which determines architecture and site dependencies, such as which compiler to use, or where the X11 include files are. The user may modify makefile_C.mk and add site-dependent rules and variables there. If the user wants to have site dependent include files on the remote machines, then they could add include $(ROOT)/mk/mysite.mk to makefile_C.mk, and that file would be included on the remote machines at compile time.

On the remote machine, the Makefile_C target assumes:

If the remote machine does not fulfill these constraints, then the user should use the Default_C target.

skeletonMakefile (STRING) Default=
The default value of this target parameter is the empty string, which means that we use $PTOLEMY/lib/cgc/makefile_C.mk as our skeleton makefile. If this parameter is not empty then the value of the parameter refers to the skeleton makefile to be copied into the generated makefile.
appendToMakefile (INT) Default = 1
This target parameter controls whether we append rules to the generated makefile or just copy it over to the remote machine. In the default situation, appendToMakefile is true and we append our rules after copying $PTOLEMY/lib/cgc/makefile_C.mk
The parent target of the Makefile_C target is default-CGC. If the parent target parameter compileOptions is set, then we process any environment variables in that string, and then add it to the end of the generated makefile as part of OTHERCFLAGS=. In a similar fashion, the parent target parameter linkOptions ends up as part of the right-hand side of LOADLIBES=.

The TclTk_Target target, which is derived from the Makefile_C target, must be used when Tcl/Tk stars are present in the program graph. The initial default of one parameter differs from that of the parent target.

skeletonMakefile (STRING) Default=$PTOLEMY/lib/cgc/TclTk_Target.mk
The TclTk_Target overrides this parent target parameter and sets it to the name of a skeleton makefile to be copied into the generated makefile.
The bdf-CGC target supports the BDF model of computation. It must be used when BDF stars are present in the program graph. It can also be used with program graphs that contain only SDF stars. The bdf-CGC target has the same parameters as the default-CGC target with the exception that the Looping Level parameter is absent. This is because a loop-generating algorithm is always used for scheduling. See "BDF Domain" on page 8-1 for details.

14.2.2 Multi-Processor Targets

Currently, the CGC domain supports two multi-processor targets: unixMulti_C and NOWam. The unixMulti_C target generates code for multiple networked workstations using a shared bus configuration for scheduling purposes. Inter-processor communication is implemented by splicing send/receive stars into the program graph. These communication stars use the TCP/IP protocol. In addition to the target parameters described in "CGC Targets" on page 14-1 and "Targets" on page 13-1, this target defines the user parameters listed below. Table 14-2, "Parameters of the unixMulti_C target," on page 14-4 gives the complete list of parameters for the unixMulti_C target.

adjustSchedule 			ignoreIPC 										overlapComm
amortizedComm 			inheritProcessors 			portNumber 
childType 			logFile 			relTimeScales 
compile? 			machineNames 			resources 
directory 			manualAssignment	 		run? 
display? 			nameSuffix 			sendTime 
file 			nprocs 			userCluster 
ganttChart 			oneStarOneProc 			tabular 
TABLE 14-2: Parameters of the unixMulti_C target

portNumber (INT) Default = 7654
The starting TCP/IP port number used by send/receive stars. The port number is incremented for each send/receive pair. It is the responsibility of the user to ensure that the port number does not conflict with any that may already be in use.
machineNames (STRING) Default = herschel
The host names of the workstations which form the multi-processor. The names should be separated by a comma (`,').
nameSuffix (STRING) Default =
The default is the empty string. The domain suffix for the workstations named in machineNames. If left blank, which is the default, then the workstations are assumed to be part of the local domain. Otherwise, specify the proper domain name, including a leading period. This string is appended to the names in machineNames to form the fully qualified host names.
The NOWam target uses Networks Of Workstations (NOW) active messages to communicate between machines. The NOW project is an effort to use many commodity workstations to create a building-wide supercomputer. For more information about the NOW project, see http://now.cs.berkeley.edu. Currently, the NOWam target is still experimental, and only a proof of concept. The NOWam target has the following target parameters:

machineName (STRING) Default = lucky, babbage
The host names of the workstations which form the multi-processor. The names should be separated by a comma (`,'). The NOWam target will not work on the local machines, the machines named by this parameter must be remote machines. Note that the default of this parameter differs from the default in the UnixMulti_C target.
nameSuffix (STRING) Default =
The default is the empty string. See the description of nameSuffix in UnixMulti_C above.

14.2.3 Setting Parameters Using Command-line Arguments

The pragma facility allows users to identify any parameters that the user would like to be able to change on the command line of the CGC binary. CGC command line arguments has not been extensively tested yet. Currently, it is only supported for scalar parameters with FLOAT and INT values. Also, it is only working for parameters of Stars at the top level, i.e. it will not work with Galaxies' and Universes' parameters, or parameters of Stars in Galaxies.

To specify a parameter for setting via the command-line, place the cursor over the Star and invoke the edit-pragmas command (`a'). In the dialog box, enter the name of the parameter to be made settable, follow by white space, then the name of the command-line option with which to set the parameter. This parameter /option-name pair should be entered for each of the required parameters, with pairs separated by white space.

Now, the generated program will take the new options each followed by a value with which to set the corresponding parameters. If the command-line option is not specified for a parameter, it will be initialized to its default value, which will be the value set by the edit-params command (`e'). In addition, if the `-h', `-help' or `-HELP' option is specified, the program will print the option-names corresponding to the settable parameters with their default values.



Top Up Prev Next Bottom Contents Index Search

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