Package PyFoam :: Package Infrastructure :: Module ClusterJob :: Class ClusterJob
[hide private]
[frames] | no frames]

Class ClusterJob

source code

Known Subclasses:
SolverJob

All Cluster-jobs are to be derived from this base-class

The actual jobs are implemented by overriding methods

There is a number of variables in this class that are used to 'communicate' information between the various stages

Instance Methods [hide private]
  __init__(self, basename, arrayJob=False, hardRestart=False, autoParallel=True, foamVersion=None, multiRegion=False)
Initializes the Job
  message(self, *txt)
  setState(self, txt)
  jobFile(self)
The file with the job information
  checkpointFile(self)
The file that makes the job write a checkpoint
  stopFile(self)
The file that makes the job write a checkpoint and end
  doIt(self)
The central logic.
  casedir(self)
Returns the actual directory of the case To be overridden if appropriate
  casename(self)
Returns just the name of the case
  foamRun(self, application, args=[], foamArgs=[], steady=False, multiRegion=None)
Runs a foam utility on the case.
  autoDecompose(self)
Automatically decomposes the grid with a metis-algorithm
  autoReconstruct(self)
Default reconstruction of a parallel run
  setup(self, parameters)
Set up the job.
  postDecomposeSetup(self, parameters)
Additional setup, to be executed when the grid is already decomposed
  run(self, parameters)
Run the actual job.
  preReconstructCleanup(self, parameters)
Additional cleanup, to be executed when the grid is still decomposed
  cleanup(self, parameters)
Clean up after a job
  taskParameters(self, id)
Parameters for a specific task
  writeCheckpoint(self)
  stopJob(self)

Method Details [hide private]

__init__(self, basename, arrayJob=False, hardRestart=False, autoParallel=True, foamVersion=None, multiRegion=False)
(Constructor)

source code 
Initializes the Job
Parameters:
  • basename - Basis name of the job
  • arrayJob - this job is a parameter variation. The tasks are identified by their task-id
  • hardRestart - treat the job as restarted
  • autoParallel - Parallelization is handled by the base-class
  • foamVersion - The foam-Version that is to be used
  • multiRegion - This job consists of multiple regions

message(self, *txt)

source code 
None

setState(self, txt)

source code 
None

jobFile(self)

source code 
The file with the job information

checkpointFile(self)

source code 
The file that makes the job write a checkpoint

stopFile(self)

source code 
The file that makes the job write a checkpoint and end

doIt(self)

source code 
The central logic. Runs the job, sets it up etc

casedir(self)

source code 
Returns the actual directory of the case To be overridden if appropriate

casename(self)

source code 
Returns just the name of the case

foamRun(self, application, args=[], foamArgs=[], steady=False, multiRegion=None)

source code 
Runs a foam utility on the case. If it is a parallel job and the grid has already been decomposed (and not yet reconstructed) it is run in parallel
Parameters:
  • application - the Foam-Application that is to be run
  • foamArgs - A list if with the additional arguments for the Foam-Application
  • args - A list with additional arguments for the Runner-object
  • steady - Use the steady-runner
  • multiRegion - Run this on multiple regions (if None: I don't have an opinion on this)

autoDecompose(self)

source code 
Automatically decomposes the grid with a metis-algorithm

autoReconstruct(self)

source code 
Default reconstruction of a parallel run

setup(self, parameters)

source code 

Set up the job. Called in the beginning if the job has not been restarted

Usual tasks include grid conversion/setup, mesh decomposition etc
Parameters:
  • parameters - a dictionary with parameters

postDecomposeSetup(self, parameters)

source code 

Additional setup, to be executed when the grid is already decomposed

Usually for tasks that can be done on a decomposed grid
Parameters:
  • parameters - a dictionary with parameters

run(self, parameters)

source code 
Run the actual job. Usually the solver.
Parameters:
  • parameters - a dictionary with parameters

preReconstructCleanup(self, parameters)

source code 

Additional cleanup, to be executed when the grid is still decomposed

Usually for tasks that can be done on a decomposed grid
Parameters:
  • parameters - a dictionary with parameters

cleanup(self, parameters)

source code 
Clean up after a job
Parameters:
  • parameters - a dictionary with parameters

taskParameters(self, id)

source code 
Parameters for a specific task
Parameters:
  • id - the id of the task
Returns:
a dictionary with parameters for this task

writeCheckpoint(self)

source code 
None

stopJob(self)

source code 
None