Hello,
I am writing a multi-threading of my code, but I would like to write unit tests to make sure I get the same results as in the serial case.
I am thinking of doing:
- execute export JULIA_NUM_THREADS=6 in the bash
- open julia and activate the environment of my package
- run the tests
Is it the way to do?
jling
2
yes that should work,
also if you’re working with CI:
2 Likes
tkf
3
Yet another way:
PerformanceTestTools.@include_foreach(
"tests_using_threads.jl",
[nothing, ["JULIA_NUM_THREADS" => Threads.nthreads() > 1 ? "1" : "6"]],
)
ref Home · PerformanceTestTools.jl
4 Likes
Thank you for the references!