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

facing unknown errors while compiling exact similar code for parallelization on CPU #7

Closed
dnabanita7 opened this issue Jan 31, 2020 · 4 comments

Comments

@dnabanita7
Copy link

julia> using BenchmarkTools

julia> @btime sequential_add!($y, $x)
  440.219 μs (0 allocations: 0 bytes)

julia> @btime parallel_add!($y, $x)
  464.534 μs (29 allocations: 3.00 KiB)

julia> @btime parallel_add!($y, $x)
  462.620 μs (29 allocations: 3.00 KiB)

julia> versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4

Here, the time taken by parallel_add() is more than sequential_add(). I am not able to figure out why is this happening.

@dnabanita7 dnabanita7 changed the title facing unknown errors while conducting exact similar code for parallelization on CPU facing unknown errors while compiling exact similar code for parallelization on CPU Jan 31, 2020
@vchuravy
Copy link
Member

vchuravy commented Feb 2, 2020

How big is your problem size? Parallelization requires setup time which is a constant overhead. SO what happens if you increase the amount of work by 10x? What is your code?

@dnabanita7
Copy link
Author

Its a simple addition of N = 2^20 numbers. It is in the docs

@maleadt
Copy link
Member

maleadt commented Mar 10, 2020

The bug tracker isn't a place for these questions, please open a Discourse thread with some more details (implementations of these functions, which GPU, etc) or drop by Slack if you have questions.

@maleadt maleadt closed this as completed Mar 10, 2020
@dnabanita7
Copy link
Author

Its resolved.

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

No branches or pull requests

3 participants