Package iceprod :: Package server :: Module job :: Class i3Job
[hide private]
[frames] | no frames]

Class i3Job

source code

Known Subclasses:

This class represents a generic job a distributed system.

Instance Methods [hide private]
 
__init__(self) source code
 
dict(self) source code
 
Prefix(self) source code
 
GetHost(self)
Get the host where this job is currently running
source code
 
SetDatasetId(self, dataset) source code
 
GetDatasetId(self) source code
 
SetHost(self, host)
Set the host where this job is currently running
source code
 
GetJobId(self)
Get the cluster AND job id for the submitted jobs.
source code
 
GetProcNum(self) source code
 
SetProcNum(self, proc) source code
 
SetJobId(self, jobid)
Set the job id for the submitted job.
source code
 
SetDatabaseId(self, db_id)
Set the database job id for the submitted job.
source code
 
GetDatabaseId(self)
Return the database job id for the submitted job.
source code
 
SetInitialdir(self, path)
Define the directory where jobs will be submitted from.
source code
 
GetInitialdir(self)
Get the directory where jobs will be submitted from.
source code
 
SetConfigFile(self, file)
Define the XML config file
source code
 
GetConfigFile(self)
Get the XML config file
source code
 
GetRootDir(self)
Get the root directory of installation
source code
 
SetRootDir(self, path)
Define the root directory of installation
source code
 
FileName(self)
Get the name of this object's serialized file
source code
 
SetOutputURL(self, url)
Define the url where data will be copied to.
source code
 
GetOutputURL(self)
Get the directory where data will be copied to.
source code
 
SetExecutable(self, executable)
Define the executable file that will be run on condor
source code
 
GetExecutable(self)
Returns: the path to the executable (if set) that will be run on cluster.
source code
 
SetPostCheckScript(self, script)
Define the executable file that will be run after job complets to check if job completed successfully
source code
 
GetPostCheckScript(self)
Returns: the path to the post run check executable (if set)
source code
 
SetMainScript(self, script_path)
Set the path to the main script to run
source code
 
GetMainScript(self)
Get the path to the main script to run
source code
 
AddArgument(self, arg)
Add a parameter to be passed to executable.
source code
 
AddEnv(self, var, val)
Add an environment variable.
source code
 
GetEnv(self) source code
 
format_arg(self, tuple)
format runtime cmdline argument
source code
 
GetArguments(self)
Returns: a list of arguments that will be passed to the executable
source code
 
AddBatchOpt(self, optname, optval)
Add a batchsystem option to use in submit script
source code
 
GetBatchOpts(self) source code
 
AddArgOption(self, optname, optval='')
Add a options to be passed to executable.
source code
 
GetArgOptions(self)
Returns: a list of options passed to the executable
source code
 
GetArgOpt(self, optname)
Get value of option to be passed to executable.
source code
 
AddInputFile(self, filename)
Add an input file that Condor is to transfer to a remote site to set up the execution environment for the job before it is run.
source code
 
AddOutputFile(self, filename)
Add an output file that the cluster is to transfer from a remote site on completion of run.
source code
 
GetInputFiles(self)
Returns: the list of input files that Condor is to transfer to a remote site to set up the execution environment for the job before it is run.
source code
 
GetOutputFiles(self)
Returns: the list of output files that the cluster is to transfer from a remote site after execution.
source code
 
SetQueue(self, nproc) source code
 
GetQueue(self)
Returns: number of jobs enqueueued
source code
 
SetLogFile(self, filename) source code
 
SetOutputFile(self, filename) source code
 
SetErrorFile(self, filename) source code
 
GetLogFile(self)
Returns: path to logfile where condor will write the state of a given job in the cluster
source code
 
GetOutputFile(self)
Returns: path to file where condor will write the output generated through stdout by the job
source code
 
GetErrorFile(self)
Returns: path to file where condor will write the output generated through stderr by the job
source code
 
SetSimDBKey(self, key)
Set the unique key for current configuration on production database
source code
 
GetSimDBKey(self)
Get the unique key for current configuration from production database
source code
 
SetSubmitHost(self, host)
Set the hostname of the submit node
source code
 
GetSubmitHost(self)
Get the hostname of the submit node
source code
 
SetStatus(self, status)
(1=enqueued,2=runnig,3=completed,4=failed)
source code
 
GetStatus(self) source code
 
SetRealTime(self, time) source code
 
GetRealTime(self) source code
 
SetUserTime(self, time) source code
 
GetUserTime(self) source code
 
SetSysTime(self, time) source code
 
GetSysTime(self) source code
 
GetPrio(self)
Get job priority
source code
 
SetPrio(self, prio)
Set job priority
source code
 
Pickle(self, filename=None)
Serialize iGrid object and write it to a file
source code
 
unPickle(self, filename)
unSerialize iGrid object and write it to a file
source code
 
Write(self, file, txt, parse=True)
Format and write string to file
source code
 
GetSteering(self) source code
 
AddSteering(self, steering) source code
 
AddParser(self, parser) source code
 
parse_params(self, src)
Replace key with value on a string.
source code
Class Variables [hide private]
  name = 'iceprod'
  executable = None
hash(x)
  params = {}
  input_files = []
  output_files = []
  mainscript = ''
  batchopts = {}
  arguments = []
  nproc = 1
  dataset_id = 0
  proc = 0
  current_time = 'Fri_Jan__4_16.44.59_2013'
  config_file = 'config.xml'
  logfile = None
hash(x)
  log = ''
  outputfile = None
hash(x)
  out = ''
  errorfile = None
hash(x)
  err = ''
  submit_status = ''
  submit_msg = ''
  initialdir = None
hash(x)
  outputurl = None
hash(x)
  job_id = -1
  cluster_id = None
hash(x)
  simdbkey = None
hash(x)
  host = None
hash(x)
  port = None
hash(x)
  url = None
hash(x)
  metadata = None
hash(x)
  post_check_script = None
hash(x)
  env = {}
  jobstatus = 0
  argopts = {'dataset': 0, 'nproc': 1, 'procnum': 0}
  parser = ExpParser(argopts, Steering())
  steering = None
hash(x)
  db_id = None
hash(x)
  passkey = None
hash(x)
  prio = 0
  realtime = 0.0
  usertime = 0.0
  systime = 0.0
Method Details [hide private]

GetJobId(self)

source code 

Get the cluster AND job id for the submitted jobs.

Returns:
a list of jobs with their cluster and job id in the condor format None if no jobs have been submitted or if submission failed.

SetJobId(self, jobid)

source code 

Set the job id for the submitted job.

Returns:
id of job in the condor format None if no jobs have been submitted or if submission failed.

GetDatabaseId(self)

source code 

Return the database job id for the submitted job.

Returns:
database ID of job None if job is not in database

SetInitialdir(self, path)

source code 

Define the directory where jobs will be submitted from.

Parameters:
  • path - system path to directory

GetInitialdir(self)

source code 

Get the directory where jobs will be submitted from.

Returns:
path to directory

SetConfigFile(self, file)

source code 

Define the XML config file

Parameters:
  • path - system path to file

GetRootDir(self)

source code 

Get the root directory of installation

Returns:
path to directory

SetRootDir(self, path)

source code 

Define the root directory of installation

Parameters:
  • path - system path to directory

FileName(self)

source code 

Get the name of this object's serialized file

Returns:
path to directory

SetOutputURL(self, url)

source code 

Define the url where data will be copied to.

Parameters:
  • url - target url for data

GetOutputURL(self)

source code 

Get the directory where data will be copied to.

Returns:
path to directory

SetExecutable(self, executable)

source code 

Define the executable file that will be run on condor

Parameters:
  • executable - path to executable file.

GetExecutable(self)

source code 
Returns:
the path to the executable (if set) that will be run on cluster.

GetPostCheckScript(self)

source code 
Returns:
the path to the post run check executable (if set)

SetMainScript(self, script_path)

source code 

Set the path to the main script to run

Parameters:
  • script_path - script to run

GetMainScript(self)

source code 

Get the path to the main script to run

Returns:
script to run

AddArgument(self, arg)

source code 

Add a parameter to be passed to executable. Note: Consecutive calls to this method will append parameters in the order in which they were added.

Parameters:
  • arg - argument to be passed to executable at runtime

format_arg(self, tuple)

source code 

format runtime cmdline argument

Parameters:
  • tuple - tuple in the form (argname,argval)

GetArguments(self)

source code 
Returns:
a list of arguments that will be passed to the executable

AddBatchOpt(self, optname, optval)

source code 

Add a batchsystem option to use in submit script

Parameters:
  • optname - name of option be passed to executable at runtime
  • optval - value of option be passed to executable at runtime

AddArgOption(self, optname, optval='')

source code 

Add a options to be passed to executable. Similar to 'AddArgument' but options will preceed arguemtens For example: executable <option(s)> <argument(s)> Note: Consecutive calls to this method will append options in the order in which they were added.

Parameters:
  • optname - name of option be passed to executable at runtime
  • optval - value of option be passed to executable at runtime

GetArgOptions(self)

source code 
Returns:
a list of options passed to the executable

GetArgOpt(self, optname)

source code 

Get value of option to be passed to executable.

Parameters:
  • optname - name of argument to be passed to executable at runtime

AddInputFile(self, filename)

source code 

Add an input file that Condor is to transfer to a remote site to set up the execution environment for the job before it is run. These files are placed in the same temporary working directory as the job's executable. At this time, directories can not be transferred in this way.

Parameters:
  • filename - relative to initial directory if set, otherwise subtmit directory.

AddOutputFile(self, filename)

source code 

Add an output file that the cluster is to transfer from a remote site on completion of run. These files are placed in the same temporary working directory as the job's executable. At this time, directories can not be transferred in this way.

Parameters:
  • filename - relative to initial directory if set, otherwise subtmit directory.

GetInputFiles(self)

source code 
Returns:
the list of input files that Condor is to transfer to a remote site to set up the execution environment for the job before it is run.

GetOutputFiles(self)

source code 
Returns:
the list of output files that the cluster is to transfer from a remote site after execution.

SetQueue(self, nproc)

source code 
Parameters:
  • nproc - number of jobs to enqueue

GetQueue(self)

source code 
Returns:
number of jobs enqueueued

SetLogFile(self, filename)

source code 
Parameters:
  • filename - path to logfile where condor will write the state of a given job in the cluster

SetOutputFile(self, filename)

source code 
Parameters:
  • filename - path to file where condor will write the output generated through stdout by the job

SetErrorFile(self, filename)

source code 
Parameters:
  • filename - path to file where condor will write the output generated through stderr by the job

GetLogFile(self)

source code 
Returns:
path to logfile where condor will write the state of a given job in the cluster

GetOutputFile(self)

source code 
Returns:
path to file where condor will write the output generated through stdout by the job

GetErrorFile(self)

source code 
Returns:
path to file where condor will write the output generated through stderr by the job

parse_params(self, src)

source code 

Replace key with value on a string. This can be anything but tipically a dollar sign token such as $args(value)

Parameters:
  • src - string contaning one or more token keys to replace