ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Gripes and Goodies
Downloads

Gripes and Goodies Software problems and suggestions

  #1  
Old 05-21-2008
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 171
KelvinHo will become famous soon enough
Default Duel Core CPU usage

Hi all,

I notice that while running the model, the CPU usage is only 50%, (see attachment)I think it might be the Duel COre CPU issue. In order to speed up the simulation, is there anyway to use more than 50% CPU resource?

Also attach with my comp config

Kelvin
Attached Thumbnails
Click image for larger version
Name:	flexsim  CPU usage.jpg
Views:	384
Size:	70.4 KB
ID:	282   Click image for larger version
Name:	config.jpg
Views:	363
Size:	44.0 KB
ID:	283  
  #2  
Old 05-22-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Kelvin,

No there is currently not a way to use both processors on a dual core machine. The reason for this is that Flexsim can not run on more than one thread. Multi-threaded applications need to be OK with different functions happening in non-specific orders but discrete event simulations require that events happen in very specific orders.

We are working on ways to try and make this possible in future releases but it is a very hard problem to solve in a way that makes it easy to implement for the user.

Brandon
__________________
thats not normal.
  #3  
Old 05-22-2008
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Kelvin,
If you are doing an experiment and want to finish the experiment faster, you can always run two instances of Flexsim at the same time, with one doing one experiment and the other doing another experiment. This will let you use the whole CPU, but you just won't be able to merge the experiments at the end (unless you can get into the tree structure and do some scripting to merge the two).

Also, I've done some experimenting with using OpenMP, a somewhat well known multithreading standard, in a project I've done. I haven't been able to get it to work yet, but there is potential there. However, the benefit will probably be marginal because, as Brandon said, discrete event simulation and multithreading don't go together naturally. There is a lot of sorting, ordered search, etc., and those just aren't things that lend themselves well to multithreading. Perhaps the "multiple instances of Flexsim" solution is the way to go, and we should just have an easier mechanism for merging experiment results.
  #4  
Old 05-26-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi, till now I was convinced that running more than one instance of Flexsim at a time on one machine will cause some conflicts?
So can I run two instances or more at once without problems?
__________________
kind regards Nico.
  #5  
Old 05-26-2008
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

There are problems with running two instances of Flexsim if you have to compile your model, because that uses some shared files in the program directory, which can cause problems. But if your models do not need to be compiled, then you can run as many instances of Flexsim as you like.
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post:
RalfGruber (06-05-2008)
  #6  
Old 03-09-2010
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 138
juan alberto is on a distinguished road
Default

Quote:
Originally Posted by Brandon Peterson View Post
Kelvin,

No there is currently not a way to use both processors on a dual core machine. The reason for this is that Flexsim can not run on more than one thread. Multi-threaded applications need to be OK with different functions happening in non-specific orders but discrete event simulations require that events happen in very specific orders.

We are working on ways to try and make this possible in future releases but it is a very hard problem to solve in a way that makes it easy to implement for the user.

Brandon
Any news on this?

Have you solved that you can run Flexsim with different cores?

Thanks !!
  #7  
Old 03-09-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Anthony has answered this already, so these are just additional notes.

If you switch on some advanced graphics features (antialiasing etc.. through the manufacturers GPU control panel) you will probably start to see that the other core(s) used as it can aid the graphics processor - so it seems you can make your models look better with some help from the idle core. Other than that the most consistent benefit in using multiple cores is to run different replications on each core. In this way, the type of problem is 'massively parallel' and the benefit scales linearly with the number of cores.

Currently this is something a fairly capable modeller can solve by not compiling the model (or if necessary putting compiled code in a DLL) managing their stream initialisation using the function randinit (I recommend streams 101 and above which are clear of the ones Flexsim automatically resets). Of course your model needs to be repeatable, which means all variables/labels need to be reset to the same values for each replication and task executers need to be reset to the same position. To collect the results centrally, it might be easiest (depending on the modellers skillset) to use a database and store the scenario and replication against each record.
  #8  
Old 03-09-2010
juan alberto juan alberto is offline
Flexsim User
 
Join Date: May 2009
Location: Valencia, Spain
Posts: 74
Downloads: 14
Uploads: 0
Thanks: 19
Thanked 3 Times in 2 Posts
Rep Power: 138
juan alberto is on a distinguished road
Default

Quote:
Originally Posted by Jason Lightfoot View Post
Anthony has answered this already, so these are just additional notes.

If you switch on some advanced graphics features (antialiasing etc.. through the manufacturers GPU control panel) you will probably start to see that the other core(s) used as it can aid the graphics processor - so it seems you can make your models look better with some help from the idle core. Other than that the most consistent benefit in using multiple cores is to run different replications on each core. In this way, the type of problem is 'massively parallel' and the benefit scales linearly with the number of cores.

Currently this is something a fairly capable modeller can solve by not compiling the model (or if necessary putting compiled code in a DLL) managing their stream initialisation using the function randinit (I recommend streams 101 and above which are clear of the ones Flexsim automatically resets). Of course your model needs to be repeatable, which means all variables/labels need to be reset to the same values for each replication and task executers need to be reset to the same position.
I want to know if I can execute each replication in a different thread. Can you answer it? Thank you!
  #9  
Old 03-09-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Yes you can . But you need to take control of what makes one replication different from another - and usually that is done through controlling the random number stream initialization and making good use of the stream parameter in the time distribution functions so that they match the streams you're taking control over.

There's some example code for generating repeatable stream initialization values based on replication here:
http://www.flexsim.com/community/for...=2314#post2314

These days I think the code can just go in the model reset area.

How you then choose to adjust the replications so that each instance runs a different set, is then up to you . You could use global variable called 'replicationOffset' that you add onto the replication variable in that code. One instance of Flexsim would have an offset of zero and the other could be the half the number of replications you need, which would also be the number you would enter in the experiment table's 'number of replications' field in both instances.

It's not seamless as I've described it here, but it could be, depending on your coding experience and the effort you put in.


Thread Thread Starter Forum Replies Last Post
photo eye usage Martijn van Oostenbrugge Q&A 5 05-07-2008 12:23 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.