Package PyFoam :: Package Execution :: Module ParallelExecution :: Class LAMMachine
[hide private]
[frames] | no frames]

Class LAMMachine

source code


Wrapper class for starting an stopping a LAM-Machine

Instance Methods [hide private]
 
__init__(self, machines=None, nr=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
boot(self)
Boots a LAM-machine using the machine-file
source code
 
buildMPIrun(self, argv, expandApplication=True)
Builds a list with a working mpirun command (for that MPI-Implementation)
source code
 
cpuNr(self) source code
 
machineOK(self)
Check whether the LAM machine was properly booted
source code
 
stop(self)
Stops a LAM-machine (if one is running)
source code
 
writeDecomposition(self, sDir, par)
Write parameter file for a decomposition
source code
 
writeMetis(self, sDir)
Write the parameter-File for a metis decomposition
source code
 
writeSimple(self, sDir, direction)
Write the parameter-File for a metis decomposition
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from Basics.Utilities.Utilities
 
copyfile(self, src, dst)
Encapsulates the shutil copyfile and provides an alternative for old Python-version
source code
 
copytree(self, src, dst, symlinks=False, force=False)
Encapsulates the shutil copytree and provides an alternative for old Python-version
source code
 
diskUsage(self, fpath)
Calculate the disk space used at the specified path in bytes
source code
 
execute(self, cmd, debug=False, workdir=None, echo=None)
Execute the command cmd.
source code
 
find(self, pattern, path, directoriesToo=True)
Find all files whose names match
source code
 
humanReadableSize(self, num)
Lifted from http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size Gets a number in bytes and returns a human readable string
source code
 
listDirectory(self, d)
Lists the files in a directory, but excludes certain names and files with certain endings
source code
 
remove(self, f)
Remove a file if it exists.
source code
 
rmtree(self, dst, ignore_errors=False)
Encapsulates the shutil rmtree and provides an alternative for old Python-version
source code
 
which(self, progname)
Get the full path.
source code
 
writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary
source code
Class Variables [hide private]
    Inherited from Basics.Utilities.Utilities
  excludeNames = ['^.svn$', '~$']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, machines=None, nr=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • machines - Name of the file with the machine information
  • nr - Number of processes
Overrides: object.__init__

buildMPIrun(self, argv, expandApplication=True)

source code 

Builds a list with a working mpirun command (for that MPI-Implementation)

Parameters:
  • argv - the original arguments that are to be wrapped
  • expandApplication - Expand the
Returns:
list with the correct mpirun-command

writeDecomposition(self, sDir, par)

source code 

Write parameter file for a decomposition

Parameters:
  • par (str) - Parameters specific for that kind of decomposition
  • sDir (PyFoam.RunDictionary.SolutionDirectory) - Solution directory

writeMetis(self, sDir)

source code 

Write the parameter-File for a metis decomposition

Parameters:
  • sDir (PyFoam.RunDictionary.SolutionDirectory) - Solution directory

writeSimple(self, sDir, direction)

source code 

Write the parameter-File for a metis decomposition

Parameters:
  • sDir (PyFoam.RunDictionary.SolutionDirectory) - Solution directory
  • direction - direction in which to decompose (0=x, 1=y, 2=z)