Appendix A - The System in operation / process description

A.1 Introduction

The operation of this system is in three parts. The name service starts first because the master and slave are dependent upon it when they start. Master needs to be started next reading in the Makefile for the task to be done. The Slave starts last processing the work to be done.

A.2 System operation

A.2.1 Name Service

The Name Service is started by:

[torri@localhost torri]$ start nameserv

The Name Service prints out the output of its connections because the ooc.orb.trace.connections is set to the value of 1. The output you see from the terminal window is:

[torri@localhost torri]$ start nameserv
[ incoming: accepting connections
  id: TAG_IIOP
  local address: 0.0.0.0:5000
  hosts: 127.0.0.1 ]

When the host, the master for example, connects to the Name Service on startup you could see the following:

[ incoming: new connection
  id: TAG_IIOP
  local address: 127.0.0.1:5000
  remote address: 127.0.0.1:1031 ]
[ incoming: new connection
  id: TAG_IIOP
  local address: 127.0.0.1:5000
  remote address: 127.0.0.1:1032 ]
[ incoming: closing connection
  id: TAG_IIOP
  local address: 127.0.0.1:5000
  remote address: 127.0.0.1:1031 ]
[ incoming: closing connection
  id: TAG_IIOP
  local address: 127.0.0.1:5000
  remote address: 127.0.0.1:1032 ]

Unfortunately as it stands with CORBA there is no method for display what is actually occurring (e.g. what remote procedure call is being made against the name service). The same is true for the master and the slave. The connections can be traced but there is no general method available.

A.2.2 Master

The master can be used in two modes. The first mode is normal mode. In this mode the program will not display any information to the screen. Its progress can only be monitored through the output on the slaves. The second mode is debugging mode. This mode displays very detailed information about what is happening internally. To switch between the modes requires that the entire project be recompiled. In the future a simple flag used on start the master might be more appropriate for controlling the level of output.

Here is a typical output on starting a project:

[torri@localhost automake]$ start master
Master_impl::initialize - Entered initialize
Master_impl::initialize - resolve_initial_references('NameService')
Master_impl::initialize - naming_context -> bind_new_context
Master_impl::initialize - naming_context -> rebind
Master_impl::readMakefile - Command: set fnord n; amf=$2; \
Job_List::addJob - basedir = /home/torri/src/automake
Job_List::addJob - command = set fnord n; amf=$2; \
Job_List::addJob - directory = /home/torri/src/automake
Job_List::addJob - adding node to list
Job_List::addJob - temp_node is not NULL
Job_List::addJob - temp_node->prev = head
Job_List::addJob - list_size++
....
Master_Impl::readMakefile - Job Queue size: 29

The previous text showed master starting in the directory for the GNU program automake. The output would continue until all the output of "make -nW Makefile" as added to the Job Queue. The Job Queue is another name for the Job List. When the slave starts, the output from the master will be:

...
Master_impl::registerSlave - Entering Register Slave
Slave_List::addSlave - entered addSlave
Slave_List::addSlave - adding node to list
Slave_List::addSlave - temp is not NULL
Slave_List::addSlave - temp -> prev = head
Slave_List::addSlave - size++
Master_impl::registerSlave - Added slave to slave service
Overseer::awaken - Overseer awakened.
(*** Note: Overseer gets free slave. Slave move from free list to busy list)
Slave_List::addSlave - entered addSlave
Slave_List::addSlave - adding node to list
Slave_List::addSlave - temp is not NULL
Slave_List::addSlave - temp -> prev = head
Slave_List::addSlave - size++
Overseer::awaken - jobs_ is not 0. Work to be done.
Overseer::awaken - get next Job
Job_List::removeJob - list_size--
Job_List::getJob - command = set fnord n; amf=$2; \
Job_List::getJob - directory = /home/torri/src/automake
Job_List::getJob - comment = false
Overseer::awaken - nextJob.command = set fnord n; amf=$2; \
Overseer::awaken - nextJob.directory = /home/torri/src/automake
(*** Note: At this point the job has been sent to the slave).

A.2.3 Slave

The slave starts by:

[torri@localhost torri]$ start slave

The slave also has two mode exactly like the master, normal and debugging. The project must be recompiled to switch between the modes. The following output is from the slave starting with debugging enabled:

slave.cpp:main - Resolved RootPOA
slave.cpp:main - Activated POAManager
slave.cpp:main - initializing slave
Slave_impl.cpp::initialize - Entering initialize
Slave_impl::initialize - slv [OK]
Slave_impl::initialize - slv_var [OK]
Slave_impl::initialize - slv == slv_var [OK]
Slave_impl::initialize - registered with NameService
slave.cpp:main - finding location of master
Slave_impl::findMaster - Entering findMaster
Slave_impl::findMaster - Found the Master reference
slave.cpp:main - registering with master
Slave_impl::registerSlave - Entering local registerSlave method
Slave_impl::registerSlave - slv_var [OK]
Slave_impl::registerSlave - master reference is not nil.
  Calling registerSlave on master reference
Slave_impl::send_command - Entering send_command
Slave_impl::send_command - directory = /home/torri/src/automake
Slave_impl::send_command - command = set fnord n; amf=$2; \
Job_List::addJob - entering addJob
Job_List::addJob - command = set fnord n; amf=$2; \
Job_List::addJob - directory = /home/torri/src/automake
Job_List::addJob - adding node to list
Job_List::addJob - temp_node is not NULL
Job_List::addJob - temp_node->prev = head
Job_List::addJob - list_size++
Slave_impl::registerSlave - Registered slave with master reference (Comms::Master_ptr m_ptr)
slave.cpp:main - starting Job Process thread
Slave_impl::startJobProcess - mstr_ptr [OK]
Slave_impl::startJobProcess - slv_var [OK]
Slave_impl.cpp::startJobProcess - starting thread
Job_Process::run - Entering run
Job_Process::run - Waiting for jobs
Job_List::waitForJob - Entering waitForJob
Job_List::waitForJob - Job List has work
Job_List::waitForJob - list size is 1
Job_Process::run - Getting job
Job_List::removeJob - list_size--
Job_List::getJob - command = set fnord n; amf=$2; \
Job_List::getJob - directory = /home/torri/src/automake
Job_List::getJob - comment = false
Job_Process::run - Directory: /home/torri/src/automake
Job_Process::run - Command: set fnord n; amf=$2; \
Job_Process::run - Present directory is /home/torri/src/automake
set fnord n; amf=$2; \
sh: -c: line 2: syntax error: unexpected end of file
Job_Process::run - FAILURE

The slave stopped because it could not handle the command sent to it. This is an example where the slave did attempt to execute the command but it failed. From careful observation it is noted that the command is not complete because it has the '\' character at the end which indicates a multi-lined shell command. In the future this will have to be remedied.


 
Previous: Chapter 6 - Conclusions Home References