ensembleSimulation
index
/home/schwitrs/bzr-repo/xplor-python3/bin.Linux_x86_64/ensembleSimulation.py

an ensemble of structures
 
A simulation which replicates the molecular structure in a given 
simulation.Simulation, and allows structure calculations to be
performed on the simulation, optionally executing in parallel. All
members of the simulation are exact replicas of each other, with
identical atoms. This module is described in 
 
    G.M. Clore and C.D. Schwieters, ``How much backbone motion in
    ubiquitin is required to be consistent with dipolar coupling data
    measured in multiple alignment media as assessed by independent
    cross-validation,'' J. Am. Chem. Soc. 126, 2923-2938 (2004).
 
Constructor:
 
 EnsembleSimulation(name,
                    size,
                    numThreads=1,
                    simulation=simulation.currentSimulation(),
                    barrierDebug=False) 
     required parameters are the name of the new simulation, and the
     ensemble size. numThreads defaults to 1. On multiprocessor machines 
     this may be increased for approximate linear speedup. The
     ensemble is based on the simulation argument, which defaults to
     the current simulation. This ensemble should normally be constructed 
     before defining any potential terms, or ivm.IVM objects. Any
     EnsemblePot (including PotList) will try to detect whether it was
     created before EnsembleSimulation(), and explicitly crash in the
     next call to its calcEnergy method. If the barrierDebug argument is
     set to True, problems with synchronization of EnsembleSimulation threads 
     are detected as early as possible, without incurring a large run-time 
     penalty.
 
     For EnsembleSimulations, the value of Simulation.noFit is set to 
     True, as the relative orientation of ensemble members is usually
     significant for some energy terms.
 
Methods:
 
  This objects contains all of the methods of the simulation.Simulation 
class. In addition, it contains the following:
 
  type() - returns the string "EnsembleSimulation"
 
  meanAtomPosArr() - return array of ensemble-averaged atom positions.
 
  members(memberIndex) - return Simulation corresponding to ensemble member.
 
  member()             - member associated with the current process
 
  numThreads() - the number of threads which execute simulataneously.
 
  multiThread() - call to terminate a single threaded region.
 
  singleThread(index=0) - used to enter a single threaded region in which
                   only the thread with memberIndex index executes. Returns 1
                   for the master process and 0 otherwise. Example use:
 
                       if singleThread():
                         #perform action in only one thread
                       multiThread() #after this statement all threads run
 
  singleThreaded() - returns 1 if in a singleThreaded region.
 
  size() - size of ensemble.
 
  subSim() - simulation upon which the ensemble is based.
 
  weight(memberIndex) - return the weight of the given member.
 
  setWeights(list)    - given a sequence of positive numeric vals of length 
                        size(),  set the ensemble weights to the 
                        corresponding normalized values.
 
  aveType()/setAveType(aveType) - accessors for aveType- how energy is
                                  averaged over the ensemble. Valid values
                                  for aveType are 'sum' and 'ave'. The default
                                  value is 'ave'.
 
less used methods:
 
  barrier() - used to synchronize threads of execution. All threads will
              reach this point before one continues on.
 
  sharedString() - return a SharedString object shared across the ensemble. 
                   It's usually preferable to use a SharedObj object from
                   the ensembleSharedObj module.
 
  shutdown() - explicitly shutdown threads.
 
 
class EnsembleMemberSimulation
 
  this class is returned by the member() and members() methods of
EnsembleSimulation. It contains all the methods of the Simulation
class. In addition, there are
 
  type() - returns the string "EnsembleMemberSimulation"
 
  pid() - return the id of the process which performs calculations on
          this member.
 
  memberIndex() - the index corresponding to this member.
 
  weight() - weight for this member
 
  ensembleSim() - the ensembleSimulation for this member.
  subSim()      - the Simulation on which this member is based.
 
 
The following atomSelAction.AtomSelAction helper function
calculates RMSD between the ensemble members.
 
class  EnsembleRMSD
 
methods:
  rmsd() : return overall RMSD between ensemble members
  byResidue(): return a dictionary with keys being residue ids, and
               values being per-residue RMSDs.
 
the RMSD is defined as
 
  sqrt( 1/N sum_ijk w_i * w_j * |q_ik - q_jk|^2 )
 
where q_ik is the position of atom k in ensemble i, N is the number of
atoms and w_i is the weight on ensemble member i.
 
 
Helper Functions
 
  There are module-level helper functions which can be used
whether or not an EnsembleSimulation is defined:
 
  singleThread - general version of EnsembleSimulation.singleThread
 
  multiThread  - general version of EnsembleSimulation.multiThread
 
  commBarrier  - EnsembleSimulation-safe socketComm.SocketComm barrier
 
  sizeOneSimulation(sim) - return a size-one EnsembleSimulation based on sim. If
                           sim is omitted, use the 
                           simulation.currentSimulation.
 
  getEnsembleSimulation(sim) - determine if the Simulation is an 
                               EnsembleSimulation. If so, return that else, 
                               return a sizeOneSimulation based on sim.
  
  fromSimulation(sim) - given a Simulation argument, cast this to an
                        EnsembleSimualtion, if it is indeed an EnsembleSimulation,
                        else raise an exception.
 
  memberFromSimulation(sim) - given a Simulation argument, cast this to an
                              EnsembleMemberSimualtion, if it is indeed an 
                              EnsembleSimulation, else raise an exception.
 
  currentSimulation() - return the current EnsembleSimulation, if there is 
                        one, else None.
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
Comm
EnsembleRMSD
EnsembleSimulation_SharedString
simulation.Simulation(builtins.object)
EnsembleMemberSimulation
EnsembleSimulation

 
class Comm(builtins.object)
    Comm(comm, esim)
 
An ensemble-safe version of socketComm.Comm. The members of this class
block non-ensemble-member-0 process from communicating: only the process
associated with member 0 communicates.
 
  Methods defined here:
__init__(s, comm, esim)
The contructor takes an existing socketComm.Comm and an
EnsembleSimulation as arguments.
barrier(s, timeout=-1)
collect(s, msg)
distribute(s, msg)
info(s, procNum)
procs(s)
Return the a sorted list of the current proc numbers. Only to be
called by proc 0.
readDataFrom(s, proc)
writeDataTo(s, proc, msg)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class EnsembleMemberSimulation(simulation.Simulation)
    EnsembleMemberSimulation(*args, **kwargs)
 

 
 
Method resolution order:
EnsembleMemberSimulation
simulation.Simulation
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
addDependent(self, *args, **kwargs) -> 'void'
atomCharge(self, *args, **kwargs) -> 'float_type const &'
atomFric(self, *args, **kwargs) -> 'float_type const &'
atomID(self, *args, **kwargs) -> 'int'
atomMass(self, *args, **kwargs) -> 'float_type const &'
atomMassArr(self, *args, **kwargs) -> 'CDSVector< float_type >'
atomName(self, *args, **kwargs) -> 'String'
atomNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
atomPos(self, *args, **kwargs) -> 'Vec3 const &'
atomPosArr(self, *args, **kwargs) -> 'CDSVector< Vec3 >'
atomVel(self, *args, **kwargs) -> 'Vec3 const &'
atomVelArr(self, *args, **kwargs) -> 'CDSVector< Vec3 >'
barrierCnt(self, *args, **kwargs) -> 'int'
barrierID(self, *args, **kwargs) -> 'int'
barrierIncr(self, *args, **kwargs) -> 'void'
bondPairByID(self, *args, **kwargs) -> 'BondIDPair const &'
calcKE(self, *args, **kwargs) -> 'float_type'
chemType(self, *args, **kwargs) -> 'String'
chemTypeArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
deleteAtoms_byIndex(self, *args, **kwargs) -> 'void'
ensembleSim(self, *args, **kwargs) -> 'EnsembleSimulation *'
getKE(self, *args, **kwargs) -> 'float_type'
lookupID(self, *args, **kwargs) -> 'int'
markAsModified(self, *args, **kwargs) -> 'void'
memberIndex(self, *args, **kwargs) -> 'int'
modifiedID(self, *args, **kwargs) -> 'Simulation const *'
pid(self, *args, **kwargs) -> 'pid_t'
removeDependent(self, *args, **kwargs) -> 'void'
residueName(self, *args, **kwargs) -> 'String'
residueNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
residueNum(self, *args, **kwargs) -> 'int'
residueNumArr(self, *args, **kwargs) -> 'CDSVector< int >'
resize(self, *args, **kwargs) -> 'void'
segmentName(self, *args, **kwargs) -> 'String'
segmentNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
select(self, *args, **kwargs) -> 'CDSList< int >'
setAtomCharge(self, *args, **kwargs) -> 'void'
setAtomFric(self, *args, **kwargs) -> 'void'
setAtomMass(self, *args, **kwargs) -> 'void'
setAtomMassArr(self, *args, **kwargs) -> 'void'
setAtomName(self, *args, **kwargs) -> 'void'
setAtomPos(self, *args, **kwargs) -> 'void'
setAtomPosArr(self, *args, **kwargs) -> 'void'
setAtomVel(self, *args, **kwargs) -> 'void'
setAtomVelArr(self, *args, **kwargs) -> 'void'
setChemType(self, *args, **kwargs) -> 'void'
setResidueName(self, *args, **kwargs) -> 'void'
setResidueNum(self, *args, **kwargs) -> 'void'
setSegmentName(self, *args, **kwargs) -> 'void'
sleep(self, *args, **kwargs) -> 'void'
subSim(self, *args, **kwargs) -> 'Simulation *'
type(self, *args, **kwargs) -> 'String const'
wake(self, *args, **kwargs) -> 'void'
weight(self, *args, **kwargs) -> 'float_type'

Static methods defined here:
__swig_destroy__ = delete_EnsembleMemberSimulation(...)

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from simulation.Simulation:
__eq__(self, other)
Return self==value.
__ne__(self, other)
Return self!=value.
atomByID(self, *args, **kwargs) -> 'Atom'
atomString(self, *args, **kwargs) -> 'String'
deleteAtoms(self, arg, noSync=False, force=False)
forceUpdate(self, *args, **kwargs) -> 'int const'
kineticEnergy(self, *args, **kwargs) -> 'float_type'
name(self, *args, **kwargs) -> 'String const'
noFit(self, *args, **kwargs) -> 'bool const'
numAtoms(self, *args, **kwargs) -> 'int'
numBonds(self, *args, **kwargs) -> 'int'
numDependents(self, *args, **kwargs) -> 'int'
pyXplorHelp(self, *args, **kwargs) -> 'String'
rawID(self, *args, **kwargs) -> 'int'
registerCallbacks(self, *args, **kwargs) -> 'void'
setForceUpdate(self, *args, **kwargs) -> 'void'
setNoFit(self, *args, **kwargs) -> 'void'
sync(self, *args, **kwargs) -> 'void'

Static methods inherited from simulation.Simulation:
currentSimulation(*args, **kwargs) -> 'Simulation *'
deleteSimulation(*args, **kwargs) -> 'void'
getReference(*args, **kwargs) -> 'rc_Simulation &'
makeCurrent(*args, **kwargs) -> 'void'
numSimulations(*args, **kwargs) -> 'int'
simulationByID(*args, **kwargs) -> 'Simulation *'
syncAllSimulations(*args, **kwargs) -> 'void'
validSimulation(*args, **kwargs) -> 'bool'

Data descriptors inherited from simulation.Simulation:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

Data and other attributes inherited from simulation.Simulation:
__hash__ = None

 
class EnsembleRMSD(builtins.object)
    EnsembleRMSD(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
byResidue(self, *args, **kwargs) -> 'CDSMap< int,float_type >'
rmsd(self, *args, **kwargs) -> 'float_type'
run(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_EnsembleRMSD(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class EnsembleSimulation(simulation.Simulation)
    EnsembleSimulation(*args, **kwargs)
 

 
 
Method resolution order:
EnsembleSimulation
simulation.Simulation
builtins.object

Methods defined here:
__del__(self)
__eq__(self, other)
Return self==value.
__init__ = construct(self, *args, **kwargs)
__ne__(self, other)
Return self!=value.
__repr__ = _swig_repr(self)
abort(self, *args, **kwargs) -> 'void'
addDependent(self, *args, **kwargs) -> 'void'
atomCharge(self, *args, **kwargs) -> 'float_type const &'
atomFric(self, *args, **kwargs) -> 'float_type const &'
atomID(self, *args, **kwargs) -> 'int'
atomMass(self, *args, **kwargs) -> 'float_type const &'
atomMassArr(self, *args, **kwargs) -> 'CDSVector< float_type >'
atomName(self, *args, **kwargs) -> 'String'
atomNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
atomPos(self, *args, **kwargs) -> 'Vec3 const &'
atomPosArr(self, *args, **kwargs) -> 'CDSVector< Vec3 >'
atomString(self, *args, **kwargs) -> 'String'
atomVel(self, *args, **kwargs) -> 'Vec3 const &'
atomVelArr(self, *args, **kwargs) -> 'CDSVector< Vec3 >'
aveType(self, *args, **kwargs) -> 'EnsembleSimulation::EnsembleSimulation_AveType const'
barrier(self, *args, **kwargs) -> 'void'
bondPairByID(self, *args, **kwargs) -> 'BondIDPair const &'
chemType(self, *args, **kwargs) -> 'String'
chemTypeArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
collect(self, val)
deleteAtoms(self, arg, noSync=False, force=False)
deleteAtoms_byIndex(self, *args, **kwargs) -> 'void'
kineticEnergy(self, *args, **kwargs) -> 'float_type'
lookupID(self, *args, **kwargs) -> 'int'
markAsModified(self, *args, **kwargs) -> 'void'
meanAtomPosArr(self, *args, **kwargs) -> 'CDSVector< Vec3 >'
member(self, *args) -> 'EnsembleMemberSimulation const *'
members(self, *args) -> 'EnsembleMemberSimulation const *'
modifiedID(self, *args, **kwargs) -> 'Simulation const *'
multiThread(self, *args, **kwargs) -> 'void'
numThreads(self, *args, **kwargs) -> 'int'
pyXplorHelp(self, *args, **kwargs) -> 'String'
registerCallbacks(self, *args, **kwargs) -> 'void'
removeDependent(self, *args, **kwargs) -> 'void'
residueName(self, *args, **kwargs) -> 'String'
residueNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
residueNum(self, *args, **kwargs) -> 'int'
residueNumArr(self, *args, **kwargs) -> 'CDSVector< int >'
resize(self, *args, **kwargs) -> 'void'
segmentName(self, *args, **kwargs) -> 'String'
segmentNameArr(self, *args, **kwargs) -> 'CDSVector< Simulation::char4 >'
select(self, *args, **kwargs) -> 'CDSList< int >'
setAtomCharge(self, *args, **kwargs) -> 'void'
setAtomFric(self, *args, **kwargs) -> 'void'
setAtomMass(self, *args, **kwargs) -> 'void'
setAtomMassArr(self, *args, **kwargs) -> 'void'
setAtomName(self, *args, **kwargs) -> 'void'
setAtomPos(self, *args, **kwargs) -> 'void'
setAtomPosArr(self, *args, **kwargs) -> 'void'
setAtomVel(self, *args, **kwargs) -> 'void'
setAtomVelArr(self, *args, **kwargs) -> 'void'
setAveType(self, *args, **kwargs) -> 'void'
setChemType(self, *args, **kwargs) -> 'void'
setResidueName(self, *args, **kwargs) -> 'void'
setResidueNum(self, *args, **kwargs) -> 'void'
setSegmentName(self, *args, **kwargs) -> 'void'
setWeights(self, *args, **kwargs) -> 'void'
sharedObj(self, obj=0)
sharedString(self, *args, **kwargs) -> 'EnsembleSimulation_SharedString *'
shutdown(self, *args, **kwargs) -> 'void'
singleThread(self, *args, **kwargs) -> 'bool'
singleThreaded(self, *args, **kwargs) -> 'bool'
size(self, *args, **kwargs) -> 'int'
subSim(self, *args, **kwargs) -> 'Simulation *'
sync(self, *args, **kwargs) -> 'void'
type(self, *args, **kwargs) -> 'String const'
weight(self, *args, **kwargs) -> 'float_type'

Static methods defined here:
__swig_destroy__ = delete_EnsembleSimulation(...)
currentSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
getEnsembleSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
makeCurrent(*args, **kwargs) -> 'void'
sizeOneSimulation(*args, **kwargs) -> 'EnsembleSimulation *'

Data descriptors defined here:
thisown

 
The membership flag

Data and other attributes defined here:
AVETYPE_AVE = 0
AVETYPE_SUM = 1
__hash__ = None

Methods inherited from simulation.Simulation:
atomByID(self, *args, **kwargs) -> 'Atom'
forceUpdate(self, *args, **kwargs) -> 'int const'
name(self, *args, **kwargs) -> 'String const'
noFit(self, *args, **kwargs) -> 'bool const'
numAtoms(self, *args, **kwargs) -> 'int'
numBonds(self, *args, **kwargs) -> 'int'
numDependents(self, *args, **kwargs) -> 'int'
rawID(self, *args, **kwargs) -> 'int'
setForceUpdate(self, *args, **kwargs) -> 'void'
setNoFit(self, *args, **kwargs) -> 'void'

Static methods inherited from simulation.Simulation:
deleteSimulation(*args, **kwargs) -> 'void'
getReference(*args, **kwargs) -> 'rc_Simulation &'
numSimulations(*args, **kwargs) -> 'int'
simulationByID(*args, **kwargs) -> 'Simulation *'
syncAllSimulations(*args, **kwargs) -> 'void'
validSimulation(*args, **kwargs) -> 'bool'

Data descriptors inherited from simulation.Simulation:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class EnsembleSimulation_SharedString(builtins.object)
    EnsembleSimulation_SharedString(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
get(self, *args, **kwargs) -> 'String'
set(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_EnsembleSimulation_SharedString(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
Functions
       
EnsembleSimulation_currentSimulation(*args) -> 'EnsembleSimulation *'
EnsembleSimulation_getEnsembleSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
EnsembleSimulation_makeCurrent(*args, **kwargs) -> 'void'
EnsembleSimulation_sizeOneSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
commBarrier(comm)
perform EnsembleSimulation-safe socketComm.SocketComm barrier
 
It's probably a better idea to instead create and use an instance of
the local Comm class.
construct(self, *args, **kwargs)
currentSimulation = EnsembleSimulation_currentSimulation(*args) -> 'EnsembleSimulation *'
fromSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
getEnsembleSimulation = EnsembleSimulation_getEnsembleSimulation(*args, **kwargs) -> 'EnsembleSimulation *'
memberFromSimulation(*args, **kwargs) -> 'EnsembleMemberSimulation *'
multiThread()
Wrap around ensembleSimulation.EnsembleSimulation.multiThread
which also works if no EnsembleSimulation is used.
oldConstructor = __init__(self, *args, **kwargs)
pyXplorHelp(*args) -> 'String'
singleThread(index=0)
Wrap around ensembleSimulation.EnsembleSimulation.singleThread
This returns true for the ensemble member of an EmsembleSimulation 
specified by the index argument or if no EnsembleSimulation is used.
sizeOneSimulation = EnsembleSimulation_sizeOneSimulation(*args, **kwargs) -> 'EnsembleSimulation *'

 
Data
        cvar = <Swig global variables>
maxMessageSize = 200
threadSuffix = ''