LLVM lit testing: is it possible to configure number of threads via `lit.cfg`?

Multi tool use
Multi tool use


LLVM lit testing: is it possible to configure number of threads via `lit.cfg`?



I wonder if it's possible to configure the number of threads for testing in a lit.cfg file.


lit.cfg



lit offers a command-line flag for specifying the number of threads:

llvm/utils/lit/lit.py -j1 <test directory>


lit



llvm/utils/lit/lit.py -j1 <test directory>



However, I'm not sure how to do this in a lit.cfg file. I want to force all tests in a subdirectory to be run with -j1 - not sure if this is possible.


lit.cfg


-j1



Edit: for reference, I'm working on the Swift codebase which has a large test suite (4000+ tests) with multiple test subdirectories.
I want to run just one subdirectory with -j1 and the rest with the default number of threads (-j12 for my machine).


-j1


-j12




1 Answer
1



I was wondering about that too a while back, but I don't think there is one because of this line here. Usually, the main project compilation times dwarf the lit tests execution time.


lit



It is easy to change, but I'd suggest using your build configuration to this (e.g. make or cmake). So, make test could execute something like lit -j $(nproc) underneath.


make


cmake


make test


lit -j $(nproc)



Edit (after OP update):



I haven't worked with the swift repo, but maybe you could hack your way around. One thing I could see is that you could influence the LIT_ARGS cmake variable with the options you want by appending to it.


swift


LIT_ARGS


cmake



Now to force a single process execution for a specific directory, you may add a lit.local.cfg that sets the singleProcess flag. This seems to override multi-thread execution:


lit.local.cfg


config.singleProcess = True





Thanks for the reply! I added some more contextual information to the OP. I'm looking for a way to configure # of threads for a specific test subdirectory. Not sure how to do that cleanly with nproc.
– Dan Zheng
Jul 3 at 8:41


nproc






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

ZlHeQETCbV,j7 3bdQ2ohiqkbCT7ZP,UUTCjr9j4aP,mBEJHZG,HKNm aGju0DfHyVdcIGmM 2RgYKz jtr4Sv35WpW,F N,EiCG
rvZe2H8A 9o977UUeqhyHypbelP9rKNNH5,lshq,FDfSd8CT,5ra6MZOdPLGquTG,qjTAmY70t9ss3t9B3kTjnIbYQnY

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications