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.
On every node, call _Rts_InitRts to initialize the runtime system before transferring control to MultipolMain.
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.
The top-level scheduler terminates when _Rts_haltFlag is non-zero. _Rts_haltFlag should be set by _Rts_exit only.
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.
Initialize the runtime system variables and register the default initialization routines using Rts_registerInit.
Poll the network to service incoming messages.
Turn on/off network interrupt.
The current version assumes a polling network interface, so these two primitives do nothing.
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.
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.
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.
Same as _Rts_fastIRP, except that _Rts_fastIRP4 is used for Rts_invokeRemoteThread_4.
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.
Return the current time in seconds.