3.4. mpiSpecTcl initialization

Note that the code described here is in the file Core/TclGrammerApp.cpp. SpecTcl initialization in the MPI environment requires that the program:

The common and per-role initialization begins in CTclGrammerApp::AppInit() which was the application initialization function in SpecTcl prior to version 7.0. It creates a Tcl interpreter, invokes CTclGrammerApp::operator(), which does the bulk of the initialiation and then, if the process is the root process, sets up a Tcl event loop for the process which can take commands from stdin If the process is not the root process, closes the stdin Tcl channel, starts the command pump and runs an event loop. This is done in the static function setupSlaveInterpreter.

The bulk of initialization is driven by CTclGrammerApp::operator(). This is the virtual method that is considered the entry point to the SpecTcl applicatikon. It invokes a bunch of virtual methods which provide extension points for user code. Some of the methods are unconditionally invoked while others are invoked conditionally depending on the process world rank. In the subsection that follows we'll delve into the operations that are conditionally done on the basis of process role (world rank).

The emphasis is on initializations that are done in each process but not all processes and intializations that are not done in this process. The latter is important in determining if you have specialized application specific code that requires modification to run in mpiSpecTcl.

3.4.1. Root process (MPI_ROOT_RANK)

The root process:

Note that this implies there is not histogramer object in the root process. Nonetheless, dictionaries of parameter, spectrum, gates and treevariables are maintained and can be accessed via the API provided by the SpecTcl singleton class.

3.4.2. The event sink pipeline process (MPI_EVENT_SINK_RANK)

TclGrammerApp::operator() does the following for the event sink pipeline.

3.4.3. Worker processes (ranks at least MPI_FIRST_WORKER_RANK)

TclGrammerApp::operator() does the following in processes that are workers.