multisim.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ..
  2. Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at
  3. McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. Multiple Simulators
  14. ===================
  15. In some situations, having multiple models (and their respective simulator) in the same Python script is useful for comparing the performance.
  16. Local simulation
  17. ----------------
  18. In local simulation, it is possible to create multiple Simulator instances without any problems::
  19. sim1 = Simulator(Model1())
  20. # Any configuration you want on sim1
  21. sim1.simulate()
  22. sim2 = Simulator(Model2())
  23. # Any configuration you want on sim2
  24. sim2.simulate()
  25. Distributed simulation
  26. ----------------------
  27. Starting up multiple Simulator classes is not supported in distributed simulation. This is because starting a simulator will also impose the construction of different MPI servers, resulting in an inconsistency.
  28. It is supported in distributed simulation to use :doc:`reinitialisation <reinitialisation>`, simply because it is the same model and is coordinated by the same simulator.