Block sparse multithreading warning

Excited to be on this new discussion forum!

I had a question about implementing block sparse multithreading in Julia. My system has 8 threads available. On the terminal, I start Julia using julia -t 8 so that it uses all 8 available cores. And when I run Threads.nthreads() on the Julia REPL, I do get the result 8. However, when I enable block sparse multithreading using ITensors.enable_threaded_blocksparse(), I get the following error message:

“ThreadedWARNING: You are trying to enable block sparse multithreading, but you have started Julia with only a single thread. You can start Julia with N threads with julia -t N, and check the number of threads Julia can use with Threads.nthreads(). Your system has 8 threads available to use, which you can determine by running Sys.CPU_THREADS.”

Despite this error, I do find a speedup in contractions when I run the simple block sparse multithreading code provided here: Multithreading · ITensors.jl.

What is going on? Why do I get the error message, and can I achieve even greater speedups once I remove this error? Thanks!

1 Like

Hi @navya,

Welcome to the forum!

That isn’t an error, just a warning. I’m not sure why you would be getting that warning if you started Julia with multiple threads and confirmed with Threads.nthreads().

However, if you are seeing a speedup, then the multithreading is working, so I wouldn’t worry about the warning so much. It isn’t harmful, it is just supposed to give the user some information that they may not have enabled the multithreading properly.

Could you post a minimal example code and the outputs of versioninfo() and using Pkg; Pkg.status("ITensors") so we can get a better idea for your setup?

Cheers,
Matt

1 Like