codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

Distributed analysis support

Open gamesh411 opened this issue 6 years ago • 1 comments

Issue CTU analysis of clang itself is a long operation, which also does not scale well on one machine, as the typical memory usage per core far exceeds the available processor core/memory ratio on typical server configurations.

Proposal The process could potentially be sped up by horizontal scaling, ie. running disjunct subsets of build commands on different machines, then collecting the results.

Alternatives The memory usage of CTU analysis could be further tamed by creating artificial barriers on the depth of imported translation units, or by implementing an adaptive import strategy, which takes the memory usage of already imported TUs into account.

Additional context Note that, distributing CTU analysis jobs in non-CTU mode is straightforward compared to the CTU mode. In non-CTU mode the sources needed for analysis can be determined from the build command itself, but in CTU mode it is dynamically decided which additional source the analysis requires. However, distributing the whole AST information could be infeasible, and discovering the minimal subset of TUs potentially reachable from one particular TU could help. What would ultimately be needed, is creating disjunct subsets of the build-commands, which have the following properties:

  • each TU is only reachable from TUs of the same subset
  • the runtime of the analysis running on each slice is close to each other, ie the distribution of work is even

gamesh411 avatar Feb 11 '19 10:02 gamesh411

Please see http://github.com/Ericsson/codechecker/compare/master...whisperity:CodeChecker:ccaas for an early implementation idea from 2016. Note that this does not play nicely with CTU, and the "tu-collector" was not a thing back then, so this also does not play nicely with system-level dependencies...

whisperity avatar Aug 11 '24 16:08 whisperity