Meaning of routine GetNOFColours

Numerical methods and mathematical models of Elmer
Post Reply
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Meaning of routine GetNOFColours

Post by spacedout »

Good day everybody

I would assume GetNOFColours(Solver) has nothing to do with colors in a photo. I see it being used in conjunction with OpenMP directives
( anything that starts with !$OMP ) but comments associated with colours are very scanty in the Elmer code.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Meaning of routine GetNOFColours

Post by raback »

Hi

When you use threads you can assemble several elements at the same time such that each thread treats one element at a time. To avoid the race conditions i.e. issues that appear when several threads try to write on the same memory locations something needs to be done. The idea is to split the mesh into a few "colours" such that for a given colour no two elements share a node. This way within this colour the race conditions are eliminated.

Generally OpenMP is supported in parts of the code only. There are many legacy solvers that do not get any additional benefit from threads. There are few vectorized solvers (with suffix "vec"). The MPI is better supported and often it is the better strategy to benefit from having several cores.

-Peter
Post Reply