question

Ryusuke T avatar image
0 Likes"
Ryusuke T asked Ryusuke T commented

About FlexSim execution thread

Hi,

I think FlexSim usually runs single-threaded, and when used as an experiment tool or optimization it runs multi-threaded.

We have received requests from customers to support multi-threading in normal simulations to speed up normal simulations. Are there any plans for FlexSim to support multi-threading in the future?


thanks in advance.

FlexSim 23.0.9
simulation speedmulti-thread
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@Ryusuke T, There exists a central element that is responsible for any progress of a model run. That is an event list. A multithreaded program execution needs to benefit of simultaneously executed processes that aren’t depending on a linear sequential structure. Then there is an additional layer of control code that organizes wait cycles and interrupts. This control layer consumes some CPU time, too.

If there is a significant reduction of CPU process time I think the development would already have implemented a multiprocessor usage.

1 Like 1 ·

1 Answer

Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered Ryusuke T commented

Some GPU tasks are currently in separate threads but as Jörg mentions, Discrete Event simulation using the event list by its nature is single threaded.

FlexSim runs very fast when the modelling is done correctly. If it's running slowly first check that the model is correctly formed. If you're unsure, then you can profile the events and/or post the model in the forum asking if it can be sped up. You can also improve the hardware on which you're running the single thread. Finally instead of running each replication for a long time, you may be able to do more replications for a shorter time - which allows you to step further towards being massively parallel. Shorter replications also mean that if you find a case that needs debugging in one or more replications, you need less time to run to, diagnose and fix the issue.


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ryusuke T avatar image Ryusuke T commented ·

@Jason Lightfoot ,

Thank you for answering.

Is it correct that FlexSim is so fast that it has been determined that a single thread is sufficient?

If the model data is slow, we will review how to create it, and if the problem is still not resolved, we may consult with you.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Ryusuke T commented ·
I think it's more accurate to say that there are limited opportunities to improve the speed of execution through the use of multiple threads. There could be model specific cases where you might be doing a lot of vector/matrix calculations or where you're querying data heavily during the model run that could benefit from some parallel threading or CPU acceleration (ag.AVX), but for the core event functionality this is likely not the case.
0 Likes 0 ·
Ryusuke T avatar image Ryusuke T Jason Lightfoot ♦♦ commented ·

Thank you for answering.

I was able to understand.

Thank you for a polite answer.

0 Likes 0 ·