Description

Description

On a hostless architecture, the program entry function main() that executes on every processor calls _Rts_InitRts() to initialize the runtime system and then transfer control to MultipolMain. On a host-node architecture, the main() function executing on the host processor must fork all the node processes to perform the above steps. _Rts_InitRts calls _RTs_configure, which initializes the runtime system constants and registers a few default initialization routines using Rts_registerInit. Finally, when the program calls Rts_exit, the runtime system calls _Rts_exit to notify all top-level schedulers for termination.

To port Multipol to a new machine <arch>, the user must provide implementation of the C interface in the directory src/Rts/<arch>. Those with the prefix _Rts are called by the runtime system only - The library or application programmer should not be aware of their existence. The user also needs to provide a machine-dependent makefile in src/Rts/<arch> for compiling, linking, and executing the code.

For an example, see the Sun workstation port in src/Rts/sun.

main

On every node, call _Rts_InitRts to initialize the runtime system before transferring control to MultipolMain.

Rts_numProc, Rts_myProc

The number of processors and the identity of the local processor (ranging from 0 to Rts_numProc - 1), respectively. They are initialized in _Rts_configure.

_Rts_haltFlag

The top-level scheduler terminates when _Rts_haltFlag is non-zero. _Rts_haltFlag should be set by _Rts_exit only.

_Rts_networkPackets, _Rts_storeOps, _Rts_putOps, _Rts_getOps

Variables that store statistics about the communication layer. They are initialized to 0 in _Rts_configure, and incremented by their corresponding communication primitives during execution.

_Rts_configure

Initialize the runtime system variables and register the default initialization routines using Rts_registerInit.

_Rts_pollNetwork

Poll the network to service incoming messages.

_Rts_interruptOn, _Rts_interruptOff

Turn on/off network interrupt.

Known bugs

The current version assumes a polling network interface, so these two primitives do nothing.

_Rts_syncAllProcs

Perform a barrier synchronization of all processors in the system. _Rts_syncAllProcs block the calling processor until the barrier completes. It must be called by all processors.

_Rts_store, _Rts_store1, _Rts_put, _Rts_get

Same as Rts_Store, Rts_Store1, Rts_Put, and Rts_Get, except that the global pointers are broken into proc and putAddr/getAddr, and the messages are not aggregated.

_Rts_fastIRP

Skip the runtime system message layer (which automatically aggregate messages) and perform Rts_invokeRemoteThread. For example, on the CM5, remote threads with a few word arguments can usually be sent as active messages for efficiency. Return OK when the message can be sent efficiently. Otherwise, do nothing and return FAIL.

_Rts_fastIRP_4

Same as _Rts_fastIRP, except that _Rts_fastIRP4 is used for Rts_invokeRemoteThread_4.

_Rts_exit

Set the variable _Rts_haltFlag to 1 on all processors. It is typically done by sending active messages to all processors. These messages must be guaranteed delivery as long as the processors poll the network periodically.

_Rts_getTimeCoarse

Return the current time in seconds.



Chih-Po Wen
Wed Sep 13 23:59:55 PDT 1995