+
Skip to content

Multithreading isn't doing multithreading. #50

@Tyler-Barnes

Description

@Tyler-Barnes

I am working on a complex fractal mesh and noticed that my threadripper is being woefully under-utilized.

Looking at the process manager I can see that the 48 workers reported in the console is not accurate, and it's running single threaded pretty much.

I see in the source there are details that outline a threadpool, but I'm worried that the Global Interpreter Lock is not being bypassed for true multithreading. And that the current object structure is not picklable.

I played around with trying to get it to work, and got something running. However, I understand that the resulting sdf object structure is pretty far removed from the native implementation.

Feel free to take this implementation for adaptation, or to try and get the current structure working with multithreading. I just wasn't able to get multiple threads actually running with the current source.

Here is the execution time for the default mandelbulb with 200**3 samples:

min -1.29456, -1.29456, -1.34752
max 1.29457, 1.29457, 1.34752
step 0.0131198, 0.0131198, 0.0131198
8822592 samples in 343 batches with 48 workers
  100% (343 of 343) [##############################] 0:03:59 0:00:00    
0 skipped, 226 empty, 117 nonempty
355942 triangles in 240.053 seconds

and then the execution time for the multithreaded implementation:

min -1.29456, -1.29456, -1.34752
max 1.29457, 1.29457, 1.34752
step 0.0131198, 0.0131198, 0.0131198
8822592 samples in 343 batches with 48 workers
  100% (343 of 343) [##############################] 0:00:07 0:00:00    
0 skipped, 226 empty, 117 nonempty
355942 triangles in 8.14684 seconds

Great project; I've been having a ball working with it. Thanks!

(can't upload .py extension for some reason; using .txt instead)
Default_Mandelbulb.txt
Multithreaded_Mandelbulb.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载