# Use the cloud (Will be available soon)¶

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.

softgrid is not open sourced and it can’t be distributed along with fullrmc. Therefore fullrmc softgrid enabled will be available as software as as solution on cloud infrastructures such as Microsoft AZURE.

class fullrmc.MultiframeUtils.WorkersManagement(repoTimeout=10, requestTimeout=60)

Bases: object

Used by remote softgrid worker to run fullrmc stochastic engine

from fullrmc.Engine import Engine
from fullrmc import MultiframeUtils

# create engine

# run on grid
WM = MultiframeUtils.WorkersManagement()
WM.start(engine=ENGINE, multiframe='size_distribution', orchestrator=None)

# run independant.
WM.run_independant(self, nCycle=10, numberOfSteps=1000, saveFrequency=1)

# run dependant
WM.run_dependant(nCycle=200, firstNAccepted=1, subframesWeight=None, numberOfSteps=100, saveFrequency=10)

start(engine, multiframe, orchestrator=None, workerRequestLoopTimeout=3600)
stop()

Stop WorkersManagement by disconnecting softgrid computation

run_dependant(nCycle=100, firstNAccepted=1, numberOfSteps=100, subframesWeight=10, normalize=1, driftTolerance=1, saveFrequency=10, cycleTimeout=900)

Run all remote subframes as whole dependant structure. Subframes weighted (subframesWeight) atomic configuration will be used to compute stochastic engine’s total standard error. Subframes constraints will also be using subframesWeight and prior to compute constraints standard error. This computation is valid under the assumption that all subframes might exist in the measured and modeled atomic system but they are far enough from each other to neglect any cross structural interactions and correlation

Parameters: nCycle (int): number of stochastic engine cycles firstNAccepted (int): number of accepted moves on subframes before returning result numberOfSteps (int): maximum number of steps per cycle subframesWeight (None, boolean, integer, list): Weights of subframes constributing to experimental constraints. If None, subframes weight will be fixed to normalize/numberOfSubframes if normalize is not None or 1./numberOfSubframes. If False, weights will be used as is. If True, weights will be updated after each cycle using non negative least square with the added condition of all weights must sum to 1. If integer, it’s the frequency of updating the weights in number of cycles. If list, it’s the fixed user defined weights to every and each subframe, Subframes prior are always computed after every and each cycle. In updated weights happen to be all 0 or only one subframe weight is not 0, weights will be automatically rescaled to normalize/numberOfSubframes or 1./numberOfSubframes. normalize (None, number): used to normalize subframesWeight whether those are given or computed. Normalization will linearly adjust subframesWeight to ensure sum(subframesWeight) = normalize If None, no normalization will be done. If number it must be a positive non zero number. A logical value to normalize is 1 which minimizes the interaction between constraints scaleFactor and subframesWeight value driftTolerance (integer): To avoid updated subframesWeight drift and divergence. weights are checked for any sudden jump jump (increase) or drop (decrease) that doubles or split by half previous cycle frame weight. In case drift occurs, previous cycle subframesWeight are used. Tolerance defines the number of successive cycles weight drifts before stopping the execution. saveFrequency (int): frequency of saving all frames in between cycles cycleTimeout (None, integer): Estimated time for stochastic engine to perform 1 cycle for all frames on remote workers. Timeout error will be raise if cycleTimeout is exhausted before all workers finish the cycle work.
run_independant(nCycle=10, numberOfSteps=1000, saveFrequency=1, cycleTimeout=3600)

run all remote subframes as totally independant structures

Parameters: nCycle (int): number of total independant cycles numberOfSteps (int): number of steps per cycle saveFrequency (int): frequency of saving all frames in between cycles cycleTimeout (None, integer): Estimated time for stochastic engine to perform 1 cycle for all frames on remote workers. Timeout error will be raise if cycleTimeout is exhausted before all workers finish the cycle work.
save()

Call all remote subFrames to save.