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

testsuite: optional 'parallel' target uses GNU parallel to halve testing time #451

Merged
merged 1 commit into from Feb 3, 2016

Conversation

gasche
Copy link
Member

@gasche gasche commented Feb 1, 2016

See the run logs below. Using 'parallel' reduces the time to run the
full testsuite from 2m30s to 0m57s on my machine.

All tests are run in parallel, including lib-threads.

We ask parallel to preserve output order, so it should be
deterministic. (Individual tests may mangle stdout and stderr in
fragile ways, though.) See the Makefile comment for details.

rm -f _log; make clean;
time make all;
cp _log /tmp/trunk_log

> real  2m29.947s
> user  1m35.937s
> sys   0m17.467s

rm -f _log; make clean;
time make parallel;
cp _log /tmp/parallel_log

> real  0m56.611s
> user  2m20.861s
> sys   0m21.511s

diff -u /tmp/{trunk,parallel}_log | wc -l

> 0

rm /tmp/{trunk,parallel}_log

@gasche
Copy link
Member Author

gasche commented Feb 1, 2016

cc @damiendoligez

@mshinwell
Copy link
Contributor

This sounds lovely.

@damiendoligez damiendoligez added this to the 4.03.0 milestone Feb 2, 2016
@damiendoligez
Copy link
Member

You should also update the help text in the default target, and maybe add a Changes entry?

…ng time

See the run logs below. Using 'parallel' reduces the time to run the
full testsuite from 2m30s to 0m57s on my machine.

All tests are run in parallel, including lib-threads.

We ask parallel to preserve output order, so it should be
deterministic. (Individual tests may mangle stdout and stderr in
fragile ways, though.) See the Makefile comment for details.

```
rm -f _log; make clean;
time make all;
cp _log /tmp/trunk_log

> real	2m29.947s
> user	1m35.937s
> sys	0m17.467s

rm -f _log; make clean;
time make parallel;
cp _log /tmp/parallel_log

> real	0m56.611s
> user	2m20.861s
> sys	0m21.511s

diff -u /tmp/{trunk,parallel}_log | wc -l

> 0

rm /tmp/{trunk,parallel}_log
```
@gasche
Copy link
Member Author

gasche commented Feb 2, 2016

@damiendoligez I included a Changes entry (ah, those pesky maintainer requirements...)

I also included some logic to fail informatively when the tool is not present on the user's machine. The current output if you run a parallel* target on a machine that does not have parallel is the following:

/bin/sh: parallel: command not found
Unable to run the GNU parallel tool;
You should install it before using the parallel* targets.
Makefile:79: recipe for target 'parallel-typing' failed
make: *** [parallel-typing] Error 1

For the record, there also exists a moreutils package that provides a parallel tool that is similar but has incompatible command-line (and doesn't seem to have the --keep-order option). GNU parallel seems to be the default in Fedora and Debian nowadays. I don't think it is possible to write the script to work with both tools; if you installed moreutils-parallel, running a parallel* target will fail with the following output:

Your 'parallel' tool seems incompatible with GNU parallel;
This target requires GNU parallel.
Makefile:79: recipe for target 'parallel-typing' failed
make: *** [parallel-typing] Error 1

gasche added a commit that referenced this pull request Feb 3, 2016
testsuite: optional 'parallel' target uses GNU parallel to halve testing time
@gasche gasche merged commit 6159d02 into ocaml:trunk Feb 3, 2016
chambart pushed a commit to chambart/ocaml-1 that referenced this pull request May 20, 2021
chambart pushed a commit to chambart/ocaml-1 that referenced this pull request Jan 4, 2022
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants