[Openmp-commits] [PATCH] D157916: [OpenMP] Fix /tmp approach, and add environment variable method as third fallback during library registration

Terry Wilmarth via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 14 13:46:39 PDT 2023


tlwilmar created this revision.
tlwilmar added reviewers: hbae, jlpeyton.
tlwilmar added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
tlwilmar requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: jplehr, sstefan1.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157916

Files:
  openmp/runtime/src/kmp.h
  openmp/runtime/src/kmp_runtime.cpp
  openmp/runtime/src/z_Linux_util.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157916.550069.patch
Type: text/x-patch
Size: 11918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230814/df82e33d/attachment.bin>


More information about the Openmp-commits mailing list