Run calculix multithreaded

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
flachyjoe
Veteran
Posts: 1891
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Run calculix multithreaded

Post by flachyjoe »

Hi,
when the env variable OMP_NUM_THREADS is set to the number of CPU, CCX calculation is multithreaded.
BUT it's not the case when launched from FreeCAD. Is python able to launch a multithread process ?
- Flachy Joe -
Image
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Run calculix multithreaded

Post by UR_ »

Please set preferences to:

Preferences.png
Preferences.png (89.61 KiB) Viewed 4823 times

and you will get:

Resource Monitor.png
Resource Monitor.png (27.55 KiB) Viewed 4823 times

@bernd:
# of threads and # of cpu's is mixed up, perhaps should be clarified ;)

edit:
to unleash ccx, you should try pardiso build https://xa.yimg.com/df/CALCULIX/calculi ... e=download
I think you have to be registered for download https://groups.yahoo.com/neo/groups/CALCULIX/info



done with:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14426 (Git)
Build type: Release
Branch: master
Hash: 3927a2ed8b009ab4dfdca53fbebf0060193b67b4
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Run calculix multithreaded

Post by bernd »

Do you mean the text in prefs should be: „Number of threads to use (Spooles only)” ?
schupin
Posts: 476
Joined: Sun Jan 21, 2018 1:43 pm

Re: Run calculix multithreaded

Post by schupin »

I've got a related question :

On windows, you've to be admin to set the OMP_NUM_THREADS environnement variable.
If you don't change this value but you do it in the FC FEM preferences (as a non-admin), does it work ?

(sorry, I can't test myself, my strange problem isn't solved yet ...)
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Run calculix multithreaded

Post by UR_ »

schupin wrote: Tue Aug 21, 2018 7:24 pm On windows, you've to be admin to set the OMP_NUM_THREADS environnement variable.
on windows 10 environment variables are divided into two sections:
- system variables (only editable for admins)
- user account variables (editable for non admins too)
So there are no problems setting OMP_NUM_THREADS
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Run calculix multithreaded

Post by UR_ »

bernd wrote: Tue Aug 21, 2018 7:00 pm Do you mean the text in prefs should be: „Number of threads to use (Spooles only)” ?
to be as precise as could be, what's about:

Set OMP_NUM_THREADS to:

BTW,
- other solvers (e.g. pardiso) are using this env var too (not only spooles)
- there are many additional env vars, which are used by ccx to adjust multi threading on several tasks
OMP_NUM THREADS
CCX_NPROC_STIFFNESS
CCX_NPROC_EQUATION_SOLVER
CCX_NPROC_RESULTS
CCX_NPROC_VIEWFACTOR
CCX_NPROC_CFD
CCX_NPROC_BIOTSAVART
User avatar
flachyjoe
Veteran
Posts: 1891
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: Run calculix multithreaded

Post by flachyjoe »

UR_ wrote: Tue Aug 21, 2018 3:38 pm Please set preferences
:oops: Thank you !!
- Flachy Joe -
Image
Kailee71
Posts: 13
Joined: Thu Mar 12, 2020 1:21 am

Re: Run calculix multithreaded

Post by Kailee71 »

Hi all,

I'm running the latest Freecad 0.18.4.980 on Windows 10, two Xeon 5670's. I've been trying to get Calculix to run analyses multithreaded but I'm having no luck (yes, I'm using Spooles). I've tried setting the environment variables as well as changing the prefs, but no combination of these allows Calculix to run on more than one core.

Anyone have an idea what I might be overlooking to get all my cores to share the work?


Cheers,

Kailee.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Run calculix multithreaded

Post by Kunda1 »

Kailee71 wrote: Thu Mar 12, 2020 5:20 pm Hi all,

I'm running the latest Freecad 0.18.4.980 on Windows 10, two Xeon 5670's.
Sidenote: the FEM subforum sticky note says to run the most up to date version of 0.19_pre
https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre
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
Kailee71
Posts: 13
Joined: Thu Mar 12, 2020 1:21 am

Re: Run calculix multithreaded

Post by Kailee71 »

Kunda1 wrote: Thu Mar 12, 2020 5:25 pm
Kailee71 wrote: Thu Mar 12, 2020 5:20 pm Hi all,

I'm running the latest Freecad 0.18.4.980 on Windows 10, two Xeon 5670's.
Sidenote: the FEM subforum sticky note says to run the most up to date version of 0.19_pre
https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre
Hi Thanks for your reply - unfortunately this made no difference; any other pointers?

Code: Select all

0.0: Run CalculiX...
0.0: Starting CalculiX...
0.1: CalculiX is running...
70.2: CalculiX stopped.
70.2: ************************************************************ 
CalculiX Version 2.16, Copyright(C) 1998-2019 Guido Dhondt 
CalculiX comes with ABSOLUTELY NO WARRANTY. This is free 
software, and you are welcome to redistribute it under 
certain conditions, see gpl.htm 
************************************************************ 
You are using an executable made on Sun, Jan 19, 2020 10:23:46 PM 
The numbers below are estimated upper bounds 
number of: 
nodes: 39760 
elements: 26891 
one-dimensional elements: 0 
two-dimensional elements: 0 
integration points per element: 4 
degrees of freedom per node: 3 
layers per element: 1 
distributed facial loads: 0 
distributed volumetric loads: 0 
concentrated loads: 5414 
single point constraints: 5046 
multiple point constraints: 1 
terms in all multiple point constraints: 1 
tie constraints: 0 
dependent nodes tied by cyclic constraints: 0 
dependent nodes in pre-tension constraints: 0 
sets: 5 
terms in all sets: 155590 
materials: 1 
constants per material and temperature: 2 
temperature points per material: 1 
plastic data points per material: 0 
orientations: 0 
amplitudes: 2 
data points in all amplitudes: 2 
print requests: 1 
transformations: 0 
property cards: 0 
*INFO reading *STEP: nonlinear geometric 
effects are turned on 
*WARNING reading *STATIC: a nonlinear analysis is requested 
but no time increment nor step is specified 
the defaults (1,1) are used 
STEP 1 
Static analysis was selected 
Newton-Raphson iterative procedure is active 
Nonlinear geometric effects are taken into account 
Decascading the MPC's 
Determining the structure of the matrix: 
number of equations 
114234 
number of nonzero lower triangular matrix elements 
4335234 
increment 1 attempt 1 
increment size= 1.000000e+00 
sum of previous increments=0.000000e+00 
actual step time=1.000000e+00 
actual total time=1.000000e+00 
iteration 1 
Using up to 1 cpu(s) for the stress calculation. 
Using up to 1 cpu(s) for the symmetric stiffness/mass contributions. 
Factoring the system of equations using the symmetric spooles solver 
Using 1 cpu for spooles. 
Using up to 1 cpu(s) for the stress calculation. 
average force= 0.022719 
time avg. forc= 0.022719 
largest residual force= 0.000579 in node 11397 and dof 2 
largest increment of disp= 6.555358e-03 
largest correction to disp= 6.555358e-03 in node 16 and dof 2 
no convergence 
iteration 2 
Using up to 1 cpu(s) for the symmetric stiffness/mass contributions. 
Factoring the system of equations using the symmetric spooles solver 
Using 1 cpu for spooles. 
Using up to 1 cpu(s) for the stress calculation. 
average force= 0.022722 
time avg. forc= 0.022722 
largest residual force= 0.000000 in node 11393 and dof 2 
largest increment of disp= 6.555358e-03 
largest correction to disp= 5.515313e-07 in node 16 and dof 2 
convergence 
the increment size exceeds the remainder of the step and is decreased to 0.000000e+00 
Using up to 1 cpu(s) for the stress calculation. 
Job finished
70.2: CalculiX done without error!
70.2: Loading result sets...
Post Reply