Speeding up my simulation

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
Klemmkeil
Posts: 24
Joined: Sun Apr 04, 2021 11:12 am

Speeding up my simulation

Post by Klemmkeil »

Hello everyone,
i would like to increase the speed of my simulation by utilizing the maximum ressources of my computer.
I got the AMD Ryzen 9 5950X as CPU and 128GB of RAM, so there are much ressorces left unused.
Which changes in properties and additional software are needed to get the best performance with FreeCAD?
I'm using FreeCAD 0.20, downloaded it yesterday

Greetings Nic
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Speeding up my simulation

Post by bernd »

What exactly would you like to speed up?

- solving FEM in FreeCAD
- meshing for FEM in FreeCAD
- workflow inside FreeCAD
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Speeding up my simulation

Post by Kunda1 »

Klemmkeil wrote: Fri Jul 23, 2021 7:23 am I'm using FreeCAD 0.20, downloaded it yesterday
Please always copy/paste your full About info, especially when it comes to FEM since it is constantly under development.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Klemmkeil
Posts: 24
Joined: Sun Apr 04, 2021 11:12 am

Re: Speeding up my simulation

Post by Klemmkeil »

Here my about:
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.25065 (Git)
Build type: Release
Branch: master
Hash: 4de2ad46b2b9c78ac2721a0dbea7c19306261095
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)

I would like to speed up FEM-solving.

Meshing is often linked with problems( my experienc in older Version)
Most of the time i mesh in Gmsh or Netgen directly and import it.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Speeding up my simulation

Post by bernd »

Speeding up Calculix solving should be easy. Calculix supports multiprozessor. There is even a pref in FreeCAD FEM where you can set the number of cores. But for this you have to set the solver to spooles. Give it a try. Would be cool if you could reoport back if it had worked for you.

cheers bernd
Klemmkeil
Posts: 24
Joined: Sun Apr 04, 2021 11:12 am

Re: Speeding up my simulation

Post by Klemmkeil »

You mean this settings?
I used it allready over a longer time.
But it uses maybe up to 3% of my CPU.
Most of the Time i run 6 or 7 simulation at the same Time to get a good usage.
Spooles is the fastet solver ?
Attachments
Settings.PNG
Settings.PNG (8.26 KiB) Viewed 1950 times
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: Speeding up my simulation

Post by twangrt »

I have been having some issues on linux and macOS, that the setting for multithreading in preferences doesn't work.

Look at the output from the console after solving:

Code: Select all

Using up to X cpu(s) for spooles.
Here is a fix to get around the problem:
https://forum.freecadweb.org/viewtopic. ... 3&start=10

Code: Select all

import multiprocessing
import os
cpu_cores = multiprocessing.cpu_count()  # this finds number of your CPUs and use them all
os.putenv('OMP_NUM_THREADS', str(cpu_cores))
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Speeding up my simulation

Post by heda »

brilliant, btw - assuming that it works - would it not be a permanent fix if that was included in source?
Klemmkeil
Posts: 24
Joined: Sun Apr 04, 2021 11:12 am

Re: Speeding up my simulation

Post by Klemmkeil »

The macro worked for me.
Now I'm using my whole CPU.
Attachments
CPU USE.PNG
CPU USE.PNG (29.13 KiB) Viewed 1870 times
Post Reply