Multithreading & Ccall & WIGXJPF

Hello!

I’m trying to modify the WIGXJPF.jl wrapper to make it work with multithreading. Using the code pretty much as is (just adjusting for my personal paths), I get an error reading

wigxjpf: Temp array not allocated. (For this thread?)

Below is the test script I am using to see if multithreading will work. Do I need to modify the init() function of WIGXJPF to make this work? I don’t know C currently so I’m very uncertain of how to proceed.

using Base.Threads
include("./WIGXJPF.jl")
using .WIGXJPF

nthr = nthreads()
out = zeros(Float64,nthr)

@threads for i in 1:nthr
   out[i] = wig3j(nthr,2,nthr,i,0,-i)
end

println(out)

Thanks in advance!