DIANE2 Ganga integration

Currently Ganga is only used as a worker agent submission framework. Master is always run locally (as a ganga job?).

Overview

DIANE worker agents are mapped to Ganga jobs by the submitter scripts and callback functions in the application and user run-scripts via a generic and well-defined mechanism.

A submitter script decides to which Ganga backends the agents are submitted. For example a classical LCG submitter would submit to LCG backend (using possibly bulk splitting Ganga features). Additional parameter CELIST would specify file defining a round-robin list of CEs.

Just before being submitted the Ganga job object is passed for additional processing first to the appropriate callback functions in the application run script and then to the user run script. This allows to modify certain aspects of the worker agent job without modifying the submitter script e.g. on per-run basis. For example:

  • worker agent wrapper script may be modified by the application to properly set-up the environment
  • extra input files may be specified by the user
  • a ganga job name may be added by the user for book-keeping

Note, that in general the backend and splitter properties of the job should not be modified by the user or by the application run-scripts.

Submitter scripts

Submitter script is a Ganga GPI script which is integrated in the DIANE environment in order to automatically get correct parameters for the worker agent jobs such as master address, directory service options etc.

The submitter script is required to handle a number of long options which names begin with diane- and which are reserved and should not be (re-)defined by the submitter script. The generic syntax for submitter command line options:

submitter --diane-run-file=RUNFILE --diane-master=MASTERLOC --diane-worker-number=N [other-opts]

RUNFILE: the file containing the run description (c.f. diane-run)
MASTERLOC: address of the master i.e. the local master ID (integer) or is a URL which contains the CORBA master OID or the CORBA master OID itself.
N: number of worker agents to be submitted

A user may run the submitter script directly (ganga LCG ...) if he wants to manually add more workers after the run has been started. However more frequently the submitter scripts are executed automatically by diane-run command. Arbitrary options and arguments may be passed to the submitter script. A number of default submitter scripts is provided with diane, however advanced user may plug in his own submitter scripts.

DIANE defines a few helper functions and classes for writing the submitter scripts. The hypothetical example of LCG submitter script:

#/usr/bin/env ganga
#-*-python-*-

# import the helper class which interfaces us to the DIANE environment
from diane.submitter import submitter

prog = submitter()
prog.parser.addOption(...) # add submitter-specific options here

prog.initialize() # parse command line parameters

CELIST = file(prog.parser.CELIST).readlines()

for i in range(prog.N_WORKERS):
 j = Job()
 j.application = DIANEWorkerAgent()
 j.backend = LCG()
 j.backend.CE = CELIST[i%len(CELIST)]
 prog.submit_worker(j) # this will pass the j object to the application and user-level for further processing and eventually submit the job

Run-script submission callbacks

The worker_submit(j) function may be defined in user-run script or in the application package (next to rundef() callback). The submitter script will call worker_submit(j) functions (first the application one) just before the worker agent is submitted.

The submitters are free to optimize the submission by using split jobs. In this case the =worker_submit()=callback gets only the master job as argument.

Ganga plugins

DIANEWorkerAgent is the application plugin which defines the following attributes which must be resolved statically before the worker is submitted:

  • scriptlets (shell text which is used to construct the shell wrapper script)
    • worker_begin: empty by default
    • worker_run: diane-start-worker
    • worker_end: empty by default
  • args: as in Executable (--diane-download option )

In Ganga config the following scriptlets are defined:

    • worker_setup: default setup procedure will download diane locally if --diane-download option is given to the wrapper script, else it will use the local installation

Note: if application worker servlets are requested by the master, then the following scriplets are sent dynamically as a part of the application configuration:

  • application_servlet_begin: empty by default
  • application_servlet_end: empty by default

See also: DIANE2WorkerEnvironment

Ganga environment

When DIANE environment is setup, GANGA_CONFIG_PATH is set to $DIANE_TOP/GangaDIANE/DIANE.ini config file and Ganga itself is put in the PATH.

-- JakubMoscicki - 17 Dec 2007

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2007-12-17 - JakubMoscicki
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    ArdaGrid All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback