X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a7bcf0f57ffe5ef60e309c4472e6715898da7d8d..36fa571a13985879dc627c70ecc2340af606aa42:/src/smpi/smpi_global.cpp diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 3933638e8f..8d2f64695b 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -133,7 +133,7 @@ void smpi_process_init(int *argc, char ***argv) data->instance_id = instance_id; data->replaying = false; - static_cast(proc->data)->data = data; + static_cast(proc->data)->data = data; if (*argc > 3) { memmove(&(*argv)[0], &(*argv)[2], sizeof(char *) * (*argc - 2)); @@ -226,7 +226,7 @@ int smpi_global_size() smpi_process_data_t smpi_process_data() { - MsgActorExt* msgExt = static_cast(SIMIX_process_self()->data); + simgrid::MsgActorExt* msgExt = static_cast(SIMIX_process_self()->data); return static_cast(msgExt->data); } @@ -400,7 +400,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !"); smpi_switch_data_segment( - (static_cast((static_cast(comm->src_proc->data)->data))->index)); + (static_cast((static_cast(comm->src_proc->data)->data))->index)); tmpbuff = static_cast(xbt_malloc(buff_size)); memcpy(tmpbuff, buff, buff_size); } @@ -409,7 +409,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b && ((char*)comm->dst_buff < smpi_start_data_exe + smpi_size_data_exe )){ XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment"); smpi_switch_data_segment( - (static_cast((static_cast(comm->dst_proc->data)->data))->index)); + (static_cast((static_cast(comm->dst_proc->data)->data))->index)); } memcpy(comm->dst_buff, tmpbuff, buff_size); @@ -770,7 +770,18 @@ static void smpi_init_options(){ smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize-global-variables"); if (smpi_cpu_threshold < 0) smpi_cpu_threshold = DBL_MAX; - smpi_cfg_shared_malloc = xbt_cfg_get_boolean("smpi/shared-malloc"); + + char* val = xbt_cfg_get_string("smpi/shared-malloc"); + if (!strcasecmp(val, "yes") || !strcmp(val, "1") || !strcasecmp(val, "on") || !strcasecmp(val, "global")) { + smpi_cfg_shared_malloc = shmalloc_global; + } else if (!strcasecmp(val, "local")) { + smpi_cfg_shared_malloc = shmalloc_local; + } else if (!strcasecmp(val, "no") || !strcmp(val, "0") || !strcasecmp(val, "off")) { + smpi_cfg_shared_malloc = shmalloc_none; + } else { + xbt_die("Invalid value '%s' for option smpi/shared-malloc. Possible values: 'on' or 'global', 'local', 'off'", + val); + } } int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[])