Run Pkg.test with several processors

I have tests that use several processors. If I run julia -p 4 and then Pkg.test I only get 1 as a worker.

1 Like

For now, you have to handroll your parallellization (see https://github.com/JuliaStats/Distributions.jl/blob/master/test/runtests.jl). There’s been some work towards exposing the test infrastructure that Base uses to run the tests to packages, but it isn’t ready yet (and might not happen).

1 Like

Looking at either the link you provide or my CPU load, it does not seem that the tests run in parallel?

Sorry, what is your question?

If the link is correct? I guess the link is supposed to point to a test suite that runs in parallel? Was there maybe an old version of Distributions, with parallel test suite?

You can have a look at our solver:

Unfortunately currently only properly working in julia v0.6 but that part should be the same

Yeah, it was removed in https://github.com/JuliaStats/Distributions.jl/commit/84d6b39c3ccb014b6753909a4e1ef60f9339edbb#diff-fce720c43af3c52c862fd7451c7374b8. I should have linked to the file at a specific commmit.

1 Like

Do you know why it was removed? Is it fragile, does it produce bad error messages? I experimented with similar things as in Distributions.jl, but it was always fragile.

1 Like

Okay thanks. I am looking for something different however. Very much like the situation in Distributions.jl. Run many include("test_foo.jl") in parallel.

As of Julia v1.3 , is there any example on running test sets in parallel, maybe with multi-threading?

1 Like

On my machine, running

cd("$your_pkg_path")
c:\bin\Julia-1.3.1\bin\julia -p auto -e "include(raw\"test\runtests.jl\")"

leads to those ressources usage

BEFORE EXE

and

DURING EXE

It seems test run on all my available cores.
That’s left to tell how we can repro it inside the atom IDE…