This is an archive of the discontinued LLVM Phabricator instance.

Make test/parallel/omp_nested.c not use so many threads
ClosedPublic

Authored by hfinkel on Apr 13 2017, 10:37 AM.

Details

Summary

I've found it very difficult to get test/parallel/omp_nested.c to pass consistently across my build environments. The problem is that it creates N^2 threads (it is testing nested parallel regions), and that often exceeds the thread limits on systems with many cores. We do raise the process limits in lit, and that often helps, but if running lit with a smaller number of threads or on a system where we're otherwise resource constrained, this particular test tends to fail (because the runtime cannot create a sufficient number of threads).

This seems to work: if the maximum number of threads is more than some small number, then cap the number of threads used for the parallel region. The choice of 4 here is somewhat arbitrary.

Diff Detail

Repository
rL LLVM

Event Timeline

hfinkel created this revision.Apr 13 2017, 10:37 AM
This revision is now accepted and ready to land.Apr 13 2017, 10:42 AM
This revision was automatically updated to reflect the committed changes.