CMS 3D CMS Logo

Public Member Functions

cmsDriver::forkit Class Reference

Inherits threading::Thread.

List of all members.

Public Member Functions

def __init__
def run

Detailed Description

Definition at line 9 of file cmsDriver.py.


Constructor & Destructor Documentation

def cmsDriver::forkit::__init__ (   self)

Definition at line 10 of file cmsDriver.py.

00011                       :
        Thread.__init__(self)

Member Function Documentation

def cmsDriver::forkit::run (   self)

Definition at line 12 of file cmsDriver.py.

00013                  :
00014         import sys
00015         import os
00016         import Configuration.PyReleaseValidation
00017         from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder, defaultOptions
00018         from Configuration.PyReleaseValidation.cmsDriverOptions import options, python_config_filename
00019         
00020         # after cleanup of all config parameters pass it to the ConfigBuilder
00021         configBuilder = ConfigBuilder(options, with_output = True, with_input = True)
00022         configBuilder.prepare()
00023         
00024         # fetch the results and write it to file
00025         if options.python_filename: python_config_filename = options.python_filename
00026         config = file(python_config_filename,"w")
00027         config.write(configBuilder.pythonCfgCode)
00028         config.close()
00029 
00030         # handle different dump options
00031         if options.dump_python:
00032             result = {}
00033             execfile(python_config_filename, result)
00034             process = result["process"]
00035             expanded = process.dumpPython()
00036             expandedFile = file(python_config_filename,"w")
00037             expandedFile.write(expanded)
00038             expandedFile.close()
00039             print "Expanded config file", python_config_filename, "created"
00040             sys.exit(0)           
00041   
00042         if options.no_exec_flag:
00043             print "Config file "+python_config_filename+ " created"
00044             sys.exit(0)
00045         else:
00046             commandString = options.prefix+" cmsRun"
00047             print "Starting "+commandString+' '+python_config_filename
00048             commands = commandString.lstrip().split()
00049             os.execvpe(commands[0],commands+[python_config_filename],os.environ)
00050             sys.exit()