Execd - the execution daemon

The Execution Daemon (execd) is the instance in Grid Engine that
  • starts jobs.
  • controls jobs, e.g. can suspend / unsuspend a job, reprioritize the processes associated with a job, etc.
  • gathers information about jobs, e.g. resource usage, exit code etc.
  • gathers information about the execution host it controls, e.g. load, free memory, etc.
  • There is one execd on each host of a cluster.

    Process flow

    When execd starts up, the following actions are taken: After startup, execd enters its main loop where it

    PDC - the Portable Data Collector

    The PDC is a module inside the execd that collects information about running jobs like CPU usage, memory consumption, etc.

    Data is collected for all processes of a job on the basis of a criterion unique to a job. On Systems that support some sort of jobid for a hierarchy of processes, this jobid is used. On all other systems, an additional user group id (gid) is created on behalf of each job and then used.

    The jobid / additional group id is attached to the root process of a job and is inherited by its child processes.

    The PDC is implemented in source/daemons/pdc.c.

    PTF - the Priority Translation Facility

    In SG3E mode, Grid Engine has the feature of a share-based scheduler (product mode sgeee). Each job gets a certain share of the system resources.

    There exist different mechanisms (policies) to assign shares to a job. The sum of all shares for a job is expressed in so called tickets - a job has a certain number of tickets enabling it to run with certain process priorities.

    If multiple jobs are running concurrently on a host, their different share of system resources - their different number of tickets - can be mapped to priorities in the operating system.

    Setting priorities in the operating system is done by either setting the nice value for all processes of a job or by using special priority mapping facilities provided by the underlying operating system.

    Grid Engine reassigns the number of tickets per job in a regular interval. The PTF then maps the number of tickets of a job to nice values (or another operating system priority representation) and renices all processes of the job.

    Like the PDC, the PTF uses the jobid / additional group id to capture all processes of a job.

    The PTF is implemented in source/daemons/execd/ptf.c.

    Requests to execd

    Execd requests are specified by a request tag (e.g. TAG_JOB_EXECUTION).
    For incoming requests a mapping is done from a request tag to a callback function that processes the request.
    Execd accepts and processes the following requests:

    Reports from execd to qmaster

    The execd sends reports to the qmaster in a regular interval. These reports contain

    The load sensor interface

    A load sensor is a module, that retrieves any host specific values and passes them to the execd.

    The execd will report these host specific values, called load values in the following text, to the qmaster.

    The execd contains a load sensor for the common host characteristics like load, total memory, free memory, total swap, free swap etc.

    The file doc/load_parameters.asc contains a detailed description of all load values including platform dependencies.

    Load values are retrieved by the (platform dependene) function get_load_avg and get_cpu_load in the file source/libs/uti/sge_getloadavg.c.

    Memory load values are retrieved by the (platform dependent) function load_mem in file source/libs/uti/sge_loadmem.c.

    In addition, there exists an interface to integrate one or multiple external load sensors into the execd - see man page sge_conf(5).

    This is for example done to integrate license counters from licensing systems into Grid Engine or to provide additional host characteristics to Grid Engine that are not handled by the built-in load sensor.

    An external load sensor can be any executable like a binary, a shell script, a perl script ...

    It can be configured in the (host specific) cluster configuration by setting the parameter load_sensor - see man page sge_conf(5) - and is started by the execd as a child process (see function sge_ls_start_ls in file source/daemons/execd/sge_load_sensor.c).
    Multiple load sensors can be started by one execd.

    A load sensor gets commands from execd on stdin and has to report the load values on stdout. It has to implement the following protocol:

    Commands from execd

    Format of load values

    A record containing all load values provided by a load sensor may only be sent after a request from execd.

    The record is formed by

    The format for a load value is
    hostname:name:value

    Examples of load sensors are installed in the directory $SGE_ROOT/util/resources/loadsensors
    Further information on setting up loadsensors can be found at http://gridengine.sunsource.net/project/gridengine/howto/loadsensor.html
     
     

    Copyright 2001 Sun Microsystems, Inc. All rights reserved.