CarbonTracker

Previous topic

DaSystem

Next topic

The Observation Object

This Page

PlatForm

Revision History: File created on 06 Sep 2010.

The PlatForm class is found in the module platform, or in a specific implementation under the da/source tree.

The platform object holds attributes and methods that allow job control on each specific platform. This includes methods to create and submit jobs, but also to obtain process and/or job ID’s. These are needed to control the flow of the system on each platform.

Typically, every platform needs specific implementations of this object (through inheritance), and you should refer to your specific PlatForm object documentation for details (see da/platform/).

class da.baseclasses.platform.PlatForm

This specifies platform dependent options under generic object calls. A platform object is used to control and submit jobs

GetJobTemplate(joboptions={}, block=False)

Returns the job template for a given computing system, and fill it with options from the dictionary provided as argument. The job template should return the preamble of a job that can be submitted to a queue on your platform, examples of popular queuing systems are:

  • SGE
  • MOAB
  • XGrid

A list of job options can be passed through a dictionary, which are then filled in on the proper line, an example is for instance passing the dictionary {‘account’:’co2’} which will be placed after the -A flag in a qsub environment.

An extra option block has been added that allows the job template to be configured to block the current job until the submitted job in this template has been completed fully.

GetMyID()

Return the process ID, or job ID of the current process or job

KillJob(jobid)

This method kills a running job

StatJob(jobid)

This method gets the status of a running job

SubmitJob(jobfile, joblog=None, block=False)
param jobfile:a string with the filename of a jobfile to run
param joblog:a string with the filename of a logfile to write run output to
param block:Boolean specifying whether to submit and continue (F), or submit and wait (T)
rtype:integer

This method submits a jobfile to the queue, and returns the job ID

WriteJob(jobfile, template, jobid)

This method writes a jobfile to the exec dir and makes it executable (mod 477)