Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mc] initial pass at multithreaded #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[mc] initial pass at multithreaded #52

wants to merge 1 commit into from

Conversation

sjkelly
Copy link
Member

@sjkelly sjkelly commented Oct 18, 2019

Partially addresses #24. Performance improvements are across the board good. The single threaded case suffers a bit though.

Performance (median time on Torus)
Master:
SDF - 2.721 ms
Func - 6.745 ms

Threads = 6:
SDF - 2.212 ms
Func - 2.699 ms

Threads = 1:
SDF - 3.818 ms
Func - 7.313 ms

@sjkelly
Copy link
Member Author

sjkelly commented Oct 18, 2019

Test pass on travis since it is running single thread, but fail locally on multiple threads. I may need to rework the tests to handle the non-determinism of threads.

@sjkelly
Copy link
Member Author

sjkelly commented Oct 27, 2019

steve@sjkdsk1:~/.julia/dev/Meshing (sjk/threads3)$ export JULIA_NUM_THREADS=6;

steve@sjkdsk1:~/.julia/dev/Meshing (sjk/threads3)$ juliamaster ./bench/benchmark.jl 
Benchmarking Meshing.jl...

SDF Mesh
3-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.06 MiB
	  allocs estimate:  88
	  --------------
	  minimum time:     1.508 ms (0.00% GC)
	  median time:      1.779 ms (0.00% GC)
	  mean time:        1.804 ms (0.75% GC)
	  maximum time:     3.724 ms (0.00% GC)
	  --------------
	  samples:          2767
	  evals/sample:     1

Function Mesh
2-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.07 MiB
	  allocs estimate:  171
	  --------------
	  minimum time:     1.917 ms (0.00% GC)
	  median time:      2.211 ms (0.00% GC)
	  mean time:        2.280 ms (0.64% GC)
	  maximum time:     4.649 ms (0.00% GC)
	  --------------
	  samples:          2191
	  evals/sample:     1


steve@sjkdsk1:~/.julia/dev/Meshing (sjk/threads3)$ export JULIA_NUM_THREADS=1;

steve@sjkdsk1:~/.julia/dev/Meshing (sjk/threads3)$ juliamaster ./bench/benchmark.jl 
Benchmarking Meshing.jl...

SDF Mesh
3-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.05 MiB
	  allocs estimate:  51
	  --------------
	  minimum time:     3.144 ms (0.00% GC)
	  median time:      3.411 ms (0.00% GC)
	  mean time:        4.685 ms (0.91% GC)
	  maximum time:     1.360 s (1.73% GC)
	  --------------
	  samples:          1060
	  evals/sample:     1

Function Mesh
2-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.07 MiB
	  allocs estimate:  136
	  --------------
	  minimum time:     6.509 ms (0.00% GC)
	  median time:      7.035 ms (0.00% GC)
	  mean time:        7.459 ms (0.27% GC)
	  maximum time:     286.279 ms (0.00% GC)
	  --------------
	  samples:          671
	  evals/sample:     1

steve@sjkdsk1:~/.julia/dev/Meshing (sjk/threads3)$ git checkout master

steve@sjkdsk1:~/.julia/dev/Meshing (master=)$ juliamaster ./bench/benchmark.jl 
Benchmarking Meshing.jl...

SDF Mesh
3-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.05 MiB
	  allocs estimate:  40
	  --------------
	  minimum time:     2.786 ms (0.00% GC)
	  median time:      3.097 ms (0.00% GC)
	  mean time:        4.336 ms (0.92% GC)
	  maximum time:     1.390 s (1.43% GC)
	  --------------
	  samples:          1144
	  evals/sample:     1
Function Mesh
2-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "MarchingCubes{Float64}" => BenchmarkTools.Trial: 
	  memory estimate:  1.05 MiB
	  allocs estimate:  46
	  --------------
	  minimum time:     5.757 ms (0.00% GC)
	  median time:      6.217 ms (0.00% GC)
	  mean time:        6.720 ms (0.29% GC)
	  maximum time:     296.505 ms (0.00% GC)
	  --------------
	  samples:          744
	  evals/sample:     1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant