I never thought to try this, but the reason it doesnโt work is that values other than true/false are interpreted differently. The default behaviour does this:
@tullio y[j] = X[i,j] verbose=2
...
(Tullio.threader)(๐๐ธ๐!, (Tullio.storage_type)(y, X), y, tuple(X), tuple(๐ถ๐j), tuple(๐ถ๐i), +, 262144, nothing)
where the argument 262144 is the macroโs estimate of how big X must be to justify multi-threading, based on the function not containing log etc. Which threader then uses once the actual size of X is known.
The option threads=false replaces that with nothing, which disables threader completely. But anything else is assumed to be a different threshold:
@tullio threads=tf y[j] = X[i,j] verbose=2
...
(Tullio.threader)(๐๐ธ๐!, (Tullio.storage_type)(y, X), y, tuple(X), tuple(๐ถ๐j), tuple(๐ถ๐i), +, tf, nothing)
So a possible hack would be to write threads=ts where ts == tf ? nothing : 100^2. But itโs possible that this design ought to change.
Indeed, if you write @tullio threads=false at the top of the file, then all subsequent macro calls will use that. But these global macro options affect the parse-time behaviour, not the running of already-parsed code.