This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix /tmp approach, and add environment variable method as third fallback during library registration
AcceptedPublic

Authored by tlwilmar on Aug 14 2023, 1:46 PM.

Details

Summary

The /tmp fallback for /dev/shm did not write to a fixed filename, so multiple instances of the runtime would not be able to detect each other. Now, we create the /tmp file in much the same way as the /dev/shm file was created, since mkstemp approach would not work to create a file that other instances of the runtime would detect. Also, add the environment variable method as a third fallback to /dev/shm and /tmp for library registration, as some systems do not have either. Also, add ability to fallback to a subsequent method should a failure occur during any part of the registration process. When unregistering, it is assumed that the method chosen during registration should work, so errors at that point are ignored. This also avoids a problem with multiple threads trying to unregister the library.

Diff Detail

Event Timeline

tlwilmar created this revision.Aug 14 2023, 1:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2023, 1:46 PM
tlwilmar requested review of this revision.Aug 14 2023, 1:46 PM
This revision is now accepted and ready to land.Sep 13 2023, 11:44 AM