General Description of the TCE Development Tree


The TCE code is organized similarly to the code of the MOVIE system. All source files are grouped into directories. All directories, except those with header files only, have their own makefiles. A local to directory makefile produces an object file for each C source file. All objects from a directory are than linked into a single object file which is named after the directory name. For example all object files from Src/Lib/io are linked into the Src/Lib/io/io.o file. Then a higher level make links those grouped objects into another composite object, and so on.

A single C source file contains usually only one C function. In some cases a file can contain more functions, which are considered as "helpers" to the main function.

Different directories contain files which implement a distinct functionality. The Src directory is the root of the TCE development tree. Here is a general description of all other directories.

Src/Obj - contains definition of all data structures and the TCE composite types. There are only C header files there Implementation of methods for those types can be found in Src/Type directory.

Src/Def - a directory where all constants and primitive TCE data types are defined (header files only).

Src/Fcn - files in this directory contain globally defined TCE structures and variables together with fundamental, used by all other modules functions. For example in this directory functions for memory management can be found.

Src/Type - it is a composite directory, which contains subdirectories. In each of the subdirectories an implementation of functionality for a given TCE composite type (defined in Src/Type/Bead - functions operating on Bead structure (mainly used for queues).

Src/Type/Cache - functions for caching different instances of TCE types

Src/Type/CharBuff - various operations on strings

Src/Type/Chn - channel functions

Src/Type/ChnSet - functions for sets of channels

Src/Type/Queue - operations on queues

Src/Type/Domain - implements network organization of TCE processes

Src/Type/Msg - operations on message headers

Src/Type/Tuple - implementation of Linda-like tuples

Src/Type/NetNode - operations on a dynamic structure used to describe network nodes

Src/Type/Port - functions for TCE ports

Src/Type/Sem - functionality for TCE semaphores

Src/Type/Server - functions for TCP based network interactions

Src/Type/Thread - all functionality concerning the management of TCE threads

Src/Type/TupleSpace - implementation of Linda-like tuple spaces

Src/Lib - is a composite directory. These subdirectories have files which refer to a single, specific instance of a particular TCE type or deal with different unique aspects of an underlying architecture. For example there is a directory Src/Lib/scheduler where functions implementing the scheduler structure are placed - since there is only one instance of this type for a TCE process, these functions are placed in Lib instead of Type. Likewise, there are directories net and mimd, both have files which deal with communication, but the first directory has the implementation for the TCP network and the other one for MIMD parallel machines (currently only CM5 is there).

Src/Lib/chn - functions maintaining the global table of channels

Src/Lib/chnset - functions maintaining the global table of channel sets

Src/Lib/clock - services related with the clock signal (interrupt)

Src/Lib/domain - functions responsible for the current network domain

Src/Lib/interrupt - functions implementing interrupt services for the TCP net.

Src/Lib/io - reading and writing functions for sockets

Src/Lib/mask - set of primitives to manipulate descriptor masks

Src/Lib/mimd - communication routines for MIMD parallel machines

Src/Lib/net - communication routines for TCP/IP based machines

Src/Lib/port - functions maintaining the global table of ports

Src/Lib/scheduler - scheduling functions

Src/Lib/server - network routines for the local TCE process (server)

Src/Lib/signal - operations on various Unix signals

Src/Lib/socket - low level socket functions

Src/Lib/thread - routines for two standard TCE threads (main and idle threads)

Src/Lib/time - functions for measuring the system and user time

Src/Lib/timeout - routines implementing timeouts

Src/Lib/tty - functionality for dealing with stdin and stdout

Src/Lib/user - functions supplying info about the user environment

Src/Lib/xdr - XDR conversion between different data representations

Src/qt - directory contains only headers of the QuickThread package - on top of which TCE is build

Src/tce - all files in this directory are the TCE interface calls. The whole functionality of my package is accessible through them.

The discussed mapping of the overall functionality onto the directory tree is also visible at the level of function names. The function (macro) name is composite - the first part is either "s","o" or "TCE". The letter "s" stands for system and it shows that the names represents a function or a macro in either Fcn or Lib directory. The latter "o" stands for object and identifies that the named function has to be in one of the subdirectories of Type. The "tce" part says that it is an interface function in tce . In the case of the system or object functions, the next part shows in which directory in Lib or Type the function is stored. For example the s_server_init name says that the init function is in the Src/Lib/server/init.c and o_thread_create that the function that creates a thread is in Src/Type/Thread/create.c. When there is more than one externally visible functions within one file, their names are started with "_". _s_net_receive_REG says that the function is placed in the Src/Lib/receive_REG.c file and that there is more than one, externally visible, functions in that file. In most cases, the undescore is used for split-phase operations - functions called by the TCE interfaces and the network interace. For instance s_net_receive_REG is invoked from o_chnset_receive as a result of calling tce_chn_rcv, while _s_net_receive_REG is called from s_io_read which reads a message from the TCP-based network.