How to distribute CPU intensive operations?

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
ceremcem
Posts: 208
Joined: Sun Jan 07, 2018 11:10 am

How to distribute CPU intensive operations?

Postby ceremcem » Sat Aug 10, 2019 10:00 pm

FEM analysis requires some steps that require huge computation times (minutes to hours depending the complexity and the size of the model), such as generating the mesh, creating the .inp file and running CalculiX.

Is there a way to distribute those operations across computers?
fandaL
Posts: 351
Joined: Thu Jul 24, 2014 8:29 am

Re: How to distribute CPU intensive operations?

Postby fandaL » Sun Aug 11, 2019 9:11 am

In general, first, I would recommend to use appropriate approach: if possible use model symmetry, appropriate element type (1d, 2d, 3d) and mesh size or even use hand calculations instead of FEA, ... All this should correspond with output (precision) you require.
ceremcem wrote:
Sat Aug 10, 2019 10:00 pm
Is there a way to distribute those operations across computers?
I’m not aware of distributing a task between more computers (except that you can generate inp file on PC and run analysis on stronger computer/cloud), but CalculiX is able to use more CPU threads. Look at
Edit → Preferences → FEM → CalculiX → Solver defaults → Number of CPU's to use

When using GMSH, you can also use local mesh refinement where you are interested in higher precision by "FEM mesh region"
User avatar
ceremcem
Posts: 208
Joined: Sun Jan 07, 2018 11:10 am

Re: How to distribute CPU intensive operations?

Postby ceremcem » Sun Aug 11, 2019 12:18 pm

fandaL wrote:
Sun Aug 11, 2019 9:11 am
In general, first, I would recommend to use appropriate approach: if possible use model symmetry, appropriate element type (1d, 2d, 3d) and mesh size or even use hand calculations instead of FEA, ... All this should correspond with output (precision) you require.
I'm not aware of any math operations or processes taking place under the hood of FEA (I'm electronics engineer). However I understand that I should learn it immediately if this is a must.
ceremcem wrote:
Sat Aug 10, 2019 10:00 pm
[...] but CalculiX is able to use more CPU threads.
AFAIK, a code (calculation work of an algorithm) can only be distributed among the CPU threads or cores if it is designed specially to be able to map (partition the calculations) and reduce (merge the results). If CalculiX can use multiple threads/cores then theoretically it should be able to map and reduce its operations. If we could briefly know the internals, then we could split the data accordingly, send to several computers (eg. over SSH), compute the sub-results, then fetch them and merge to achieve the actual result.
ickby
Posts: 2935
Joined: Wed Oct 05, 2011 7:36 am

Re: How to distribute CPU intensive operations?

Postby ickby » Mon Aug 12, 2019 8:10 am

It depends on the solver implementations, but some support it over MP, e.g. elmer and fenics. Especially elmer should work in freecad pretty well. So you should carefully choose the right solver and than try to use their capabilities.