Thanks for the hint. That seems to be the reason!

I have a couple of follow up questions so that I learn more about Julia. 
Would be nice if someone takes a couple of minutes to educate me.

I found a simple example reproducing my issue:

module FooBar

# Including BlackBoxOptim causes type instability for exponents

using BlackBoxOptim

# Multiplying instead of exponentiating works fine, even when using 
BlackBoxOptim

f(a::Float64, b::Float64) = a^b

end

If I run @code_warntype with and without BlackBoxOptim for the code above, 
it is clear that it causes the type instability.

With BlackBoxOptim:

<https://lh3.googleusercontent.com/-nMINsUdVczQ/WACQBV0dbKI/AAAAAAAAAbM/tjGkVdRnZyokgT437RE36epcLaXko6zBgCLcB/s1600/type_instable.PNG>


Without BlackBoxOptim:


<https://lh3.googleusercontent.com/-22PONOOPYAk/WACQIi_fZOI/AAAAAAAAAbQ/WHDojaNHKPk-6u3fmeIOERTntO74eo0jQCLcB/s1600/type_stable.PNG>


For my real code, the @code_warntype macro produces identical results 
whether I use BlackBoxOptim or not even though one is type unstable.

*Question 1 + related ones :) :* Is there an alternative way to check type 
instability which is more detailed but still halfway easily readable? Would 
it be possible to detect the issue with @code_llvm or similar? I tried to 
write @code_llvm to a file since the output is very long, but never 
succeeded. Is this possible?

*Question 2:* When the issue 18465 is fixed, will that end up in Julia 
0.5.1 or is a fixed version available already before that somewhere?

Many thanks for any help. I really like to work with Julia so some input 
would be highly appreciated.

Jan


Reply via email to