Qmaster is the central application within a Grid Engine installation.
A running instance of this application controls the overall behavior of
a whole Grid Engine cluster.
This process holds the most current data about states of jobs, queues and other necessary objects. Data persistence is secured by the qmaster daemon. Objects are spooled to a filesystem before the user gets a confirmation about requested changes. Every daemon and client application which is interested in information about a specific object has to ask the qmaster daemon. Communication with qmaster is possible via the Grid Engine Database Interface (GDI )
Qmaster interoperates with the scheduler daemon schedd
for the task of assigning suitable resources (hosts, queues) to jobs waiting
for execution.
Schedd gets all its information from the qmaster via an event driven
update protocol utilizing the GDI. Once schedd has determined an assignment
of jobs to queues, qmaster will get notified via a list of so called "orders",
which is again a GDI-based communication.
Such a job execution order will result in the action, that qmaster sends the corresponding job to the execution daemon execd of the selected host. This execd will start with the execution of the job. The current status of a job or a host again will be reported to qmaster by execd using the GDI.
One of the core tasks of qmaster is to implement the framework which handles incoming GDI requests. The most important part of this framework is the array gdi_object[]. Its elements contain the same constants used to identify GDI requests, and function pointers describing which functions serve a particular request.
When a client request arrives at qmaster it will pass through several steps. Information from the gdi_object[] array will be used as necessary. The following explains the steps being processed in the example of a modify request of a Checkpointing object. Please find all function definitions and constants mentioned below in source/libs/gdi/sge_gdi.h and source/daemons/qmaster/sge_c_gdi.c.
sge_c_gdi_mod() identifies the type of the object which should be modified (SGE_CKPT_LIST). It calls sge_gdi_add_mod_generic().
sge_gdi_add_mod_generic() looks up the following
three function pointer entries in gdi_object[] and executes them in the
right order:
a function which will spool the changed object to a corresponding file, and
a function which will be called after the object was successfully modified.
During the previous steps, lists will be filled with answer messages
sent to the client before the request is completely finished.
After startup, Qmaster enters its main loop where itStart a Commd process when none is running.Connect to Commd.Prevent that other Qmaster processes can start up successfully.Read Qmasters configurationRead all spooled GDI objects from the filesystem
You can find the implementation of the main loop in the main() function in source/daemons/qmaster/qmaster.caccepts GDI requestsgets reports from Execdsanswers acknowledge requests