From: Alan W. I. <ir...@be...> - 2008-12-18 01:29:42
|
CMake allows a parallel build capability for building software, but ctest does not allow parallel tests. I was told several months ago on the CMake list that ctest will get that capability "some day". The motivation for parallel tests is to use all the cpu's in a multi-cpu box during ctests rather then the current sad state where ctests are run one-by-one on a single cpu while the rest of your cpu's sit idle. The reason why the CMake developers cannot provide the ctest parallel capability in a hurry is that, in general, you need dependencies between the various ctests in order to run them in parallel, and it will take quite an effort to implement ctest dependencies. In the install tree examples directory we use a different approach that does not use cmake (other than to configure a simple Makefile which starts out life as examples/Makefile_examples.in) The nice thing about the Makefile approach is you can specify dependencies directly (such as the compare test depends on all other tests), and at least for the GNU version of the make command parallel execution of the tests is allowed. Accordingly, I have just configured (revision 9177) the overall Makefile for the install-tree examples to run the same tests as ctest does in the build tree. (These tests are the same as the private huge1.sh and huge2.sh scripts I ran to test out the 5.9.1 release, but with gif and xfig included as in ctest now as well.) These test are run with the "make test" command. To specify parallel tests simply specify the -j option with a number, e.g., make -j3 test where typically the number is one more than the number of processors on your box. Indeed the above command in the installed examples directory works twice as fast for me on my dual-cpu box as ctest does in the build tree. Thus, if you have a multiprocessor box and are getting frustrated at how slow ctest is in the build tree because it only uses one cpu with the rest idle, I would recommend trying the above install-tree approach instead. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |