0

During the simulation, anylogic isn't using the whole CPU capability, the CPU usage is always around 10~30%. Though I choose the "run as fast as possible" option already. So, is there any method to unlimit the CPU usage of anylogic (using the whole CPU capability as possible), to let it simulate at a higher speed?

JackTsui
  • 3
  • 2
  • Are you on Windows, where all of one or two CPU cores is only 12.5 or 25% or so, e.g. on an 8-core machine? If so, then anylogic wasn't able to make use of all your CPU cores. – Peter Cordes Oct 11 '22 at 08:32
  • Does this answer your question? [AnyLogic Computer Processor Advice needed - Single-core speed vs. number of cores?](https://stackoverflow.com/questions/72033825/anylogic-computer-processor-advice-needed-single-core-speed-vs-number-of-core) – Peter Cordes Oct 11 '22 at 08:35
  • Also [How to get 100% CPU usage from a C program](https://stackoverflow.com/q/9244481) re: how 10 to 30% probably means a couple cores pegged on Windows. – Peter Cordes Oct 11 '22 at 08:37
  • Thanks for replying. Yes, I am using Windows with i7-12700f which has 12 cores and also with 32gb of ram on the PC. So is there any possible way to use all the cores for simulation? BTW I am using the road traffic library, does this matter? – JackTsui Oct 11 '22 at 08:47
  • I cracked my head on this for 1 year, didn't find a feasible solution. I assume, increasing speed via increasing CPU usage is simply not possible. – Yashar Ahmadov Oct 11 '22 at 09:02
  • Thanks, if there is any possible solution to increase the speed of simulation rather than increasing the CPU usage? Does having a larger ram or changing any setting helps? Or does anylogic perform better in linux environment? – JackTsui Oct 11 '22 at 09:06
  • According to [AnyLogic Computer Processor Advice needed - Single-core speed vs. number of cores?](https://stackoverflow.com/q/72033825) , multiple cores are useful for parallel simulations. That seems like a duplicate. But I don't know anything about anylogic, I'm just here for the [cpu] tag. (Usually I ignore questions about CPU load average and utilization, mostly looking for mis-tagged questions about [cpu-architecture].) – Peter Cordes Oct 11 '22 at 09:36
  • Oh okay, btw thanks for providing these information. – JackTsui Oct 11 '22 at 15:17

1 Answers1

3

Any single simulation run can only ever use 1 core. If you want to use all your cores, you must create another experiment type such as a "Parameter Variation" and use the "free run" option.

Also ensure to enable "parallel evaluations" in the advanced experiment settings.

Now, each core runs 1 separate replication of your model. However, if you use a fixed seed, each will be identical. So this is really only an option to evaluate randomness efficiently. Else 1 core is what you get.

PS: To use several cores within 1 simulation experiment would be extremely difficult with custom multi-threading that you would need to manage, do not even think of going there :)

Benjamin
  • 10,603
  • 3
  • 16
  • 28