DiscussionsIssue archiveOCCT:Visualization

Archived issue #0024050

Voxel_FastConverter::Convert / ConvertUsingSAT - problems in multithreaded scenario

CommunityOCCT:Visualizationclosed2 public notes

Search issues

Description

Both methods mentioned above use the following code to judge which triangles to process in the specified thread:

start_thread_triangle = (ithread - 1) * (myNbTriangles / myNbThreads) + 1;
end_thread_triangle = (ithread - 0) * (myNbTriangles / myNbThreads);

That code gives incorrect results for some cases due to the fact that the computation is carried out on integer numbers, e.g.:

myNbTriangles = 12; //Box
myNbThreads = 8;

(myNbTriangles / myNbThreads) always yields 1 and so the triangle 9 to 12 are never processed.

Public activity

2 archived notes

Participants are labeled by their role within this record.

01Author
Branch CR24050 pushed. Please review.
02Commenter 2
Dear Commenter 2,

Branch CR24050 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)

products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 366479568 / 366290416
Total CPU difference: 42713.9700000004 / 43406.39000000102

Testing on Windows:
Total MEMORY difference: 419173696 / 421068392
Total CPU difference: 34917.359375 / 42645.65625

There are not differences in images found by testdiff.