class pdevssim

The pdevssim functions can be used to simulate large multi-component models on small parallel computers.


Public Methods

[more] pdevssim(devsn* model, int num_threads, ADEVS_TIME_TYPE t0 = ADEVS_ZERO, ADEVS_TIME_TYPE t_granule = ADEVS_EPSILON)
Create and initialize a simulator for the model with initial time t0.
[more]void run(ADEVS_TIME_TYPE t_max = ADEVS_INFINITY)
Run the simulation until the time of next event is greater than t_max
[more]void step()
Run the simulation until the next synchronization point
[more]ADEVS_TIME_TYPE timeNext()
Return GVT at the current synchronization point
[more]virtual void reset(int num_threads, ADEVS_TIME_TYPE t0 = ADEVS_ZERO, ADEVS_TIME_TYPE t_granule = ADEVS_EPSILON)
Reset the simulator and reinitialize the model
[more]virtual ~pdevssim()
Destructor.


Documentation

The pdevssim functions can be used to simulate large multi-component models on small parallel computers. This parallel simulator will execute simultaneous events in parallel. This means that state transition functions are executed in parallel, output functions are executed in parallel, garbage collection is done in parallel, and event routing is done in parallel.

There are four constraints that parallel execution places on a model. These are

  • It must be safe to execute model state transition in parallel and output functions in parallel. If you designed your model's properly, this isn't a problem (because models don't share data except through input and output ports). However, in the rare instance that you have some unsafe sharing going on, it needs to be fixed before the parallel simulator is used.
  • The event routing method for your network model must be reentrant. Because events are routed in parallel, the event routing method can be called simutaneously by multiple threads. The coupled models that come with adevs are safe for use with the parallel simulator. Custom models will need to make sure that the event routing method is thread safe (ideally, by being reentrant).
  • Garbage collection methods must be able to execute in parallel.
  • Your model is not a dynamic structure model. There is no support for parallel simulation of dynamic structure models.

  • o pdevssim(devsn* model, int num_threads, ADEVS_TIME_TYPE t0 = ADEVS_ZERO, ADEVS_TIME_TYPE t_granule = ADEVS_EPSILON)
    Create and initialize a simulator for the model with initial time t0. The model will be simulated using the specified number of threads. If NUMA support was enabled, then models will be simulated on their assigned nodes. Otherwise, the assignment of models to threads will be as desired, but there is no way of controlling how threads are assigned to processes. Only coupled models can be executed in paralle, because there is no parallel potential in an atomic model (at least, not using the parallel algorithm implemented here). Dynamic structure models are NOT supported by the parallel simulation engine.

    ovoid run(ADEVS_TIME_TYPE t_max = ADEVS_INFINITY)
    Run the simulation until the time of next event is greater than t_max

    ovoid step()
    Run the simulation until the next synchronization point

    oADEVS_TIME_TYPE timeNext()
    Return GVT at the current synchronization point

    ovirtual void reset(int num_threads, ADEVS_TIME_TYPE t0 = ADEVS_ZERO, ADEVS_TIME_TYPE t_granule = ADEVS_EPSILON)
    Reset the simulator and reinitialize the model

    ovirtual ~pdevssim()
    Destructor. Does not delete the model.


    This class has no child classes.

    Alphabetic index HTML hierarchy of classes or Java



    This page was generated with the help of DOC++.