Sandia OpenSHMEM is an implementation of the OpenSHMEM specification over multiple Networking APIs, including Portals 4, the Open Fabric Interface (OFI), and UCX. Please click on the Wiki tab for help with building and using SOS.
Other
63
stars
53
forks
source link
Patch data segment init for M1 (and M2?) Macs #1064
On MacOS, there's a problem with the initialization of the symmetric data segment (the symmetric heap is fine). I can reproduce it on a 2020 M1 MacBook Pro, but not a 2016 Intel MacBook Pro.
SOS uses get_etext and get_end to find the data segment region, but the manpage says, "Use of these routines is very strongly discouraged. The problem is that any program that is using UNIX link editor defined symbols (_end, _etext or _edata) is making assumptions that the program has the memory layout of a UNIX program." I can tell that the determined memory layout is wrong on the M1 Mac, which causes any use of a global or static variable in an SOS communication routine to go out of bounds.
It seems mach_vm_region is the standard API for gathering the segment properties (and it's very poorly documented here).
Oh, also long double is only 8 bytes on the M1 Mac, so I adjusted the iput128 unit test to use __int128.
Side note: MacOS is not a supported OS by any means, but it is an important environment for some developers (especially myself!). This patch is just a best-effort hack to support laptop development of SOS on Macs.
On MacOS, there's a problem with the initialization of the symmetric data segment (the symmetric heap is fine). I can reproduce it on a 2020 M1 MacBook Pro, but not a 2016 Intel MacBook Pro.
SOS uses
get_etext
andget_end
to find the data segment region, but the manpage says, "Use of these routines is very strongly discouraged. The problem is that any program that is using UNIX link editor defined symbols (_end, _etext or _edata) is making assumptions that the program has the memory layout of a UNIX program." I can tell that the determined memory layout is wrong on the M1 Mac, which causes any use of a global or static variable in an SOS communication routine to go out of bounds.It seems
mach_vm_region
is the standard API for gathering the segment properties (and it's very poorly documented here).Oh, also
long double
is only 8 bytes on the M1 Mac, so I adjusted the iput128 unit test to use__int128
.Side note: MacOS is not a supported OS by any means, but it is an important environment for some developers (especially myself!). This patch is just a best-effort hack to support laptop development of SOS on Macs.