[Libmesh-users] Problem with parallel execution of element loop #3086
-
The following code fragment is part of a program that behaves correctly when invoked to run on a single processor (ie using : mpirun -n 1 main)
However, when I invoke it with several processors (ie using mpirun -n 4 main), the BoundaryInfo object does not contain all of the sidesets that it contains on a single processor. I suspect that the issue here is that several processors are writing to the same memory location (ie the BoundaryInfo object) without appropriate synchonization/mutex code. I certainly didn't add any such code. Is my suspicion correct or are there other problems with the code? In the former case, can someone point me to some correct code in which mesh elements are processed in parallel and a common data structure is modified by each thread/process? dan |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think you are seeing the expected behavior since you are looping over "local" elements. The
APIs for syncing this data across processors. |
Beta Was this translation helpful? Give feedback.
I think you are seeing the expected behavior since you are looping over "local" elements. The
BoundaryInfo
object is not shared by the processors... there is a separate copy of the BoundaryInfo object on each processor and each will contain only boundary info about local elements after running the loop above. The BoundaryInfo class also provides theAPIs for syncing this data across processors.