Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
warning --, and ignore map_populate when not implemented (linux only, but just adviso...
authorAugustin Degomme <augustin.degomme@unibas.ch>
Thu, 16 Feb 2017 23:15:52 +0000 (00:15 +0100)
committerAugustin Degomme <augustin.degomme@unibas.ch>
Thu, 16 Feb 2017 23:15:52 +0000 (00:15 +0100)
src/smpi/smpi_bench.cpp

index 95a1e4e..b7b7c6d 100644 (file)
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
+#ifndef MAP_POPULATE
+#define MAP_POPULATE 0
+#endif
+
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (benchmarking)");
 
 /* Shared allocations are handled through shared memory segments.
@@ -607,7 +611,9 @@ void *smpi_shared_malloc(size_t size, const char *file, int line)
       unlink(name);
       free(name);
       char* dumb = (char*)calloc(1, smpi_shared_malloc_blocksize);
-      write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize);
+      ssize_t err = write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize);
+      if(err<0)
+        xbt_die("could ot write bogus file for shared malloc");
       free(dumb);
     }