Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't figure out how to run tests in parallel #264

Closed
sgraf812 opened this issue Jan 24, 2024 · 2 comments · Fixed by #267
Closed

Can't figure out how to run tests in parallel #264

sgraf812 opened this issue Jan 24, 2024 · 2 comments · Fixed by #267

Comments

@sgraf812
Copy link
Collaborator

The test.hs script calls make with -j set to the number of capabilities of the script process. I can't seem to figure out how to increase that number; at the least it does not pick up the number of cpu cores on my machine automatically.
It's a bit annoying, but not too bad: I can just change the script to use -j7 (I have 6 cores). Nevertheless, the script seems a bit misleading.

@andreasabel
Copy link
Member

andreasabel commented Jan 24, 2024

happy/test.hs

Lines 6 to 9 in abcd8c0

main = do
let jFlag = "-j" ++ show numCapabilities
let cmd = ["make", jFlag, "-k", "-C", "tests", "clean", "all"]
system (intercalate " " cmd) >>= exitWith

Have you tried to set it via the +RTS -N flag, as described in the docs ?
https://hackage.haskell.org/package/base-4.19.0.0/docs/GHC-Conc.html#v:numCapabilities

@sgraf812
Copy link
Collaborator Author

I have tried, but it is unclear to me where I should pass it. Is it cabal test +RTS -N7? No (I tried). More likely I'll have to do cabal test --test-options="+RTS -N7 -RTS" but that errors out with ... aha, a useful message:

tests: the flag -N7 requires the program to be built with -threaded

Fix incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants