To check and request fullrmc on the cloud, visit fullrmc’s website and contact info@fullrmc.com for any questions.
fullrmc runs a stochastic engine that runs as a sequential process. To speed up the calculation for big systems, pthreads are used to parallelize certain parts of the computation blocks. This turns out to be beneficial when the number of atoms in the system is big enough to compensate for the overhead of launching the parallel processing on every and each step.
On the other hand when the studied atomic system is constituted of a mixture of different structures (distribution of nanoparticles size, local structures and nano-grains, distribution of structure faults, interface structures, etc.) and systems then a single atomic system simulation will never be enough to get an accurate solution. For that particular reason in fullrmc we introduce the concept of ‘multiframe’ and we use softgrid to enable running fullrmc’s multiframe on any set of connected commodity hardware to perform synchronous and asynchronous multiframe computation. See Run Modes for an explanation of the statistical, mesoscopic, and nanoscopic modes this enables.
softgrid is not open sourced and it can’t be distributed along with fullrmc. Therefore fullrmc softgrid enabled will be available as a software as a solution on cloud infrastructures such as Microsoft AZURE, Amazon AWS, Akamai Linode, etc.
MultiframeUtils contains helper classes to run and build fullrmc multiframe stochastic engine structures.
WorkersManagement is used on a softgrid worker to run a
multiframe’s subframes concurrently in statistical, mesoscopic or
nanoscopic mode.
MultiframeStructureBuilder is used to reorganize a
multiframe’s subframes’ atom coordinates into a single, coherent
nanoscale structure.
random() -> x in the interval [0, 1).
WorkersManagement method decorator that catches any exception raised by the decorated method, logs it and transfers it to the connected executor or orchestrator, then disconnects (executor case) or stops (orchestrator case).
func (function): The WorkersManagement bound method to wrap.
wrapper (function): The wrapped method that transparently forwards to func and handles its exceptions.
Bases: object
Used by a remote softgrid worker to run a fullrmc stochastic engine.
repoTimeout (number): The engine’s repository read/write lock timeout in seconds.
requestTimeout (number): The maximum time in seconds to wait for a request to be fulfilled before giving up.
from fullrmc.Engine import Engine
from fullrmc import MultiframeUtils
# create engine
ENGINE = Engine().load(path)
# run on grid
WM = MultiframeUtils.WorkersManagement()
WM.start(engine=ENGINE, multiframe='size_distribution', orchestrator=None)
# run statistical
WM.run_statistical(nCycle=10, numberOfSteps=1000, saveFrequency=1)
# run mesoscopic
WM.run_mesoscopic(nCycle=200, firstNAccepted=1, subframesWeight=None, numberOfSteps=100, saveFrequency=10)
# run nanoscopic
WM.run_nanoscopic(nCycle=200, numberOfSteps=1000, saveFrequency=1)
Start a grid computation session for a multiframe. This connects to (or creates) a softgrid orchestrator, launches one worker per subframe, and loads the corresponding stochastic engine subframe onto each worker.
engine (fullrmc.Engine): The stochastic engine instance whose used frame must be a multiframe.
multiframe (string): The multiframe name to distribute across workers, one subframe per worker.
orchestrator (None, softgrid.Orchestrator): The orchestrator to connect to. If None, a new local orchestrator is created.
workerRequestLoopTimeout (number): The maximum time in seconds a worker’s request loop is allowed to run for.
killAtStop (None, bool): Whether launched workers must be
killed when this instance’s stop() is called. If
None, the orchestrator’s default behavior is kept.
gridLogKwargsUpdate (dict): Logger configuration update passed to the orchestrator to control which softgrid log types are printed to stdout or written to file.
Stop WorkersManagement by disconnecting from the softgrid computation.
kill (None, bool): Whether to also kill the connected
workers upon disconnecting. If None, the killAtStop value
given at start() time is used instead.
Run all remote subframes as a single, whole nanoscopic structure. Subframes’ atomic configurations are treated as a connected system to compute the stochastic engine’s total standard error. Unlike the mesoscopic computation, this nanoscopic computation takes correlations between subframes into account.
nCycle (int): Number of stochastic engine cycles.
numberOfSteps (int): Number of steps per cycle. If moveAtoms is False, this parameter is ignored.
updateFrequency (int): Frequency, in number of accepted steps, at which subframes communicate back and update all constraints’ nanoscopic data. If moveAtoms is False, this parameter is ignored.
moveAtoms (boolean): Whether to create independent moves within each and every subframe, enhancing short range correlations.
moveSubframes (boolean): Whether to move each subframe independently as a whole grained entity, enhancing long range correlations.
cycleMinSteps (boolean, int): Minimum number of moveSubframes steps in a cycle before the cycle is finished. If True, cycleMinSteps is automatically set to the number of subframes. If moveSubframes is False, this parameter is ignored.
subframeMinSelected (int, list): Minimum number of times a subframe must be selected for a move before a cycle is finished. If moveSubframes is False, this parameter is ignored.
subframeMinAccepted (int, list): Minimum number of times a subframe move must be accepted before a cycle is finished. If moveSubframes is False, this parameter is ignored.
optimize (boolean): Whether to optimize parameters during stochastic engine runtime. Optimization parameters are defined separately in the engine constraints.
translation (None, number): Grains engine groups’ translation amplitude. If moveSubframes is False, this parameter is ignored.
rotation (None, number): Grains engine groups’ rotation amplitude in degrees. If moveSubframes is False, this parameter is ignored.
swap (boolean): Whether to allow swapping subframes’ center positions. If moveSubframes is False, this parameter is ignored.
saveFrequency (int): Frequency, in cycles, at which all subframes are saved.
cycleTimeout (None, integer): Estimated time, in seconds, for the stochastic engine to perform one cycle across all frames on remote workers. A timeout error is raised if cycleTimeout is exhausted before all workers finish the cycle’s work.
Run all remote subframes as a single, whole mesoscopic structure. Subframes’ weighted (subframesWeight) atomic configurations are used to compute the stochastic engine’s total standard error. Subframes’ constraints also use subframesWeight prior to computing constraints’ standard error. This computation is valid under the assumption that all subframes might exist in the measured and modeled atomic system, but that they are far enough from each other to neglect any cross-structural interactions and correlations.
nCycle (int): Number of stochastic engine cycles.
firstNAccepted (int): Number of accepted moves on subframes before returning the result.
numberOfSteps (int): Maximum number of steps per cycle.
subframesWeight (None, boolean, integer, list): Weights of subframes contributing to experimental constraints. If None, subframes’ weight is fixed to 1./numberOfSubframes. If False, weights are used as is. If True, weights are updated after each cycle using non-negative least squares with the added condition that all weights must sum to 1. If integer, it is the frequency, in number of cycles, at which weights are updated. If list, it is the fixed, user-defined weight for every and each subframe. Subframes’ priors are always computed after every and each cycle. If updated weights happen to be all 0, or only one subframe’s weight is non-zero, weights are automatically rescaled to 1./numberOfSubframes.
driftTolerance (integer): Used to avoid updated subframesWeight drift and divergence. Weights are checked for any sudden jump (increase) or drop (decrease) that doubles or halves the previous cycle’s frame weight. If drift occurs, the previous cycle’s subframesWeight is used instead. driftTolerance defines the number of successive cycles of weight drift allowed before stopping execution.
rescaleLimit (int): Defines the minimum number of subframes with a computed weight of 0 that triggers an automatic rescale. When the number of subframes with weight 0 is equal to or greater than rescaleLimit, all subframes’ weights are automatically adjusted and rescaled to 1./numberOfSubframes.
allowStatistical (boolean, int, list): Whether to allow non-participating subframes within the mesoscopic structure (0 weight) to run statistically, giving them a chance to catch up and get re-integrated into the whole structure. If True is given, allowStatistical is automatically set to the given numberOfSteps. If an integer is given, it must be >=0. If a list is given, it must have the same number of items as the number of subframes, with values that are booleans or integers.
optimize (boolean): Whether to optimize parameters during stochastic engine runtime. Optimization parameters are defined separately in the engine constraints.
saveFrequency (int): Frequency, in cycles, at which all frames are saved.
cycleTimeout (None, integer): Estimated time, in seconds, for the stochastic engine to perform one cycle across all frames on remote workers. A timeout error is raised if cycleTimeout is exhausted before all workers finish the cycle’s work.
Run all remote subframes as totally independent structures.
nCycle (int): Number of total independent cycles.
numberOfSteps (int): Number of steps per cycle.
updateLoss (boolean): Whether to train the loss function during stochastic engine runtime. This only takes effect if the chosen loss is not static but machine-learning enabled.
optimize (boolean): Whether to optimize parameters during stochastic engine runtime. Optimization parameters are defined separately in the engine constraints.
saveFrequency (int): Frequency, in cycles, at which all frames are saved.
cycleTimeout (None, integer): Estimated time, in seconds, for the stochastic engine to perform one cycle across all frames on remote workers. A timeout error is raised if cycleTimeout is exhausted before all workers finish the cycle’s work.
Call all remote subframes to save.
Bases: object
Multiframe structure builder used to reorganize subframes’ atom coordinates and create a single, coherent multiframe structure out of all of its subframes’ atoms. This is mostly used for nanoscale computations.
engine (fullrmc.Engine): The fullrmc engine.
multiframe (str): The engine’s multiframe.
boundaryConditions (None, boundaryConditions): The multiframe structure’s boundaryConditions. If None, this is computed using the provided numberDensity.
numberDensity (None, number): If boundaryConditions is given, this is not used. Otherwise, numberDensity is used to create the boundaryConditions. Default value is half of pure water’s number density.
from fullrmc.MultiframeUtils import MultiframeStructureBuilder
from fullrmc.Globals import WATER_NUMBER_DENSITY
MSB = MultiframeStructureBuilder(engine=E, multiframe='multi', boundaryConditions=None, numberDensity=WATER_NUMBER_DENSITY/2.)
MSB.build_random()
pdb = MSB.get_pdb()
pdb.visualize()
Set the multiframe.
multiframe (str): The engine’s multiframe.
Set boundary conditions and number density. If both boundaryConditions and numberDensity are None, the multiframe structure must be nanoscopic.
boundaryConditions (None, boundaryConditions): The multiframe structure’s boundaryConditions. If None, this is computed using the provided numberDensity.
numberDensity (None, number): If boundaryConditions is given, this is not used. Otherwise, numberDensity is used to create the boundaryConditions.
Translate given real space coordinates within boundary conditions.
realCoordinates (numpy.ndarray): The atoms’ coordinates to translate.
vector (None, numpy.ndarray): The translation vector to apply. If None, a random vector towards the positive quadrant is generated.
coordinates (numpy.ndarray): The translated coordinates.
vector (numpy.ndarray): The translation vector used.
Rotate given real space coordinates.
realCoordinates (numpy.ndarray): The atoms’ coordinates to rotate.
rotationAxis (None, numpy.ndarray): The rotation axis vector to use. If None, a random unit vector is generated.
rotationAngle (None, number): The rotation angle, in radians, to use. If None, a random angle is generated.
coordinates (numpy.ndarray): The rotated coordinates. If realCoordinates has one atom or fewer, rotation is a no-op and the input coordinates are returned unchanged.
rotationAxis (None, numpy.ndarray): The rotation axis vector used, or None if realCoordinates has one atom or fewer.
rotationAngle (None, number): The rotation angle used, or None if realCoordinates has one atom or fewer.
Transform real space coordinates to box space coordinates.
realCoordinates (numpy.ndarray): The atoms’ coordinates to transform.
boxCoordinates (numpy.ndarray): The box coordinates.
Transform box space coordinates to real space coordinates.
boxCoordinates (numpy.ndarray): The atoms’ coordinates to transform.
realCoordinates (numpy.ndarray): The real coordinates.
Randomize subframes’ structures within the boundary conditions box by applying translations and rotations.
lowerDistance (number): Minimum contact distance.
maxTrials (integer): Maximum number of trials to insert a subframe.
shuffle (string, list, tuple, boolean): Whether to shuffle frames before insertion. If string, ‘big first’ or ‘small first’ are accepted. If list, it must be a list of integers ranging from 0 to the number of subframes. Otherwise, if True, subframes are randomly shuffled for insertion.
translate (boolean): Whether to apply translations.
rotate (boolean): Whether to apply rotations.
moveFirst (boolean): Whether to apply a random translation and rotation to the first inserted subframe.
Push the built multiframe structure coordinates to the subframes.
force (boolean): Whether to force re-updating the coordinates if they were already updated.
Get a single pdb from the multiframe structure.
pdb (pdbparser.pdbparser): The pdb instance.