Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Fixed portability issues with shm_open.
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Tue, 26 May 2015 18:19:15 +0000 (20:19 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Tue, 26 May 2015 18:19:15 +0000 (20:19 +0200)
- According to "man 3 shm_open", these handles should
  begin with a slash (/); this commit fixes that.

src/smpi/smpi_bench.c

index b6b56e8..d863016 100644 (file)
@@ -460,7 +460,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line)
 {
   void* mem;
   if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
-    char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line);
+    char *loc = bprintf("/%zu_%s_%d", (size_t)getpid(), file, line);
     int fd;
     shared_data_t *data;
     loc = smpi_shared_alloc_hash(loc); /* hash loc, in order to have something