Package nMOLDYN :: Package Analysis :: Module Slave |
[hide private]
[frames] | no frames]

# Source Code for Module nMOLDYN.Analysis.Slave

     1  """This modules contains the functions used by Pyro slave to perform analysis remotely.
     2
     3  Functions:
     4      * do_analysisPerElement: performs an analysis element-by-element.
     5  """
     6
     7  from Scientific.DistributedComputing.MasterSlave import startSlaveProcess
     8
     9  # Define (or import) all the task handlers.
    10 -def do_analysisPerElement(analysis, element, trajname):
    11      """Performs the analysis element-by-element, the element being either
    12      an atom (atom-by-atom analysis), a frame index (frame-by-frame analysis),
    13      a group of atom (group-by-group analysis) or a set of q vectors.
    14
    15      @param analysis: the selected analysis.
    16      @type analysis: a subclass of nMOLDYN.Analysis.Analysis.Analysis class
    17
    18      @param element: the element on which the analysis is based.
    19      @type element: MMTK.Atom|integer|MMTK.Collections.Collection|nMOLDYN.Mathematics.QVectors
    20
    21      @param trajname: a string specifying the name of the trajectory.
    22      @type trajname: string
    23
    24      @return: the results of the analysis performed on one element.
    25      @rtype: depends on the analysis
    26      """
    27
    28      return analysis.calc(element, trajname)
    29
    30  startSlaveProcess()
    31