This is an archive of the discontinued LLVM Phabricator instance.

Fixed intermittent hang on tests with "target teams if(0)" construct with no parallel inside
ClosedPublic

Authored by AndreyChurbanov on Feb 6 2017, 11:28 AM.

Details

Summary

Our testing found that the change r294214 has one issue with offload corner-case tests those have the code fragment:

#pragma omp target teams if(target:0)
{
}

where intermittent hang observed. Investigation showed that when master thread executes spin loop waiting for SAFE reap state of the worker thread this worker may be sleeping on a fork barrier. The solution for the problem is to check the flag the worker thread sleeps on, and resume the worker if needed so that it can mark itself as SAFE to reap.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld accepted this revision.Feb 15 2017, 12:31 AM

LGTM. Coud you add a test case on commit? Maybe with a simple call of __kmpc_fork_call with the right parameters to not rely on compiler support?

This revision is now accepted and ready to land.Feb 15 2017, 12:31 AM
This revision was automatically updated to reflect the committed changes.