Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize the option smpi/shared-malloc, and improve its doc
[simgrid.git] / src / smpi / smpi_bench.cpp
index 41171c4..496809d 100644 (file)
@@ -83,8 +83,9 @@ double smpi_host_speed;
 
 int smpi_loaded_page = -1;
 char* smpi_start_data_exe = nullptr;
-uint64_t smpi_size_data_exe = 0;
+int smpi_size_data_exe = 0;
 bool smpi_privatize_global_variables;
+bool smpi_cfg_shared_malloc    = true;
 double smpi_total_benched_time = 0;
 smpi_privatisation_region_t smpi_privatisation_regions;
 
@@ -564,7 +565,7 @@ void smpi_sample_3(int global, const char *file, int line)
 void *smpi_shared_malloc(size_t size, const char *file, int line)
 {
   void* mem;
-  if (size > 0 && xbt_cfg_get_boolean("smpi/use-shared-malloc")){
+  if (size > 0 && smpi_cfg_shared_malloc) {
     int fd;
     smpi_source_location loc(file, line);
     auto res = allocs.insert(std::make_pair(loc, shared_data_t()));
@@ -605,7 +606,7 @@ void smpi_shared_free(void *ptr)
 {
   char loc[PTR_STRLEN];
 
-  if (xbt_cfg_get_boolean("smpi/use-shared-malloc")){
+  if (smpi_cfg_shared_malloc) {
     snprintf(loc, PTR_STRLEN, "%p", ptr);
     auto meta = allocs_metadata.find(ptr);
     if (meta == allocs_metadata.end()) {
@@ -730,7 +731,7 @@ void smpi_initialize_global_memory_segments()
 
   smpi_get_executable_global_size();
 
-  XBT_DEBUG ("bss+data segment found : size %zu starting at %p", smpi_size_data_exe, smpi_start_data_exe );
+  XBT_DEBUG ("bss+data segment found : size %d starting at %p", smpi_size_data_exe, smpi_start_data_exe );
 
   if (smpi_size_data_exe == 0){//no need to switch
     smpi_privatize_global_variables=false;