PyFoam.Infrastructure.ClusterJob module¶
Encapsulates all necessary things for a cluster-job, like setting up, running, restarting
-
class
PyFoam.Infrastructure.ClusterJob.
ClusterJob
(basename, arrayJob=False, hardRestart=False, autoParallel=True, doAutoReconstruct=None, foamVersion=None, compileOption=None, useFoamMPI=False, multiRegion=False, parameters={}, isDecomposed=False)[source]¶ Bases:
object
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
-
additionalParameters
()[source]¶ Additional parameters :return: a dictionary with parameters for this task
-
additionalReconstruct
(parameters)[source]¶ Additional reconstruction of parallel runs (Stuff that the OpenFOAM-reconstructPar doesn’t do :param parameters: a dictionary with parameters
-
execute
(cmd)[source]¶ Execute a shell command in the case directory. No checking done :param cmd: the command as a string
-
foamRun
(application, args=[], foamArgs=[], steady=False, multiRegion=True, progress=False, compress=False, noLog=False)[source]¶ 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 :param application: the Foam-Application that is to be run :param foamArgs: A list if with the additional arguments for the Foam-Application :param compress: Compress the log-file :param args: A list with additional arguments for the Runner-object :param steady: Use the steady-runner :param multiRegion: Run this on multiple regions (if None: I don’t have an opinion on this) :param progress: Only output the time and nothing else :param noLog: Do not generate a logfile
-
postDecomposeSetup
(parameters)[source]¶ 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
-
preReconstructCleanup
(parameters)[source]¶ 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
-
run
(parameters)[source]¶ Run the actual job. Usually the solver. :param parameters: a dictionary with parameters
-
setup
(parameters)[source]¶ 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
-
taskParameters
(id)[source]¶ Parameters for a specific task :param id: the id of the task :return: a dictionary with parameters for this task
-
-
class
PyFoam.Infrastructure.ClusterJob.
PrepareCaseJob
(basename, solver, parameterfile, arguments, parameters={}, noMeshCreate=False, **kwargs)[source]¶ Bases:
PyFoam.Infrastructure.ClusterJob.SolverJob
Assumes that the case is prepared to be set up with =pyFoamPrepareCase.py= and automatically sets it up with this. Needs one parameterfile to be specified and then a list of name/value-pairs
-
class
PyFoam.Infrastructure.ClusterJob.
SolverJob
(basename, solver, template=None, cloneParameters=[], arrayJob=False, hardRestart=False, autoParallel=True, doAutoReconstruct=None, foamVersion=None, compileOption=None, useFoamMPI=False, steady=False, multiRegion=False, parameters={}, progress=False, solverArgs=[], solverProgress=False, solverNoLog=False, solverLogCompress=False, isDecomposed=False)[source]¶ Bases:
PyFoam.Infrastructure.ClusterJob.ClusterJob
A Cluster-Job that executes a solver. It implements the run-function. If a template-case is specified, the case is copied
-
class
PyFoam.Infrastructure.ClusterJob.
VariationCaseJob
(basename, parameterfile, variationfile, template=None, **kwargs)[source]¶ Bases:
PyFoam.Infrastructure.ClusterJob.SolverJob
Assumes that the case is prepared to be set up with =pyFoamRunParameterVariation.py= and automatically sets it up with this. Needs one parameterfile and a variation-file