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

Class ClusterJob

source code

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, doAutoReconstruct=True, foamVersion=None, useFoamMPI=False, multiRegion=False)
Initializes the Job
source code
 
fullJobId(self)
Return a string with the full job-ID
source code
 
message(self, *txt) source code
 
setState(self, txt) source code
 
jobFile(self)
The file with the job information
source code
 
checkpointFile(self)
The file that makes the job write a checkpoint
source code
 
stopFile(self)
The file that makes the job write a checkpoint and end
source code
 
doIt(self)
The central logic.
source code
 
casedir(self)
Returns the actual directory of the case To be overridden if appropriate
source code
 
casename(self)
Returns just the name of the case
source code
 
foamRun(self, application, args=[], foamArgs=[], steady=False, multiRegion=None, progress=False, noLog=False)
Runs a foam utility on the case.
source code
 
autoDecompose(self)
Automatically decomposes the grid with a metis-algorithm
source code
 
autoReconstruct(self)
Default reconstruction of a parallel run
source code
 
setup(self, parameters)
Set up the job.
source code
 
postDecomposeSetup(self, parameters)
Additional setup, to be executed when the grid is already decomposed
source code
 
run(self, parameters)
Run the actual job.
source code
 
preReconstructCleanup(self, parameters)
Additional cleanup, to be executed when the grid is still decomposed
source code
 
cleanup(self, parameters)
Clean up after a job
source code
 
additionalReconstruct(self, parameters)
Additional reconstruction of parallel runs (Stuff that the OpenFOAM-reconstructPar doesn't do
source code
 
taskParameters(self, id)
Parameters for a specific task
source code
 
writeCheckpoint(self) source code
 
stopJob(self) source code
Method Details [hide private]

__init__(self, basename, arrayJob=False, hardRestart=False, autoParallel=True, doAutoReconstruct=True, foamVersion=None, useFoamMPI=False, 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
  • doAutoReconstruct - Automatically reconstruct the case if autoParalellel is set
  • foamVersion - The foam-Version that is to be used
  • useFoamMPI - Use the OpenMPI supplied with OpenFOAM
  • multiRegion - This job consists of multiple regions

doIt(self)

source code 

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

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

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)
  • progress - Only output the time and nothing else
  • noLog - Do not generate a logfile

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

additionalReconstruct(self, parameters)

source code 

Additional reconstruction of parallel runs (Stuff that the OpenFOAM-reconstructPar doesn't do

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