Welcome! Log In Create A New Profile

Advanced

OpenSCAD on Windows multi-core processors

Posted by keewhip 
OpenSCAD on Windows multi-core processors
September 12, 2011 07:38AM
Anybody managed to compile openscad for multi-threaded processes in windows?
When I use complicated libraries on my quad-core processor the compile and render process takes really long (few hours) while it only uses 25% of my cpu...
Re: OpenSCAD on Windows multi-core processors
September 12, 2011 11:45AM
It isn't just a matter of recompiling it. It would need to be re-coded to split rendering tasks between threads. Not easy, and may not even be possible with the libraries that it uses to do the actual rendering.

This is the general problem with modern software. CPUs are no longer getting any faster, they just get more cores. OK if you run lots of programs, but if you want to run one program fast it has to be completely re-engineered.


[www.hydraraptor.blogspot.com]
Re: OpenSCAD on Windows multi-core processors
December 24, 2011 11:51AM
"When I use complicated libraries on my quad-core processor the compile and render process takes really long (few hours) while it only uses 25% of my cpu... "

This might in theory be due to exhaustion of your physical RAM, and the computer doing swap thrashing to disk. The IO system cannot feed the data fast enough to the CPU so it sits there waiting around for the disk. This diagnosis can be verified by looking at various tools that show your swap space and memory usage alongside your CPU usage, like sysmon.

"It isn't just a matter of recompiling it. It would need to be re-coded to split rendering tasks between threads. Not easy, and may not even be possible with the libraries that it uses to do the actual rendering. "

This is exactly right, OpenSCAD is built on top of the CGAL geometry system (F6 render), and OpenCSG (F5 render), neither of which are parallellized at all. Some people have been experimenting with parallelizing CGAL, but they haven't gotten very far.

[www.mendeley.com]

The problem seems to be they dont just have to re-code it, they have to re-invent the algorithms of CGAL... and CGAL has been around for 10+ years, so that's a lot of re-inventing to do.

Theoretically OpenSCAD could use a different back-end library, but that would take a lot of work. First, you have to find a backend library thats parallelized. Is OpenCASCADE parallelized? dont know.
If your running on a 64 bit Windows environment, You could try using 32 bit version of Python, I have been having endless problems with Python 2.7.2 64bit, change to 32bit and everything works great. Just my 2cents worth tongue sticking out smiley

Cheers
Re: OpenSCAD on Windows multi-core processors
September 18, 2015 07:03AM
The CGAL "tree" where it adds different bits of geometry is in fact a tree.

I believe that it can be multithreaded because at first they combine the leaf elements and then afterwards, the trunk... So the first combinations could be done on 4 processors, and afterwards it could be narrowed to one on the last... But CGAL coders havent coded that part for the moment.
Sorry, only registered users may post in this forum.

Click here to login