View Single Post
  #16 (permalink)  
Old 16-April-2007, 08:13 PM
tony873004 tony873004 is offline
Established Member
 
Join Date: Mar 2005
Location: San Francisco
Posts: 1,116
Default

Quote:
Originally Posted by publius View Post
Tony,

Is the source code for your simulator available? If it's "trade secrets", then no problem.

The reason I ask is I'd like to run it through Intel's C++ compiler and compare it. That sucker does vectorizing and parallelizing for multi-CPUs (and multi-core and hyperthreading) and I always like to see if it's as good as they like to brag about. It has impressed me with other stuff.

-Richard
Gravity Simulator is written in Visual Basic 6.0, with the exception of the number-crunching routine. It's written in C++ since C++ is much faster than VB 6.0, and this is the only part of the program where speed is advantagous.

The C++ code is compiled into a .dll. The VB code calls this routine once per iteration. I provided a link to the C++ code above. No trade secrets here. It's just a basic Euler's method propogating formulas from your High School Physics book. I guess it would be as easy as copying it, pasting it, and compiling it into a .dll using Intel's compiler. I used Visual C++.Net.

Assuming that works, and assuming you have Gravity Simulator installed on your computer, you simply need to replace the file "codeoptomizer.dll" with your replacement .dll. Just rename the old one incase you want to restore it. Then to test speeds, you want to run Gravity Simulator with the graphics turned off. This forces the program to only crunch the numbers.

I'd be very interested to see if a different compiler would make a big difference. So if you attempt this, let me know.

BTW, if you want to see a comparison between the speed of VB 6.0 and .NET compiled C++, simply rename codeoptomizer.dll, so VB can't find it. This forces it to use VB to do the math. I believe the difference in speed is a factor of 6.
__________________
www.gravitysimulator.com
Reply With Quote