Welcome, Guest. Please Login.
Gravity Simulator
11/22/17 at 17:45:46
News: Registration for new users has been disabled to discourage spam. If you would like to join the forum please send me an email with your desired screen name to tony at gravitysimulator dot com.
Home Help Search Login


Pages: 1
Send Topic Print
CPU usage (Read 3410 times)
EDG
Ultimate Member
*****


oh, crumbs!!!

Posts: 611
Gender: male
CPU usage
10/29/06 at 23:01:47
 
I split this from the binary eccentricities thread, cos it's probably worth having its own topic.
 
Quote from Tony   on 10/29/06 at 22:45:10:

Just some random thoughts...
Gravity Simulator takes up 50% of your computer's CPU cycles. I've asked on coding forums how to increase this, but have never got a solution. But because of this, you can easily check e-mail, surf the web, etc with gravity simulator running in the background.

 
Well it's doing something weird on my dualcore system. It seems to be using 50% of the CPUs - i.e. one processor's worth - but it's spread out asymmetrically over the two CPUs. One CPU seems to be at about 75%, the other is at 25%. They seem to be the opposite of eachother. And I've got nothing else running that's using up CPU time here. See?:
 

 
AFAIK most other single-CPU programs just use all of one CPU to run, they don't split across two.
Back to top
 
 

(formerly known as Mal)
View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: CPU usage
Reply #1 - 10/29/06 at 23:08:17
 
It might be because Gravity Simulator uses both Visual Basic and C++.
 
Try this... In the folder that contains your gravitysimulator execuatable is a file called "codepotomizer.dll".  This is the integrator written in C++.  Temporarily rename this file so Gravity Simulator can't find it.  This forces Gravity Simulator to use Visual Basic to perform the integrations.  Your sims will run a lot slower as a result.  I'm curious if this make it use only 1 CPU.
Back to top
 
 
Email View Profile WWW   IP Logged
EDG
Ultimate Member
*****


oh, crumbs!!!

Posts: 611
Gender: male
Re: CPU usage
Reply #2 - 10/29/06 at 23:14:21
 
Quote from Tony   on 10/29/06 at 23:08:17:
It might be because Gravity Simulator uses both Visual Basic and C++.

Try this... In the folder that contains your gravitysimulator execuatable is a file called "codepotomizer.dll". This is the integrator written in C++. Temporarily rename this file so Gravity Simulator can't find it. This forces Gravity Simulator to use Visual Basic to perform the integrations. Your sims will run a lot slower as a result. I'm curious if this make it use only 1 CPU.

 
Didn't seem to make any difference...
Back to top
 
 

(formerly known as Mal)
View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: CPU usage
Reply #3 - 10/29/06 at 23:20:10
 
Also, I'm curious about the speed difference between different computers.  Can you perhaps run your original sim (750 AU) and just time with a clock or stopwatch how many simulated years at a given timestep elapse over a 1 minute period.  I'm wondering if a dual processor is worth it.
 
Ultimately, I'd like to create a bank of computers, joined through a KVM (Keyboard, Video, Mouse) switch for use with Gravity Simulator, so I could run several sims at the same time.
 
As it is, I've got pleanty of things I'd like to test but I don't have the patience to dedicate my desktop computer to running a single sim for 2 weeks straight.
 
But I'd want to choose the best computers for the bank.  I don't care about anything other than speed.  I don't even need CD roms, built-in audio cards, etc.  I understand that processor speed is not the only consideration.  Some CPUs are faster for the same GHZ in certain instances (or so says my last programming teacher).  And I have no experience with dual CPU machines.  Any thoughts??
Back to top
 
 
Email View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: CPU usage
Reply #4 - 10/29/06 at 23:22:16
 
Quote from Mal   on 10/29/06 at 23:14:21:


Didn't seem to make any difference...

In that case, I'm out of guesses.  With the file renamed, Gravity Simulator is just a regular-ol Windows application written in VB 6.0.  I can't think of any trickery I've done to make it utilize both processors.
Back to top
 
 
Email View Profile WWW   IP Logged
EDG
Ultimate Member
*****


oh, crumbs!!!

Posts: 611
Gender: male
Re: CPU usage
Reply #5 - 10/30/06 at 07:15:42
 
Quote from Tony   on 10/29/06 at 23:20:10:
Ultimately, I'd like to create a bank of computers, joined through a KVM (Keyboard, Video, Mouse) switch for use with Gravity Simulator, so I could run several sims at the same time.

 
Honestly, I think that's a poor use of the computers. As it is GravSim isn't designed to use more than one CPU's worth of processor at a time, and a calculation-intensive program like this really NEEDS to be able to use multiple processors to be at its most efficient.  
 
What we really need I think is the ability to run GravSim properly on more than one processor. That way you could run a single week long sim in one day if you had 7 computers running it (and if you had dualcore, then you'd be able to do the week long sim in half of THAT time since it'd be running on 14 CPUs instead of 7).  
 
That's how scientists run their models - when I was doing my postdoc I was running my internal structure models on a cluster. Come to think of it, my own program wasn't even multiprocessor enabled, it used a script to divide its tasks among the multiple CPUs. If you can split GravSim's algorithm up like that somehow, then maybe you can get that to work too. All that said though, I'm not entirely sure how you can do it - my models were looking through a range of phase space, so I could allocate each part of that to different CPUs, whereas GravSim is just running one model... it's not like you can get one CPU to calculate the first thousand years, and the next CPU to calculate the next thousand years, and so on, because you don't know where the planets etc will be after the first 1000 years.
Back to top
 
 

(formerly known as Mal)
View Profile WWW   IP Logged
Tony
YaBB Administrator
*****




Posts: 1051
Gender: male
Re: CPU usage
Reply #6 - 10/30/06 at 10:25:54
 
But the advantage of doing it this way is that its ready now.  I don't have to learn how to program across several CPUs.
 
Being able to run a sim uninterrupted for several weeks would open the door to a lot more possibilities.  Having dedicated computers would be able to accomplish that.
Back to top
 
 
Email View Profile WWW   IP Logged
EDG
Ultimate Member
*****


oh, crumbs!!!

Posts: 611
Gender: male
Re: CPU usage
Reply #7 - 10/30/06 at 15:26:58
 
I suppose it would. Plus I can't think of how one would split a run across multiple processors anyway...
 
I'll have to try running two sims at once on my machine and see what happens...
Back to top
 
 

(formerly known as Mal)
View Profile WWW   IP Logged
Pages: 1
Send Topic Print