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

setNumThreads not working in maven distribution #23

Open
austin-sandia opened this issue Oct 20, 2017 · 5 comments
Open

setNumThreads not working in maven distribution #23

austin-sandia opened this issue Oct 20, 2017 · 5 comments

Comments

@austin-sandia
Copy link

austin-sandia commented Oct 20, 2017

Hi,

I am using this jar:
https://mvnrepository.com/artifact/com.intel.analytics.bigdl.native/mkl-java/0.2.0

When I run the (Kotlin) code below

println("${MKL.getMklNumThreads()}, ${MKL.getNumThreads()}")
MKL.setNumThreads(2)
println("${MKL.getMklNumThreads()}, ${MKL.getNumThreads()}")

my output is

1, 1
true
1, 1

I see that there is a libiomp5.so in the jar. Any idea why setNumThreads isn't working?

Thanks.

@austin-sandia austin-sandia changed the title setNumThreads not working in mvn version setNumThreads not working in maven distribution Oct 20, 2017
@i8run
Copy link
Contributor

i8run commented Oct 23, 2017

Hi amuseoffire,

You should use getNumThreads instead of getMklNumThreads.

The getMklNumThreads() in mkl-java is used for getting the number of threads user defined through java property bigdl.mklNumThreads .

String mklNumThreadsStr = System.getProperty("bigdl.mklNumThreads", "1");

This project is mainly for https://github.com/intel-analytics/BigDL. So it contains some methods/functions which just fit to BigDL.

@austin-sandia
Copy link
Author

Hi,

Thank you for your response.

I am seeing the same behavior with MKL.getNumThreads(). Here's the code:

println("${MKL.getNumThreads()}")
MKL.setNumThreads(2)
println("AFTER CHANGE")
println("${MKL.getNumThreads()}")

And the output is still this:

1
AFTER CHANGE
1

Any suggestions?

Thanks.

@i8run
Copy link
Contributor

i8run commented Oct 25, 2017

Hi,

Thanks for your test. :) It's due to the bug (wrong usage of omp_get_num_threads). I will push the fix soon.

@austin-sandia
Copy link
Author

Thank you. When might I be able to pick up the fix on maven?

@i8run
Copy link
Contributor

i8run commented Oct 30, 2017

Hi, we have pushed to sonatype with 0.4.0-SNAPSHOT. You can try it now. Any question is welcomed.

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

2 participants